Skip to content

Commit

Permalink
Merge pull request #104 from yangby-cryptape/feature/light-client/rpc…
Browse files Browse the repository at this point in the history
…/estimate_cycles

feat(rpc): add ckb light client rpc method `estimate_cycles`
  • Loading branch information
quake authored Feb 19, 2024
2 parents 36b3115 + 2a491c5 commit a5e0dc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ rustls-tls = ["reqwest/rustls-tls"]
test = []

[dev-dependencies]
clap = { version = "4.1.8", features = ["derive"] }
clap = { version = "~4.4.18", features = ["derive"] } # TODO clap v4.5 requires rustc v1.74.0+
httpmock = "0.6"
async-global-executor = "2.3.1"
hex = "0.4"
5 changes: 3 additions & 2 deletions src/rpc/ckb_light_client.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize};

use ckb_jsonrpc_types::{
BlockNumber, BlockView, Cycle, HeaderView, JsonBytes, NodeAddress, RemoteNodeProtocol, Script,
Transaction, TransactionView, TxStatus, Uint32, Uint64,
BlockNumber, BlockView, Cycle, EstimateCycles, HeaderView, JsonBytes, NodeAddress,
RemoteNodeProtocol, Script, Transaction, TransactionView, TxStatus, Uint32, Uint64,
};
use ckb_types::H256;

Expand Down Expand Up @@ -152,6 +152,7 @@ crate::jsonrpc!(pub struct LightClientRpcClient {
pub fn get_genesis_block(&self) -> BlockView;
pub fn get_header(&self, block_hash: H256) -> Option<HeaderView>;
pub fn get_transaction(&self, tx_hash: H256) -> Option<TransactionWithStatus>;
pub fn estimate_cycles(&self, tx: Transaction)-> EstimateCycles;
/// Fetch a header from remote node. If return status is `not_found` will re-sent fetching request immediately.
///
/// Returns: FetchStatus<HeaderView>
Expand Down

0 comments on commit a5e0dc5

Please sign in to comment.