Skip to content

Conversation

@odesenfans
Copy link
Collaborator

@odesenfans odesenfans commented May 16, 2022

We now use the BasePendingMessage class in the signature verifiers
for all supported chains.

Modified some tests since we can now make some hypotheses about
fields being present (and valid) in the message object.

@odesenfans
Copy link
Collaborator Author

Depends on #272.

@odesenfans odesenfans added this to the May release milestone May 17, 2022
@odesenfans odesenfans changed the title [Chains] Use raw message model in signature verification [Chains] Use pending message model in signature verification May 18, 2022
@odesenfans odesenfans force-pushed the od-use-raw-message-in-chain-code branch from 3d57ff3 to cf29ad1 Compare May 18, 2022 08:57
@odesenfans odesenfans self-assigned this May 23, 2022
Copy link
Member

@hoh hoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except the JSON in one very long line.
It was there already and is not a regression, so I still approve the PR.

from aleph.chains.substrate import verify_signature
from aleph.schemas.pending_messages import parse_message

TEST_MESSAGE = '{"chain": "DOT", "channel": "TEST", "sender": "5CGNMKCscqN2QNcT7Jtuz23ab7JUxh8wTEtXhECZLJn5vCGX", "type": "AGGREGATE", "item_type": "inline", "time": 1601913525.231501, "item_content": "{\\"key\\":\\"test\\",\\"address\\":\\"5CGNMKCscqN2QNcT7Jtuz23ab7JUxh8wTEtXhECZLJn5vCGX\\",\\"content\\":{\\"a\\":1},\\"time\\":1601913525.231498}", "item_hash": "bfbc94fae6336d52ab65a4d907d399a0c16222bd944b3815faa08ad0e039ca1d", "signature": "{\\"curve\\": \\"sr25519\\", \\"data\\": \\"0x1ccefb257e89b4e3ecb7d71c8dc1d6e286290b9e32d2a11bf3f9d425c5790f4bff0b324dc774d20a13e38a340d1a48fada71fb0c68690c3adb8f0cc695b0eb83\\"}", "content": {"key": "test", "address": "5CGNMKCscqN2QNcT7Jtuz23ab7JUxh8wTEtXhECZLJn5vCGX", "content": {"a": 1}, "time": 1601913525.231498}}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have to be on a single line or could it be indented with triple quotes ?

We now use the `BasePendingMessage` class in the signature verifiers
for all supported chains.

Modified some tests since we can now make some hypotheses about
fields being present (and valid) in the message object.
@odesenfans odesenfans force-pushed the od-use-raw-message-in-chain-code branch from cf29ad1 to 75db19b Compare May 25, 2022 09:41
@odesenfans odesenfans marked this pull request as ready for review May 25, 2022 09:41
@odesenfans odesenfans removed their assignment May 25, 2022
@odesenfans odesenfans merged commit c13c71e into aleph-im:dev May 25, 2022
@odesenfans odesenfans deleted the od-use-raw-message-in-chain-code branch May 25, 2022 09:51
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.

2 participants