From 92800e20e74dd6d8db2722b514e903c62397b4fa Mon Sep 17 00:00:00 2001 From: duanyytop Date: Fri, 22 Apr 2022 16:11:25 +0800 Subject: [PATCH 1/2] fix: Update transfer update entries --- src/transfer_update.mol | 4 ++-- src/transfer_update.rs | 38 ++++++++++++++------------------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/transfer_update.mol b/src/transfer_update.mol index b09382c..2bce460 100644 --- a/src/transfer_update.mol +++ b/src/transfer_update.mol @@ -50,8 +50,8 @@ table ClaimUpdateCotaNFTV2Entries { table TransferUpdateCotaNFTV2Entries { claim_keys: ClaimCotaNFTKeyVec, claim_infos: ClaimCotaNFTInfoVec, - withdrawal_keys: WithdrawalCotaNFTKeyVec, - withdrawal_values: WithdrawalCotaNFTValueVec, + withdrawal_keys: WithdrawalCotaNFTKeyV1Vec, + withdrawal_values: WithdrawalCotaNFTValueV1Vec, proof: Bytes, withdrawal_proof: Bytes, action: Bytes, diff --git a/src/transfer_update.rs b/src/transfer_update.rs index 68b3d2e..450ed74 100644 --- a/src/transfer_update.rs +++ b/src/transfer_update.rs @@ -1,15 +1,5 @@ // Generated by Molecule 0.7.3 -#![allow(unused_imports)] -#![allow(dead_code)] -#![allow(clippy::if_same_then_else)] - -use super::ckb_types::prelude::*; -use super::molecule::{self, prelude::*}; -extern crate alloc; -pub use alloc::vec::*; -// these lines above are manually added - use super::common::*; use super::raw_tx::*; use molecule::prelude::*; @@ -1944,18 +1934,18 @@ impl TransferUpdateCotaNFTV2Entries { ClaimCotaNFTInfoVec::new_unchecked(self.0.slice(start..end)) } - pub fn withdrawal_keys(&self) -> WithdrawalCotaNFTKeyVec { + pub fn withdrawal_keys(&self) -> WithdrawalCotaNFTKeyV1Vec { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[12..]) as usize; let end = molecule::unpack_number(&slice[16..]) as usize; - WithdrawalCotaNFTKeyVec::new_unchecked(self.0.slice(start..end)) + WithdrawalCotaNFTKeyV1Vec::new_unchecked(self.0.slice(start..end)) } - pub fn withdrawal_values(&self) -> WithdrawalCotaNFTValueVec { + pub fn withdrawal_values(&self) -> WithdrawalCotaNFTValueV1Vec { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[16..]) as usize; let end = molecule::unpack_number(&slice[20..]) as usize; - WithdrawalCotaNFTValueVec::new_unchecked(self.0.slice(start..end)) + WithdrawalCotaNFTValueV1Vec::new_unchecked(self.0.slice(start..end)) } pub fn proof(&self) -> Bytes { @@ -2125,18 +2115,18 @@ impl<'r> TransferUpdateCotaNFTV2EntriesReader<'r> { ClaimCotaNFTInfoVecReader::new_unchecked(&self.as_slice()[start..end]) } - pub fn withdrawal_keys(&self) -> WithdrawalCotaNFTKeyVecReader<'r> { + pub fn withdrawal_keys(&self) -> WithdrawalCotaNFTKeyV1VecReader<'r> { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[12..]) as usize; let end = molecule::unpack_number(&slice[16..]) as usize; - WithdrawalCotaNFTKeyVecReader::new_unchecked(&self.as_slice()[start..end]) + WithdrawalCotaNFTKeyV1VecReader::new_unchecked(&self.as_slice()[start..end]) } - pub fn withdrawal_values(&self) -> WithdrawalCotaNFTValueVecReader<'r> { + pub fn withdrawal_values(&self) -> WithdrawalCotaNFTValueV1VecReader<'r> { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[16..]) as usize; let end = molecule::unpack_number(&slice[20..]) as usize; - WithdrawalCotaNFTValueVecReader::new_unchecked(&self.as_slice()[start..end]) + WithdrawalCotaNFTValueV1VecReader::new_unchecked(&self.as_slice()[start..end]) } pub fn proof(&self) -> BytesReader<'r> { @@ -2241,8 +2231,8 @@ impl<'r> molecule::prelude::Reader<'r> for TransferUpdateCotaNFTV2EntriesReader< } ClaimCotaNFTKeyVecReader::verify(&slice[offsets[0]..offsets[1]], compatible)?; ClaimCotaNFTInfoVecReader::verify(&slice[offsets[1]..offsets[2]], compatible)?; - WithdrawalCotaNFTKeyVecReader::verify(&slice[offsets[2]..offsets[3]], compatible)?; - WithdrawalCotaNFTValueVecReader::verify(&slice[offsets[3]..offsets[4]], compatible)?; + WithdrawalCotaNFTKeyV1VecReader::verify(&slice[offsets[2]..offsets[3]], compatible)?; + WithdrawalCotaNFTValueV1VecReader::verify(&slice[offsets[3]..offsets[4]], compatible)?; BytesReader::verify(&slice[offsets[4]..offsets[5]], compatible)?; BytesReader::verify(&slice[offsets[5]..offsets[6]], compatible)?; BytesReader::verify(&slice[offsets[6]..offsets[7]], compatible)?; @@ -2256,8 +2246,8 @@ impl<'r> molecule::prelude::Reader<'r> for TransferUpdateCotaNFTV2EntriesReader< pub struct TransferUpdateCotaNFTV2EntriesBuilder { pub(crate) claim_keys: ClaimCotaNFTKeyVec, pub(crate) claim_infos: ClaimCotaNFTInfoVec, - pub(crate) withdrawal_keys: WithdrawalCotaNFTKeyVec, - pub(crate) withdrawal_values: WithdrawalCotaNFTValueVec, + pub(crate) withdrawal_keys: WithdrawalCotaNFTKeyV1Vec, + pub(crate) withdrawal_values: WithdrawalCotaNFTValueV1Vec, pub(crate) proof: Bytes, pub(crate) withdrawal_proof: Bytes, pub(crate) action: Bytes, @@ -2278,12 +2268,12 @@ impl TransferUpdateCotaNFTV2EntriesBuilder { self } - pub fn withdrawal_keys(mut self, v: WithdrawalCotaNFTKeyVec) -> Self { + pub fn withdrawal_keys(mut self, v: WithdrawalCotaNFTKeyV1Vec) -> Self { self.withdrawal_keys = v; self } - pub fn withdrawal_values(mut self, v: WithdrawalCotaNFTValueVec) -> Self { + pub fn withdrawal_values(mut self, v: WithdrawalCotaNFTValueV1Vec) -> Self { self.withdrawal_values = v; self } From 2cdcd6cab3f34de4a20d7638732fd2913545f8ba Mon Sep 17 00:00:00 2001 From: duanyytop Date: Fri, 22 Apr 2022 16:12:53 +0800 Subject: [PATCH 2/2] Fix ci error --- src/transfer_update.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/transfer_update.rs b/src/transfer_update.rs index 450ed74..7b29403 100644 --- a/src/transfer_update.rs +++ b/src/transfer_update.rs @@ -1,5 +1,15 @@ // Generated by Molecule 0.7.3 +#![allow(unused_imports)] +#![allow(dead_code)] +#![allow(clippy::if_same_then_else)] + +use super::ckb_types::prelude::*; +use super::molecule::{self, prelude::*}; +extern crate alloc; +pub use alloc::vec::*; +// these lines above are manually added + use super::common::*; use super::raw_tx::*; use molecule::prelude::*;