Closed palango closed 1 month ago
So I looked into this, and this doesn't have to do anything with the transaction-args issue (#109) but with the JSON schema definition.
The FeeCurrency
field does not have a omitempty
JSON tag, so the key will always be explicitly included in the schema, even if it's nil
- this is the same for all transaction types, not only 0x7b
.
This is the same behavior as in the celo-blockchain
implementation.
So I think for all transaction types except for 0x7b
I would consider this unexpected behavior and the schema should not include celo-related fields.
The question is how should this behave for 0x7b
type transactions? Should the field be omitted or not when the value is nil?
The question is how should this behave for 0x7b type transactions? Should the field be omitted or not when the value is nil?
@palango and I decided to just include a ,omitempty
tag for all transaction types for now, while we agree that the field should not be omitted when nil
for the Celo transaction types. For now, we accept the intermediary state of omitting it, since implementing this feature would require significantly more code-changes to accommodate for the different encoding schemas.
This has been merged in the celo5
branch.
After a rebase (celo5) the new test
TestSignTransaction
fails with:The problem is that
"feeCurrency":null
gets added to the json-ified version of the transaction, even though it shouldn't.See also #109