-
Notifications
You must be signed in to change notification settings - Fork 49
Arkade Asset Exploration #814
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
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… update encoding/decoding logic
- Created a new CheckpointTx Builder - Modified BuildTxs to include the logic for Building AssetTransfer transaction
pkg/ark-lib/asset/asset.go
Outdated
| assetData = append(assetData, a.genesisTxId...) | ||
| assetData = append(assetData, batchTxId...) | ||
| assetData = append(assetData, encodedTlv...) |
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.
maybe we should encode these as var len bytes like len(buf)+buf?
| } | ||
|
|
||
| func (a *Asset) encodeTlv() ([]byte, error) { | ||
| var tlvRecords []tlv.Record |
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.
do we really need this external dep tls.Record to serilalize/deserialize asset data?
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.
We can always implement the encoding and decoding logic using TLV schematics, which @Kukks recommended in the Arkade Asset docs https://github.com/ArkLabsHQ/arkade-assets/blob/master/arkade-assets.md#3-packet-format-canonical-tlv , but the tlv library provides a fast way of doing it, but in the future it can always be removed for custom implementation
| tlvTypeAssetID tlv.Type = 1 | ||
| tlvTypeOutput tlv.Type = 2 | ||
| tlvTypeControlPubkey tlv.Type = 3 | ||
| tlvTypeInput tlv.Type = 4 | ||
| tlvTypeMetadata tlv.Type = 6 | ||
| tlvTypeOutScriptPubKey tlv.Type = 7 | ||
| tlvTypeInTxid tlv.Type = 8 | ||
| tlvTypeOutAmount tlv.Type = 9 | ||
| tlvTypeInVout tlv.Type = 10 | ||
| tlvTypeImmutable tlv.Type = 11 |
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.
use iota:
| tlvTypeAssetID tlv.Type = 1 | |
| tlvTypeOutput tlv.Type = 2 | |
| tlvTypeControlPubkey tlv.Type = 3 | |
| tlvTypeInput tlv.Type = 4 | |
| tlvTypeMetadata tlv.Type = 6 | |
| tlvTypeOutScriptPubKey tlv.Type = 7 | |
| tlvTypeInTxid tlv.Type = 8 | |
| tlvTypeOutAmount tlv.Type = 9 | |
| tlvTypeInVout tlv.Type = 10 | |
| tlvTypeImmutable tlv.Type = 11 | |
| tlvTypeAssetID tlv.Type = iota | |
| tlvTypeOutput | |
| tlvTypeControlPubkey | |
| tlvTypeInput | |
| tlvTypeMetadata | |
| tlvTypeOutScriptPubKey | |
| tlvTypeInTxid | |
| tlvTypeOutAmount | |
| tlvTypeInVout | |
| tlvTypeImmutable |
…logic for output handling
…s and improve clarity
- Update Receiver struct to include AssetAmount, AssetId, and AssetTeleport fields. - Modify RegisterIntent method to handle asset outputs and seals. - Enhance asset output retrieval and encoding in transaction creation. - Introduce ArkAssetSealVtxoField for marking asset seal inputs in PSBT. - Refactor tree builder to accommodate multiple outputs, including asset scripts.
… add tests for asset seal vtxo handling
… struct; update transaction building and tests accordingly
…xosLeaves; add logging for script generation
…issuance and burning; update teleport pubkey comparison in utils
…oding, and validation logic accordingly
…roups in offchain transaction processing
…set handling and introduce byte reversal utility
…fication of control VTXO and error handling for missing assets
… are correctly appended when control VTXO is found
… logic and ensure proper input management for control assets
…puts; improve clarity and maintainability
…ncy and clarity in asset input management
…fy control asset input validation
… asset input handling and error reporting
…enhance clarity and prevent vtxo reuse
Introduces comprehensive unit tests to validate the rebuilding of asset transactions
This PR is specifically for the visibility of Arkade Asset