statement-store: Add wire protocol V1 encode/decode edge case tests#3187
Merged
Conversation
10 tasks
alexggh
approved these changes
Apr 14, 2026
dmitry-markin
approved these changes
Apr 14, 2026
|
|
||
| // Ed25519 proof: signature=[0xAA; 64], signer=[0xBB; 32], expiry=1000, data=[1,2,3] | ||
| // Generated by polkadot-sdk's Statement::encode() | ||
| let ed25519_bytes = hex::decode("0c0001aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb02e803000000000000080c010203").unwrap(); |
Collaborator
There was a problem hiding this comment.
nit: Can we split this into lines under 100 characters please?
|
|
||
| // Secp256k1Ecdsa proof: signature=[0x77; 65], signer=[0x88; 33], expiry=500 | ||
| // Generated by polkadot-sdk's Statement::encode() | ||
| let secp_bytes = hex::decode("080002777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777788888888888888888888888888888888888888888888888888888888888888888802f401000000000000").unwrap(); |
Collaborator
There was a problem hiding this comment.
< 100 characters please :)
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.
Part of #3142
Extended wire protocol V1 tests to match polkadot-sdk coverage: added field ordering violations (duplicates, out-of-order), malformed bytes (invalid discriminants, corrupted proof variant, inflated field count), truncated payloads (empty, partial expiry, partial proof), and cross-compatibility hex vectors for Ed25519 and Secp256k1Ecdsa proofs generated from polkadot-sdk.