Skip to content

Commit

Permalink
Bump ckb-sdk-rust to 3.2.1
Browse files Browse the repository at this point in the history
Signed-off-by: Eval EXEC <[email protected]>
  • Loading branch information
eval-exec committed Jun 25, 2024
1 parent 6d1aa37 commit 3abd9ab
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ckb-sdk"
version = "3.2.0"
version = "3.2.1"
authors = [ "Linfeng Qian <[email protected]>", "Nervos Core Dev <[email protected]>" ]
edition = "2018"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/transfer_from_omnilock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/transfer_from_omnilock_ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/transfer_from_omnilock_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
14 changes: 13 additions & 1 deletion src/rpc/ckb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ crate::jsonrpc!(pub struct CkbRpcClient {
pub fn get_epoch_by_number(&self, number: EpochNumber) -> Option<EpochView>;
pub fn get_header(&self, hash: H256) -> Option<HeaderView>;
pub fn get_header_by_number(&self, number: BlockNumber) -> Option<HeaderView>;
pub fn get_live_cell(&self, out_point: OutPoint, with_data: bool, include_tx_pool: Option<bool>) -> 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<TransactionWithStatusResponse>;
Expand Down Expand Up @@ -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<CellWithStatus, crate::rpc::RpcError> {
self.post::<_, Option<CellWithStatus>>(
"get_live_cell",
(out_point, with_data, Some(include_tx_pool)),
)
}

// get transaction with only_committed=true
pub fn get_only_committed_transaction(
&self,
Expand Down

0 comments on commit 3abd9ab

Please sign in to comment.