Repository navigation
Core: decode the WalletConnect transaction value once - #1631
Merged
Merged
Conversation
1. WCEthereumTransaction reads value as a hex amount when the request is parsed, so a value that is not a hex number refuses the request there, and every reader takes the parsed amount. 2. decode_transaction_kind takes the value: an approval that also sends coins decodes as a contract call, so the review shows the coins it sends and the predicted balance changes. 3. The dapp simulation and WalletConnect Pay act on that decoded kind instead of their own checks, so simulation::evm::is_approval goes. 4. docs/product/wallet_connector.md gets the matching row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WCEthereumTransactionreadsvalueas a hex amount when the request is parsed, so a value that is not a hex number refuses the request there, and every reader takes the parsed amount.decode_transaction_kindtakes the value: an approval that also sends coins decodes as a contract call, so the review shows the coins it sends and the predicted balance changes.simulation::evm::is_approvalgoes.docs/product/wallet_connector.mdgets the matching row.Supersedes #1622.
0x0test_decode_transaction_kind,test_decode_ethereum_approval_datatest_decode_transaction_kind,test_decode_ethereum_transaction_kind_from_payloadtest_decode_transaction_kind,test_decode_ethereum_transaction_kind_from_payloadnullor0xtest_deserialize_wc_ethereum_transactiontest_deserialize_wc_ethereum_transaction,test_map_sendtest_map_approvalChecks:
cargo testfor primitives, gem_evm, gem_wallet_connect, payment, simulation and gemstone pass;cargo clippy --all-features -D warningson each,just lint,just format,just check-docsandjust check-ffiare clean;just fuzzfound nothing in 600 s per target (about 13M runs each forwallet_connect_transactionandwallet_connect_request).