Bump web3 to 0.18.0

This commit is contained in:
silverpill 2022-04-20 17:30:30 +00:00
parent e4c5440ec2
commit 536c7ecb21
4 changed files with 21 additions and 29 deletions

38
Cargo.lock generated
View file

@ -289,12 +289,6 @@ dependencies = [
"url 2.2.2",
]
[[package]]
name = "anyhow"
version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27"
[[package]]
name = "arrayref"
version = "0.3.6"
@ -781,11 +775,10 @@ dependencies = [
[[package]]
name = "ethabi"
version = "14.1.0"
version = "16.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a01317735d563b3bad2d5f90d2e1799f414165408251abb762510f40e790e69a"
checksum = "a4c98847055d934070b90e806e12d3936b787d0a115068981c1d8dfd5dfef5a5"
dependencies = [
"anyhow",
"ethereum-types",
"hex",
"serde",
@ -810,9 +803,9 @@ dependencies = [
[[package]]
name = "ethereum-types"
version = "0.11.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd"
checksum = "05136f7057fe789f06e6d41d07b34e6f70d8c86e5693b60f97aaa6553553bdaf"
dependencies = [
"ethbloom",
"fixed-hash",
@ -1374,9 +1367,9 @@ dependencies = [
[[package]]
name = "jsonrpc-core"
version = "17.1.0"
version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4467ab6dfa369b69e52bd0692e480c4d117410538526a57a304a0f2250fd95e"
checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb"
dependencies = [
"futures",
"futures-executor",
@ -1605,7 +1598,6 @@ dependencies = [
"dotenv",
"env_logger",
"hex",
"impl-trait-for-tuples",
"log",
"mime-sniffer",
"mime_guess",
@ -2117,9 +2109,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "primitive-types"
version = "0.9.1"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e"
checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373"
dependencies = [
"fixed-hash",
"impl-codec",
@ -2603,9 +2595,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "secp256k1"
version = "0.20.3"
version = "0.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d03ceae636d0fed5bae6a7f4f664354c5f4fcedf6eef053fef17e49f837d0a"
checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260"
dependencies = [
"rand 0.6.5",
"secp256k1-sys",
@ -3401,11 +3393,11 @@ dependencies = [
[[package]]
name = "web3"
version = "0.16.0"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc4c18ae15621f764fab919f7e4a83d87163494cbc3460884debef7c6bc1bc6b"
checksum = "44f258e254752d210b84fe117b31f1e3cc9cbf04c0d747eb7f8cf7cf5e370f6d"
dependencies = [
"arrayvec 0.5.2",
"arrayvec 0.7.2",
"base64",
"bytes",
"derive_more",
@ -3415,9 +3407,11 @@ dependencies = [
"futures-timer",
"headers",
"hex",
"idna 0.2.2",
"jsonrpc-core",
"log",
"parking_lot 0.11.1",
"once_cell",
"parking_lot 0.12.0",
"pin-project",
"reqwest",
"rlp",

View file

@ -54,7 +54,7 @@ pem = "1.0.2"
# Used for hashing passwords
rust-argon2 = "0.8.3"
# Used for working with ethereum keys
secp256k1 = { version = "0.20.3", features = ["rand", "rand-std"] }
secp256k1 = { version = "0.21.3", features = ["rand", "rand-std"] }
# Used for serialization/deserialization
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0"
@ -82,9 +82,7 @@ ulid = { version = "0.4.1", features = ["uuid"] }
# Used to work with UUIDs
uuid = { version = "0.8.2", features = ["serde", "v4"] }
# Used to query ethereum node
web3 = { version = "0.16.0", default-features = false, features = ["http", "http-tls", "signing"] }
# Dependency of web3; version 0.2.2 requires edition 2021
impl-trait-for-tuples = "=0.2.1"
web3 = { version = "0.18.0", default-features = false, features = ["http", "http-tls", "signing"] }
[dev-dependencies]
serial_test = "0.5.1"

View file

@ -94,7 +94,7 @@ async fn main() {
let address = key_to_ethereum_address(&private_key);
println!(
"address {:?}; private key {}",
address, private_key,
address, private_key.display_secret(),
);
},
subcmd => {

View file

@ -132,7 +132,7 @@ mod tests {
let signing_key = generate_ecdsa_key();
let message = "test_message";
let result = sign_message(
&signing_key.to_string(),
&signing_key.display_secret().to_string(),
message.as_bytes(),
).unwrap();
assert!(result.v == 27 || result.v == 28);
@ -143,7 +143,7 @@ mod tests {
#[test]
fn test_sign_contract_call() {
let signing_key = generate_ecdsa_key().to_string();
let signing_key = generate_ecdsa_key().display_secret().to_string();
let chain_id = 1;
let contract_address = "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0";
let method_name = "test";