Skip to content

test(amino): cover ethsecp256k1 pubkey amino encoding - #1977

Open
gomesalexandre wants to merge 3 commits into
cosmos:mainfrom
gomesalexandre:test_ethsecp256k1_amino_coverage
Open

gomesalexandre wants to merge 3 commits into
cosmos:mainfrom
gomesalexandre:test_ethsecp256k1_amino_coverage

Conversation

@gomesalexandre

Copy link
Copy Markdown

closes #1976

what

encodeEthSecp256k1Pubkey (and the encodeAminoPubkey ethsecp256k1 branch) had no test coverage, unlike its secp256k1 and ed25519 peers 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: an ethsecp256k1 case asserting the 5D7423DF21 amino prefix followed by the 33-byte compressed pubkey.

Vectors reuse the existing 33-byte 0x02 compressed key from the secp256k1 tests; the prefix is the module's own pubkeyAminoPrefixEthSecp256k1 constant.

receipts

$ cd packages/amino && yarn test
    encodeEthSecp256k1Pubkey
      ✓ works for ethsecp256k1
    ...
Executed 93 of 94 specs (1 pending, pre-existing sr25519 xit) - no failures

gomesalexandre and others added 3 commits August 16, 2026 20:52
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
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

PR author is not in the allowed authors list.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(amino): encodeEthSecp256k1Pubkey has no amino encoding test coverage

1 participant