Skip to content

Commit 4036692

Browse files
authored
Merge pull request #107 from cita-cloud/upgrade_deps
upgrade deps
2 parents 400633e + fffded7 commit 4036692

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
clap = { version = "4.5", features = ["cargo"] }
99
clap_complete = "4.5"
1010
hex = "0.4"
11-
tokio = { version = "1.38", features = ["full"] }
11+
tokio = { version = "1.41", features = ["full"] }
1212
rand = "0.8"
1313
tonic = "0.12"
1414
prost = "0.13"
@@ -17,7 +17,7 @@ serde = "1.0"
1717
serde_derive = "1.0"
1818
serde_json = "1.0"
1919
lazy_static = "1.5"
20-
thiserror = "1.0"
20+
thiserror = "2.0"
2121
anyhow = "1.0"
2222
home = "0.5"
2323
indicatif = "0.17"
@@ -28,7 +28,7 @@ rustyline = "14.0"
2828
shell-words = "1.1"
2929
parking_lot = "0.12"
3030
crossbeam = "0.8"
31-
tempfile = "3.10"
31+
tempfile = "3.14"
3232
# crypto SM
3333
libsm = "0.6"
3434
efficient-sm2 = "0.2"
@@ -37,7 +37,7 @@ aes = "0.8"
3737
ctr = "0.9"
3838
# ethabi cli
3939
ethabi = "18.0"
40-
itertools = "0.12"
40+
itertools = "0.13"
4141
rlp = "0.5"
4242
static_merkle_tree = "1.1"
4343
ethereum-types = "0.14"
@@ -47,12 +47,12 @@ ophelia-blst = "0.3"
4747
cita-crypto = "0.1"
4848
sha3 = "0.10"
4949
tiny-keccak = { version = "2.0", features = ["keccak"] }
50-
secp256k1 = { version = "0.29", features = ["rand-std", "recovery"] }
50+
secp256k1 = { version = "0.30", features = ["rand", "recovery"] }
5151
hashable = { package = "cita-hashable", version = "0.1" }
5252
# legacy
5353
rustbreak = { version = "2.0", features = ["ron_enc"] }
5454
cita-merklehash = { version = "0.1", features = ["sm3hash"] }
55-
bytes = { version = "1.6", features = ["serde"] }
55+
bytes = { version = "1.8", features = ["serde"] }
5656
bloomchain = "0.2"
5757
eth-jsonrpc-lib = "0.4"
5858

@@ -63,7 +63,7 @@ libproto = { git = "https://github.com/cita-cloud/libproto", rev = "9388049a964b
6363
openssl = { version = "0.10", features = ["vendored"] }
6464

6565
[dev-dependencies]
66-
mockall = "0.12"
66+
mockall = "0.13"
6767

6868
[profile.release]
6969
lto = true

src/crypto/eth.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ fn secp256k1_sign(msg: &[u8], sk: &SecretKey) -> Signature {
8888
// [<sig><recovery_id>]
8989
let mut output = [0u8; SIGNATURE_BYTES_LEN];
9090
output[..SIGNATURE_BYTES_LEN - 1].copy_from_slice(&sig);
91-
output[SIGNATURE_BYTES_LEN - 1] = recovery_id.to_i32() as u8;
91+
output[SIGNATURE_BYTES_LEN - 1] = recovery_id as u8;
9292

9393
output
9494
}
9595

9696
#[allow(unused)]
9797
pub fn secp256k1_recover(message: &[u8], signature: &Signature) -> Option<PublicKey> {
9898
let context = &SECP256K1;
99-
let rid = secp256k1::ecdsa::RecoveryId::from_i32(i32::from(signature[SIGNATURE_BYTES_LEN - 1]))
100-
.ok()?;
99+
let rid =
100+
secp256k1::ecdsa::RecoveryId::try_from(signature[SIGNATURE_BYTES_LEN - 1] as i32).ok()?;
101101
let rsig = secp256k1::ecdsa::RecoverableSignature::from_compact(
102102
&signature[0..SIGNATURE_BYTES_LEN - 1],
103103
rid,

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,10 @@ fn main() -> Result<()> {
105105
let cldi = cmd::cldi_cmd();
106106
let m = cldi.get_matches();
107107

108-
cldi.exec_with(&m, &mut ctx).map_err(|e| {
108+
cldi.exec_with(&m, &mut ctx).inspect_err(|e| {
109109
if let Some(e) = e.downcast_ref::<clap::Error>() {
110110
e.exit();
111111
}
112-
e
113112
})?;
114113

115114
// Enter interactive mode if no subcommand provided

0 commit comments

Comments
 (0)