Skip to content

Commit 5f7aa5a

Browse files
authored
Merge pull request #56 from liuck8080/feat/support_ckb_0.108.0
feat: 🎸 Bump ckb to 0.108.0
2 parents f3f8626 + c436869 commit 5f7aa5a

15 files changed

+32
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 2.5.0
22
* Support indexer `exact` search mode.
33
* Add `get_block_with_cycles` and `get_block_by_number_with_cycles` to support `get_block` and `get_block_by_number` with parameter `with_cycles`.
4+
* Support ckb 0.108.0
45

56
# 2.4.0
67
* Update ckb to 0.106.0

Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ckb-sdk"
3-
version = "2.4.1"
3+
version = "2.5.0"
44
authors = ["Linfeng Qian <thewawar@gmail.com>", "Nervos Core Dev <dev@nervos.org>"]
55
edition = "2018"
66
license = "MIT"
@@ -18,7 +18,7 @@ bech32 = "0.8.1"
1818
log = "0.4.6"
1919
reqwest = { version = "0.11", features = ["json", "blocking"] }
2020
secp256k1 = { version = "0.24", features = ["recovery"] }
21-
tokio-util = { version = "0.6", features = ["codec"] }
21+
tokio-util = { version = "0.7.7", features = ["codec"] }
2222
tokio = { version = "1" }
2323
bytes = "1"
2424
futures = "0.3"
@@ -27,32 +27,32 @@ parking_lot = "0.12"
2727
lru = "0.7.1"
2828
dashmap = "5.4"
2929

30-
ckb-types = "=0.106.0"
31-
ckb-dao-utils = "=0.106.0"
32-
ckb-traits = "=0.106.0"
33-
ckb-jsonrpc-types = "=0.106.0"
34-
ckb-hash = "=0.106.0"
35-
ckb-resource = "=0.106.0"
36-
ckb-crypto = { version = "=0.106.0", features = ["secp"] }
37-
ckb-script = { version = "=0.106.0"}
30+
ckb-types = "=0.108.0"
31+
ckb-dao-utils = "=0.108.0"
32+
ckb-traits = "=0.108.0"
33+
ckb-jsonrpc-types = "=0.108.0"
34+
ckb-hash = "=0.108.0"
35+
ckb-resource = "=0.108.0"
36+
ckb-crypto = { version = "=0.108.0", features = ["secp"] }
37+
ckb-script = { version = "=0.108.0"}
3838
bitflags = "1.3.2"
3939
sha3 = "0.10.1"
4040
enum-repr-derive = "0.2.0"
4141

4242
# for feature test
4343
rand = { version = "0.7.3", optional = true }
44-
ckb-mock-tx-types = { version = "0.106.0", optional = true }
45-
ckb-chain-spec = { version = "=0.106.0", optional = true }
44+
ckb-mock-tx-types = { version = "0.108.0", optional = true }
45+
ckb-chain-spec = { version = "0.108.0", optional = true }
4646

47-
sparse-merkle-tree = "0.5.4"
47+
sparse-merkle-tree = "0.6.1"
4848
lazy_static = "1.3.0"
4949

5050
[features]
5151
default = []
5252
test = []
5353

5454
[dev-dependencies]
55-
clap = { version = "3.1.9", features = ["derive"] }
55+
clap = { version = "4.1.8", features = ["derive"] }
5656
httpmock = "0.6"
57-
async-global-executor = "=2.0.4"
57+
async-global-executor = "2.3.1"
5858
hex = "0.4"

