Open YaronWittenstein opened 2 years ago
Blob32
Blob64
Blob256
Blob512
Reserved
or
https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-layout/src/lib.rs#L29-L30
svm-sdk-types
https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/sdk-types/src/blob.rs#L162
impl_blob_type!(Blob32, 32); impl_blob_type!(Blob64, 64);
Add the encoding implementation to svm-abi-encoder crate:
svm-abi-encoder
impl Encoder for use svm_sdk_types::Blob32 { ...} impl Encoder for use svm_sdk_types::Blob64 { ...}
Add the decoding part to the svm-abi-decoder crate:
svm-abi-decoder
Add Blob32 and Blob64 here: https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-decoder/src/decoder.rs#L28
Implement decode_blob32 and blob64 here: https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-decoder/src/decoder.rs#L94
decode_blob32
blob64
Should be easy, just use the decode_fixed_primitive! macro as done in decode_addr
decode_fixed_primitive!
decode_addr
svm-sdk
So add the Blob32 and Blob64
Blob32
andBlob64
(orBlob256
andBlob512
if you prefer bits) types to the ABI layouts used for the Fixed-Gas. We can take advantage of theseReserved
types encodings: https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-layout/src/lib.rs#L10-L12or
https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-layout/src/lib.rs#L29-L30
svm-sdk-types
crate:https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/sdk-types/src/blob.rs#L162
Add the encoding implementation to
svm-abi-encoder
crate:Add the decoding part to the
svm-abi-decoder
crate:Add
Blob32
andBlob64
here: https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-decoder/src/decoder.rs#L28Implement
decode_blob32
andblob64
here: https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/abi-decoder/src/decoder.rs#L94Should be easy, just use the
decode_fixed_primitive!
macro as done indecode_addr
svm-sdk
crate: https://github.com/spacemeshos/svm/blob/6edb73de199fafce0953f82af061ca1090ff911c/crates/sdk/src/lib.rs#L388So add the
Blob32
andBlob64