-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receipts for deployments with COAs have both contractAddress
and to
fields present
#535
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
contractAddress
and to
fields presentcontractAddress
and to
fields present
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.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
tests/web3js/eth_non_interactive_test.js (1)
65-75
: Enhanced test case for transaction receipt validation.The added assertions in the
get block
test case correctly validate the transaction receipt based on the transaction context. This enhancement ensures that the receipt fields are accurately checked for both contract deployments and standard transactions.Consider adding more detailed comments in the test to explain the rationale behind these assertions, which will improve the maintainability and readability of the test code.
// for contract deployments, `to` should always be `nil` | ||
if dc.SubType == types.DeployCallSubType { | ||
return nil | ||
} | ||
|
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.
Correct implementation for contract deployments.
The added logic in the To()
method correctly handles contract deployments by setting the to
address to nil
when the SubType
is DeployCallSubType
. This change ensures compliance with the JSON-RPC API specifications for transaction receipts.
Consider adding a unit test to verify that the to
field is set to nil
for deployment transactions. Would you like me to help with this?
Description
When the
contractAddress
field is present, theto
field should be absent, as per the JSON-RPC API specification for transaction receipts.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
to
address is set tonil
for contract creation.Bug Fixes