internal/ethapi: support "input" in transaction args#15640
Conversation
|
There is still a problem that raw transactions are decoded to core.types.Transaction which uses the 'input' field name for payload. from Geth/internal/ethapi/api.go: The current javascript tooling to construct and sign transactions uses the 'data' field: ex web3-eth-accounts: Am I missing something? |
|
@arrivets Yes, I think you are.. For the rlp-decoding, it doesn't matter what field is used internally. This PR would still accept current tooliing using |
|
I think this PR makes sense, but instead of failing if both are non-nil, it could check if they are equal first. |
|
ah yes of course.. thanks @holiman |
There was a problem hiding this comment.
The error message is a bit obfuscated. It's not entirely obvious from the error message that it will fail if the user supplies both. When two entities are mutually exclusive, it does not require that one be nil.
Perhaps it makes sense to have the error message something on the lines of: "Please supply either data or input."
|
PTAL |
holiman
left a comment
There was a problem hiding this comment.
LGTM (have not yet tested, only looked at the code)
The tx data field is called "input" in returned objects and "data" in argument objects. Make it so "input" can be used in args, but bail if both "input" and "data" are set. Fixes ethereum#15628
|
Rebased again to remove lint failure |
The tx data field is called "input" in returned objects and "data" in argument objects. Make it so "input" can be used, but bail if both are set.
The tx data field is called "input" in returned objects and "data" in argument objects. Make it so "input" can be used, but bail if both are set.
The tx data field is called "input" in returned objects and "data" in
argument objects. Make it so "input" can be used, but bail if both are
set.
Fixes #15628