-
Notifications
You must be signed in to change notification settings - Fork 26
change: Use transaction metadata instead of datum in bridge transfers #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e72977a to
7b94d95
Compare
7b94d95 to
1aee631
Compare
1aee631 to
36be496
Compare
| ] | ||
| }'; | ||
| reserve_datum jsonb := '{ "v": 1, "p": "reserve" }'; | ||
| transfer_datum_1 jsonb := '{ "v": 1, "p": { "receiver": "0xabcd" } }'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does v, p, and receiver come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These keys correspond to the TokenTransferMetadatum and VersionedMetadatum structures defined in our Rust codebase, mirroring the on-chain metadata format:
v stands for "version" (defined in VersionedMetadatum trait in toolkit/smart-contracts/plutus-data/src/lib.rs).
p stands for "payload" (also in VersionedMetadatum).
receiver is a field in the UserTransfer variant of TokenTransferMetadatumV1 (defined in toolkit/smart-contracts/plutus-data/src/bridge.rs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So our own Rust implementation of the offchain code is a specification in this case. I'm wondering about the other offchain that will be used instead of our own. Let me get back to you soon.
| VALUES ( 0 , 0 , reserve_datum , '' , reserve_transfer_tx ) | ||
| , ( 1 , 1 , transfer_datum_1 , '' , user_transfer_tx_1 ) | ||
| , ( 2 , 2 , transfer_datum_2 , '' , user_transfer_tx_2 ) | ||
| , ( 3 , 3 , invalid_datum , '' , invalid_transfer_tx_1 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I don't like. Shouldn't there be same "key" for each user transfer and maybe a different one for reserve transfer? Or maybe even multiple keys for each transaction?
Description
Add your description here, if it fixes a particular issue please provide a
link
to the issue.
Checklist
changelog.mdfor affected crate