-
Notifications
You must be signed in to change notification settings - Fork 548
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
Ignore old, deprecated fields in rosetta transactions #15718
Conversation
!ci-build-me |
!ci-build-me |
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.
Tested it and it works for me. If it fixes the reported issue, all good.
Confirmed working with transaction
|
Tested it by running
Also, I wrote these cases as unit tests for the JSON deserialization. I can push them to the branch if desired. |
!ci-build-me |
!approved-for-mainnet |
| `Null -> | ||
false | ||
| _ -> | ||
raise (Non_null field) |
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.
question
Will this not cause the fold to raise early if there are multiple deprecated fields, but the first is populated.
For example wouldn't it raise here instead of filtering on the second field.
{
"signature": "a9ad136ccc8dfdfc76937dc884036d625cbdc6baadc968c13f2be090bf53a01f3e0cee3f0959c6a85f6d939ca08d9200ee15a0a64440a0f8e5affe8afde3251f",
"payment": {
"to": "B62qkcjubxpCvKyJvtisJqVrnNcXHE7EeZPbQ9FNJbTbFwXPVcYnjgX",
"from": "B62qoigHEtJCoZ5ekbGHWyr9hYfc6fkZ2A41h9vvVZuvty9amzEz3yB",
"fee": "10000000000",
"token": "1",
"nonce": "68",
"memo": null,
"amount": "16571009648348",
"valid_until": "4294967295"
},
"stake_delegation": null,
"create_token": <non null value>,
"create_token_account": null,
"mint_tokens": null
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.
Yes, that's the intention. If there's a non-null value, the transaction is malformed and we want to abort with the error below.
This PR allows rosetta parsing to ignore deprecated fields when they are null.
Checklist: