Repository navigation
change: Use transaction metadata instead of datum in bridge transfers - #1130
AmbientTea wants to merge 12 commits into
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.
Where does v, p, and receiver come from?
There was a problem hiding this comment.
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.
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.
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