examples/transfer_from_multisig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn main() -> Result<(), Box<dyn StdErr>> {
201201
}
202202
Commands::Send { tx_file, ckb_rpc } => {
203203
// Send transaction
204-
let tx_info: TxInfo = serde_json::from_slice(&fs::read(&tx_file)?)?;
204+
let tx_info: TxInfo = serde_json::from_slice(&fs::read(tx_file)?)?;
205205
println!(
206206
"> tx: {}",
207207
serde_json::to_string_pretty(&tx_info.tx).unwrap()

examples/transfer_from_omnilock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fn main() -> Result<(), Box<dyn StdErr>> {
209209
}
210210
Commands::Send { tx_file, ckb_rpc } => {
211211
// Send transaction
212-
let tx_info: TxInfo = serde_json::from_slice(&fs::read(&tx_file)?)?;
212+
let tx_info: TxInfo = serde_json::from_slice(&fs::read(tx_file)?)?;
213213
println!("> tx: {}", serde_json::to_string_pretty(&tx_info.tx)?);
214214
let outputs_validator = Some(json_types::OutputsValidator::Passthrough);
215215
let _tx_hash = CkbRpcClient::new(ckb_rpc.as_str())

examples/transfer_from_omnilock_ethereum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn main() -> Result<(), Box<dyn StdErr>> {
211211
}
212212
Commands::Send { tx_file, ckb_rpc } => {
213213
// Send transaction
214-
let tx_info: TxInfo = serde_json::from_slice(&fs::read(&tx_file)?)?;
214+
let tx_info: TxInfo = serde_json::from_slice(&fs::read(tx_file)?)?;
215215
println!("> tx: {}", serde_json::to_string_pretty(&tx_info.tx)?);
216216
let outputs_validator = Some(json_types::OutputsValidator::Passthrough);
217217
let _tx_hash = CkbRpcClient::new(ckb_rpc.as_str())

examples/transfer_from_omnilock_multisig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ fn main() -> Result<(), Box<dyn StdErr>> {
239239
}
240240
Commands::Send { tx_file, ckb_rpc } => {
241241
// Send transaction
242-
let tx_info: TxInfo = serde_json::from_slice(&fs::read(&tx_file)?)?;
242+
let tx_info: TxInfo = serde_json::from_slice(&fs::read(tx_file)?)?;
243243
println!("> tx: {}", serde_json::to_string_pretty(&tx_info.tx)?);
244244
let outputs_validator = Some(json_types::OutputsValidator::Passthrough);
245245
let _tx_hash = CkbRpcClient::new(ckb_rpc.as_str())

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.61.0
1+
1.67.1

src/pubsub/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ where
154154
}
155155

156156
/// if topic is empty, return Ok, else Err
157+
#[allow(clippy::result_large_err)]
157158
pub fn try_into(self) -> Result<Client<T>, Self> {
158159
if self.topic_list.is_empty() {
159160
Ok(Client {

src/rpc/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ macro_rules! jsonrpc {
4545
$struct_name { url, id: 0, client: reqwest::blocking::Client::new(), }
4646
}
4747

48-
pub fn post<PARAM, RET>(&mut self, method:&str, params: PARAM)->Result<RET, crate::rpc::RpcError>
48+
pub fn post<PARAM, RET>(&mut self, method:&str, params: PARAM)->Result<RET, $crate::rpc::RpcError>
4949
where
5050
PARAM:serde::ser::Serialize,
5151
RET: serde::de::DeserializeOwned,
@@ -74,9 +74,9 @@ macro_rules! jsonrpc {
7474

7575
$(
7676
$(#[$attr])*
77-
pub fn $method(&mut $selff $(, $arg_name: $arg_ty)*) -> Result<$return_ty, crate::rpc::RpcError> {
77+
pub fn $method(&mut $selff $(, $arg_name: $arg_ty)*) -> Result<$return_ty, $crate::rpc::RpcError> {
7878
let method = String::from(stringify!($method));
79-
let params = crate::serialize_parameters!($($arg_name,)*);
79+
let params = $crate::serialize_parameters!($($arg_name,)*);
8080
$selff.id += 1;
8181

8282
let mut req_json = serde_json::Map::new();

src/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn test_transfer_to_acp() {
339339
let account1_key = secp256k1::SecretKey::from_slice(ACCOUNT1_KEY.as_bytes()).unwrap();
340340
let signer1 = SecpCkbRawKeySigner::new_with_secret_keys(vec![account1_key]);
341341
let sighash_unlocker = AcpUnlocker::from(Box::new(signer1) as Box<_>);
342-
let acp_unlocker = AcpUnlocker::from(Box::new(SecpCkbRawKeySigner::default()) as Box<_>);
342+
let acp_unlocker = AcpUnlocker::from(Box::<SecpCkbRawKeySigner>::default() as Box<_>);
343343
let mut unlockers: HashMap<ScriptId, Box<dyn ScriptUnlocker>> = HashMap::default();
344344
unlockers.insert(
345345
ScriptId::new_type(SIGHASH_TYPE_HASH),
@@ -1042,7 +1042,7 @@ fn test_udt_transfer() {
10421042
let account1_key = secp256k1::SecretKey::from_slice(ACCOUNT1_KEY.as_bytes()).unwrap();
10431043
let signer = SecpCkbRawKeySigner::new_with_secret_keys(vec![account1_key]);
10441044
let script_unlocker = SecpSighashUnlocker::from(Box::new(signer) as Box<_>);
1045-
let acp_unlocker = AcpUnlocker::from(Box::new(SecpCkbRawKeySigner::default()) as Box<_>);
1045+
let acp_unlocker = AcpUnlocker::from(Box::<SecpCkbRawKeySigner>::default() as Box<_>);
10461046
let mut unlockers: HashMap<ScriptId, Box<dyn ScriptUnlocker>> = HashMap::default();
10471047
unlockers.insert(
10481048
ScriptId::new_type(SIGHASH_TYPE_HASH.clone()),

0 commit comments

Comments
 (0)