From 3abd9abf80807f5ef439faab39ec989f09a81d82 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 7 Jun 2024 11:05:50 +0800 Subject: [PATCH] Bump ckb-sdk-rust to 3.2.1 Signed-off-by: Eval EXEC --- Cargo.toml | 2 +- README.md | 2 +- examples/transfer_from_omnilock.rs | 2 +- examples/transfer_from_omnilock_ethereum.rs | 2 +- examples/transfer_from_omnilock_multisig.rs | 2 +- src/rpc/ckb.rs | 14 +++++++++++++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fc2be1b3..ca9638e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckb-sdk" -version = "3.2.0" +version = "3.2.1" authors = [ "Linfeng Qian ", "Nervos Core Dev " ] edition = "2018" license = "MIT" diff --git a/README.md b/README.md index b74bc965..bdc6128d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ These features allow for seamless interaction with CKB and facilitate the develo ```toml # Cargo.toml [dependencies] -ckb-sdk = "3.2.0" +ckb-sdk = "3.2.1" ``` ## Build diff --git a/examples/transfer_from_omnilock.rs b/examples/transfer_from_omnilock.rs index b9a0b7cd..9aee72a9 100644 --- a/examples/transfer_from_omnilock.rs +++ b/examples/transfer_from_omnilock.rs @@ -335,7 +335,7 @@ fn build_omnilock_cell_dep( tx_hash: tx_hash.clone(), index: ckb_jsonrpc_types::Uint32::from(index as u32), }; - let cell_status = ckb_client.get_live_cell(out_point_json, false)?; + let cell_status = ckb_client.get_live_cell(out_point_json, false, None)?; let script = Script::from(cell_status.cell.unwrap().output.type_.unwrap()); let type_hash = script.calc_script_hash(); diff --git a/examples/transfer_from_omnilock_ethereum.rs b/examples/transfer_from_omnilock_ethereum.rs index 52543ac8..d91982f6 100644 --- a/examples/transfer_from_omnilock_ethereum.rs +++ b/examples/transfer_from_omnilock_ethereum.rs @@ -342,7 +342,7 @@ fn build_omnilock_cell_dep( tx_hash: tx_hash.clone(), index: ckb_jsonrpc_types::Uint32::from(index as u32), }; - let cell_status = ckb_client.get_live_cell(out_point_json, false)?; + let cell_status = ckb_client.get_live_cell(out_point_json, false, None)?; let script = Script::from(cell_status.cell.unwrap().output.type_.unwrap()); let type_hash = script.calc_script_hash(); diff --git a/examples/transfer_from_omnilock_multisig.rs b/examples/transfer_from_omnilock_multisig.rs index fc94ca66..77ace77a 100644 --- a/examples/transfer_from_omnilock_multisig.rs +++ b/examples/transfer_from_omnilock_multisig.rs @@ -391,7 +391,7 @@ fn build_omnilock_cell_dep( tx_hash: tx_hash.clone(), index: ckb_jsonrpc_types::Uint32::from(index as u32), }; - let cell_status = ckb_client.get_live_cell(out_point_json, false)?; + let cell_status = ckb_client.get_live_cell(out_point_json, false, None)?; let script = Script::from(cell_status.cell.unwrap().output.type_.unwrap()); let type_hash = script.calc_script_hash(); diff --git a/src/rpc/ckb.rs b/src/rpc/ckb.rs index 07e31661..b07d0213 100644 --- a/src/rpc/ckb.rs +++ b/src/rpc/ckb.rs @@ -24,7 +24,7 @@ crate::jsonrpc!(pub struct CkbRpcClient { pub fn get_epoch_by_number(&self, number: EpochNumber) -> Option; pub fn get_header(&self, hash: H256) -> Option; pub fn get_header_by_number(&self, number: BlockNumber) -> Option; - pub fn get_live_cell(&self, out_point: OutPoint, with_data: bool, include_tx_pool: Option) -> CellWithStatus; + pub fn get_live_cell(&self, out_point: OutPoint, with_data: bool) -> CellWithStatus; pub fn get_tip_block_number(&self) -> BlockNumber; pub fn get_tip_header(&self) -> HeaderView; pub fn get_transaction(&self, hash: H256) -> Option; @@ -211,6 +211,18 @@ impl CkbRpcClient { ) } + pub fn get_live_cell_with_include_tx_pool( + &self, + out_point: OutPoint, + with_data: bool, + include_tx_pool: bool, + ) -> Result { + self.post::<_, Option>( + "get_live_cell", + (out_point, with_data, Some(include_tx_pool)), + ) + } + // get transaction with only_committed=true pub fn get_only_committed_transaction( &self,