Repository navigation
test(amino): cover ethsecp256k1 pubkey amino encoding - #1977
Open
gomesalexandre wants to merge 3 commits into
Open
gomesalexandre wants to merge 3 commits into
gomesalexandre wants to merge 3 commits into
Conversation
ExecuteResult only exposed events, dropping the binary data a contract returns via Response::set_data (cosmos#1648). Add a `data: readonly Uint8Array[]` field decoded from the tx's MsgExecuteContractResponse msgResponses, one entry per instruction in order. Empty for Cosmos SDK < 0.46, which does not expose message responses. Verified the decode round-trips the data; extended the execute and executeMultiple specs to assert one data entry per instruction. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
decodePubkey's /cosmos.crypto.multisig.LegacyAminoPubKey branch had no test coverage. Add a case that builds a 2-of-2 multisig over the existing secp256k1 and ed25519 keys, encodes it, and checks decodePubkey reconstructs it, exercising the LegacyAminoPubKey branch on both encode and decode. closes cosmos#1344
encodeEthSecp256k1Pubkey and the encodeAminoPubkey ethsecp256k1 branch had no test coverage, unlike their secp256k1 and ed25519 peers. Add a success + error case for encodeEthSecp256k1Pubkey and an ethsecp256k1 case for encodeAminoPubkey (5D7423DF21 prefix + the compressed pubkey). closes cosmos#1976
|
PR author is not in the allowed authors list. |
This branch has not been deployed
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.
closes #1976
what
encodeEthSecp256k1Pubkey(and theencodeAminoPubkeyethsecp256k1 branch) had no test coverage, unlike itssecp256k1anded25519peers which each get success + error cases.how
Adds to
packages/amino/src/encoding.spec.ts:encodeEthSecp256k1Pubkey: a compressed-key success case (os/PubKeyEthSecp256k1) and an uncompressed-key throw case.encodeAminoPubkey: anethsecp256k1case asserting the5D7423DF21amino prefix followed by the 33-byte compressed pubkey.Vectors reuse the existing 33-byte 0x02 compressed key from the
secp256k1tests; the prefix is the module's ownpubkeyAminoPrefixEthSecp256k1constant.receipts