-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Align receipt with execution apis #332
Conversation
Move uints back to hex strings Signed-off-by: Danno Ferrin <danno.ferrin@hedera.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
Some suggestions also i think you're missing test update.
Can see my PR that introduced the change so it's easy to see what to revert
packages/relay/src/lib/model.ts
Outdated
const contractAddress = record.contractFunctionResult == undefined ? undefined : "0x" + record.contractFunctionResult.contractId?.toSolidityAddress(); | ||
|
||
this.transactionHash = txHash; | ||
this.transactionIndex = 0; | ||
this.blockNumber = Number(block.number); | ||
this.transactionIndex = "0x0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.transactionIndex = "0x0"; | |
this.transactionIndex = EthImpl.zeroHex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for a direct rollback on this line.
this.contractAddress = contractAddress; | ||
this.logs = []; | ||
this.logsBloom = ''; | ||
this.status = record.receipt.status == Status.Success ? 1 : 0; | ||
this.status = record.receipt.status == Status.Success ? "0x1" : "0x0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also move 0x1
to a static class variable
this.status = record.receipt.status == Status.Success ? "0x1" : "0x0"; | |
this.status = record.receipt.status == Status.Success ? "0x1" : EthImpl.zeroHex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for a direct rollback on this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. 0x0
and 0x1
should still be static class constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO biggie. We can clean this and other files up later
packages/relay/src/lib/model.ts
Outdated
@@ -20,6 +20,7 @@ | |||
|
|||
// Used for fake implementation of block history | |||
import {Status, TransactionRecord} from "@hashgraph/sdk"; | |||
import {EthImpl} from "./eth"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, seems weird to be importing this just for a formatting method.
Eventually (not a fix for now) I think we should move the converter functions out to the formatter.ts
class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for a direct rollback in other parts of code so this isn't needed.
Codecov Report
@@ Coverage Diff @@
## main #332 +/- ##
=======================================
Coverage 62.44% 62.44%
=======================================
Files 9 9
Lines 868 868
Branches 141 141
=======================================
Hits 542 542
Misses 288 288
Partials 38 38
Continue to review full report at Codecov.
|
Signed-off-by: Danno Ferrin <danno.ferrin@hedera.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG.
"should execute "eth_getTransactionReceipt" for hash..." acceptance tests need updating with your new logic
this.contractAddress = contractAddress; | ||
this.logs = []; | ||
this.logsBloom = ''; | ||
this.status = record.receipt.status == Status.Success ? 1 : 0; | ||
this.status = record.receipt.status == Status.Success ? "0x1" : "0x0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. 0x0
and 0x1
should still be static class constants
this.contractAddress = contractAddress; | ||
this.logs = []; | ||
this.logsBloom = ''; | ||
this.status = record.receipt.status == Status.Success ? 1 : 0; | ||
this.status = record.receipt.status == Status.Success ? "0x1" : "0x0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO biggie. We can clean this and other files up later
Signed-off-by: Danno Ferrin <danno.ferrin@hedera.com>
Kudos, SonarCloud Quality Gate passed!
|
Description:
Move uints back to hex strings
Signed-off-by: Danno Ferrin danno.ferrin@hedera.com
Related issue(s):
Fixes #302
Notes for reviewer:
Checklist