Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit 1f89b82

Browse files
committed
0.0.346: sync
Signed-off-by: Gyuho Lee <[email protected]>
1 parent 81ed84e commit 1f89b82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2327
-1502
lines changed

Cargo.toml

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "avalanche-types"
3-
version = "0.0.323" # https://crates.io/crates/avalanche-types
3+
version = "0.0.346" # https://crates.io/crates/avalanche-types
44
edition = "2021"
55
rust-version = "1.68" # use "rustup override set stable" to overwrite current toolchain
66
publish = true
@@ -18,77 +18,77 @@ bs58 = "0.4.0"
1818
bytes = "1.4.0"
1919
chrono = "0.4.24"
2020
cmp-manager = "0.0.1"
21-
ecdsa = { version = "0.16.1", features = ["rfc6979", "verifying"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
22-
ethers-core = { version = "=2.0.1", features = ["eip712"] }
21+
ecdsa = { version = "0.16.6", features = ["rfc6979", "verifying"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
22+
ethers-core = { version = "=2.0.3", features = ["eip712"] } # https://github.com/gakonst/ethers-rs/releases
2323
hex = "0.4.3"
2424
hmac = "0.12.1"
25-
k256 = { version = "0.13.0", features = ["ecdsa"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
25+
k256 = { version = "0.13.1", features = ["ecdsa"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
2626
lazy_static = "1.4.0"
2727
log = "0.4.17"
2828
prefix-manager = "0.0.2"
2929
primitive-types = { version = "0.12.1", features = ["impl-serde"] } # https://crates.io/crates/primitive-types
3030
rand = "0.8.5"
3131
ring = "0.16.20"
3232
ripemd = "0.1.3"
33-
rust-embed = "6.6.0" # https://github.com/pyrossh/rust-embed
33+
rust-embed = "6.6.1" # https://github.com/pyrossh/rust-embed
3434
rustls-pemfile = "1.0.2"
35-
serde = { version = "1.0.158", features = ["derive"] } # https://github.com/serde-rs/serde/releases
36-
serde_json = "1.0.94" # https://github.com/serde-rs/json/releases
37-
serde_with = { version = "2.3.1", features = ["hex"] }
38-
serde_yaml = "0.9.19" # https://github.com/dtolnay/serde-yaml/releases
35+
serde = { version = "1.0.160", features = ["derive"] } # https://github.com/serde-rs/serde/releases
36+
serde_json = "1.0.96" # https://github.com/serde-rs/json/releases
37+
serde_with = { version = "2.3.2", features = ["hex"] }
38+
serde_yaml = "0.9.21" # https://github.com/dtolnay/serde-yaml/releases
3939
sha2 = "0.10.6"
40-
sha3 = "0.10.6" # https://github.com/RustCrypto/hashes
41-
spki = "0.7.0" # https://github.com/RustCrypto/formats/tree/master/spki
40+
sha3 = "0.10.7" # https://github.com/RustCrypto/hashes
41+
spki = "0.7.1" # https://github.com/RustCrypto/formats/tree/master/spki
4242
thiserror = "1.0.40"
4343
url = "2.3.1" # for "codec::serde::ip_port", "utils"
4444
zerocopy = "0.6.1"
45-
zeroize = "1.5.7" # for "BLS
45+
zeroize = "1.6.0" # for "BLS
4646

4747
# [OPTIONAL] for "libsecp256k1"
4848
secp256k1 = { version = "0.27.0", features = ["global-context", "rand-std", "recovery"], optional = true } # https://crates.io/crates/secp256k1
4949

5050
# [OPTIONAL] for "kms_aws"
51-
aws-manager = { version = "0.24.29", features = ["kms"], optional = true } # https://github.com/gyuho/aws-manager/tags
52-
aws-sdk-kms = { version = "0.24.0", optional = true } # https://crates.io/crates/aws-sdk-kms/versions
51+
aws-manager = { version = "0.26.1", features = ["kms"], optional = true } # https://github.com/gyuho/aws-manager/tags
52+
aws-sdk-kms = { version = "0.26.0", optional = true } # https://crates.io/crates/aws-sdk-kms/versions
5353

5454
# [OPTIONAL] for "cert"
5555
rcgen = { version = "0.10.0", optional = true } # https://github.com/est31/rcgen
5656
rsa = { version = "0.8.2", features = ["pem"], optional = true } # https://crates.io/crates/rsa
57-
rustls = { version = "0.20.8", optional = true } # https://github.com/rustls/rustls/tags
57+
rustls = { version = "0.21.0", optional = true } # https://github.com/rustls/rustls/tags
5858

5959
# [OPTIONAL] for "message"
6060
flate2 = { version = "1.0.25", optional = true }
6161

6262
# [OPTIONAL] for "mnemonic"
63-
bip32 = { version = "0.4.0", optional = true }
63+
bip32 = { version = "0.5.0", optional = true }
6464
rand_core = { version = "0.6.4", features = ["std"], optional = true }
6565

6666
# [OPTIONAL] for "evm", "jsonrpc_client"
67-
reqwest = { version = "0.11.15", optional = true } # https://github.com/seanmonstar/reqwest/releases
68-
tokio = { version = "1.26.0", features = ["full"], optional = true } # https://github.com/tokio-rs/tokio/releases
67+
reqwest = { version = "0.11.16", optional = true } # https://github.com/seanmonstar/reqwest/releases
68+
tokio = { version = "1.27.0", features = ["full"], optional = true } # https://github.com/tokio-rs/tokio/releases
6969

7070
# [OPTIONAL] for "evm"
7171
rlp = { version = "0.5.2", default-features = false, features = ["std"], optional = true }
7272

7373
# [OPTIONAL] for "wallet_evm"
74-
ethers = { version = "=2.0.1", features = ["eip712"], optional = true } # https://github.com/gakonst/ethers-rs/releases
75-
ethers-providers = { version = "=2.0.1", optional = true } # https://github.com/gakonst/ethers-rs/releases
76-
ethers-signers = { version = "=2.0.1", optional = true } # https://github.com/gakonst/ethers-rs/releases
74+
ethers = { version = "=2.0.3", features = ["eip712"], optional = true } # https://github.com/gakonst/ethers-rs/releases
75+
ethers-providers = { version = "=2.0.3", optional = true } # https://github.com/gakonst/ethers-rs/releases
76+
ethers-signers = { version = "=2.0.3", optional = true } # https://github.com/gakonst/ethers-rs/releases
7777

7878
# [OPTIONAL] for "subnet"
79-
futures = { version = "0.3.27", optional = true }
79+
futures = { version = "0.3.28", optional = true }
8080
http = { version = "0.2.9", optional = true }
8181
hyper = { version = "0.14.25", optional = true }
8282
jsonrpc-core = { version = "18.0.0", optional = true }
8383
jsonrpc-http-server = { version = "18.0.0", optional = true }
8484
num-derive = { version = "0.3.3", optional = true }
8585
num-traits = { version = "0.2.15", optional = true }
86-
prost = { version = "0.11.8", optional = true } # prost-build requires "cmake", https://github.com/tokio-rs/prost/releases
86+
prost = { version = "0.11.9", optional = true } # prost-build requires "cmake", https://github.com/tokio-rs/prost/releases
8787
semver = { version = "1.0.17", optional = true }
8888
tokio-stream = { version = "0.1.12", features = ["net"], optional = true }
89-
tonic = { version = "0.8.3", features = ["gzip"], optional = true } # https://github.com/hyperium/tonic/tags
90-
tonic-health = { version = "0.8.0", optional = true }
91-
tonic-reflection = { version = "0.6.0", optional = true }
89+
tonic = { version = "0.9.1", features = ["gzip"], optional = true } # https://github.com/hyperium/tonic/tags
90+
tonic-health = { version = "0.9.1", optional = true } # https://github.com/hyperium/tonic/blob/v0.9.0/tonic-health/src/lib.rs
91+
tonic-reflection = { version = "0.9.1", optional = true }
9292
tower-service = { version = "0.3.2", optional = true }
9393

9494
# [OPTIONAL] for "subnet_metrics"
@@ -106,7 +106,7 @@ protoc-gen-tonic = "0.2.2"
106106
env_logger = "0.10.0"
107107
id-manager = "0.0.3"
108108
random-manager = "0.0.5"
109-
tempfile = "3.4.0"
109+
tempfile = "3.5.0"
110110
tokio-stream = { version = "0.1.12", features = ["net"] }
111111
tokio-test = "0.4.2"
112112

@@ -141,7 +141,7 @@ codec_base64 = ["base64"]
141141
codec_big_int = ["num-bigint"]
142142
evm = ["ethers", "ethers-providers", "ethers-signers", "rlp", "tokio"]
143143
jsonrpc_client = ["ethers-providers", "reqwest", "tokio"]
144-
kms_aws = ["aws-manager", "aws-sdk-kms", "ethers-signers"]
144+
kms_aws = ["aws-manager", "aws-sdk-kms", "ethers-signers", "tokio"]
145145
libsecp256k1 = ["secp256k1"]
146146
mnemonic = ["bip32", "rand_core"]
147147
subnet_evm = []

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
| v0.0.177-200 | v1.9.5 | 21 |
1313
| v0.0.201-271 | v1.9.6,v1.9.7 | 22 |
1414
| v0.0.272-291 | v1.9.8,v1.9.9 | 23 |
15-
| v0.0.292+ | v1.9.10,v1.9.11 | 24 |
15+
| v0.0.292-335 | v1.9.10,v1.9.16 | 24 |
16+
| v0.0.336+ | v1.10.0 | 25 |
1617

1718
## Introduction
1819

examples/evm_contract_counter_increment.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ async fn main() -> io::Result<()> {
4242
let w = wallet::Builder::new(&k)
4343
.base_http_url(chain_rpc_url.clone())
4444
.build()
45-
.await?;
46-
let evm_wallet = w.evm(&signer, chain_rpc_url.as_str(), U256::from(chain_id))?;
45+
.await
46+
.unwrap();
47+
let evm_wallet = w
48+
.evm(&signer, chain_rpc_url.as_str(), U256::from(chain_id))
49+
.unwrap();
4750

4851
// parsed function of "increment()"
4952
let func = Function {
@@ -75,7 +78,8 @@ async fn main() -> io::Result<()> {
7578
.urgent()
7679
.check_acceptance(true)
7780
.submit()
78-
.await?;
81+
.await
82+
.unwrap();
7983
log::info!("evm ethers wallet SUCCESS with transaction id {}", tx_id);
8084

8185
Ok(())

examples/evm_contract_counter_increment_append_calldata.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#![allow(deprecated)]
22

3-
use std::{env::args, io, str::FromStr};
3+
use std::{env::args, str::FromStr};
44

5-
use avalanche_types::{evm::abi, jsonrpc::client::evm as json_client_evm, key, wallet};
5+
use avalanche_types::{
6+
errors::Result, evm::abi, jsonrpc::client::evm as json_client_evm, key, wallet,
7+
};
68
use ethers_core::{
79
abi::{encode as abi_encode, Function, StateMutability, Token},
810
types::{H160, U256},
@@ -15,7 +17,7 @@ use ethers_core::{
1517
/// cast call --rpc-url=http://127.0.0.1:9650/ext/bc/C/rpc 0x41a24Bc2AE2eFF7CA3a2562374F339eAd168a5dB "getNumber()" | sed -r '/^\s*$/d' | tail -1
1618
/// cast call --rpc-url=http://127.0.0.1:9650/ext/bc/C/rpc 0x41a24Bc2AE2eFF7CA3a2562374F339eAd168a5dB "getLast()"
1719
#[tokio::main]
18-
async fn main() -> io::Result<()> {
20+
async fn main() -> Result<()> {
1921
// ref. <https://github.com/env-logger-rs/env_logger/issues/47>
2022
env_logger::init_from_env(
2123
env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info"),

examples/evm_contract_counter_increment_forwarder_execute.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,15 @@ async fn main() -> io::Result<()> {
146146
let w = wallet::Builder::new(&gas_payer_key)
147147
.base_http_url(chain_rpc_url.clone())
148148
.build()
149-
.await?;
150-
let gas_payer_evm_wallet = w.evm(
151-
&gas_payer_signer,
152-
chain_rpc_url.as_str(),
153-
U256::from(chain_id),
154-
)?;
149+
.await
150+
.unwrap();
151+
let gas_payer_evm_wallet = w
152+
.evm(
153+
&gas_payer_signer,
154+
chain_rpc_url.as_str(),
155+
U256::from(chain_id),
156+
)
157+
.unwrap();
155158

156159
let tx_id = gas_payer_evm_wallet
157160
.eip1559()
@@ -160,7 +163,8 @@ async fn main() -> io::Result<()> {
160163
.urgent()
161164
.check_acceptance(true)
162165
.submit()
163-
.await?;
166+
.await
167+
.unwrap();
164168
log::info!("evm ethers wallet SUCCESS with transaction id {}", tx_id);
165169

166170
Ok(())

examples/evm_contract_counter_increment_forwarder_proxy_call.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ async fn main() -> io::Result<()> {
4545
let w = wallet::Builder::new(&k)
4646
.base_http_url(chain_rpc_url.clone())
4747
.build()
48-
.await?;
49-
let evm_wallet = w.evm(&signer, chain_rpc_url.as_str(), U256::from(chain_id))?;
48+
.await
49+
.unwrap();
50+
let evm_wallet = w
51+
.evm(&signer, chain_rpc_url.as_str(), U256::from(chain_id))
52+
.unwrap();
5053

5154
// parsed function of "increment()"
5255
let func = Function {
@@ -93,7 +96,8 @@ async fn main() -> io::Result<()> {
9396
.urgent()
9497
.check_acceptance(true)
9598
.submit()
96-
.await?;
99+
.await
100+
.unwrap();
97101
log::info!("evm ethers wallet SUCCESS with transaction id {}", tx_id);
98102

99103
Ok(())

examples/evm_contract_simple_registry_register.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ async fn main() -> io::Result<()> {
3636
let w = wallet::Builder::new(&k)
3737
.base_http_url(chain_rpc_url.clone())
3838
.build()
39-
.await?;
40-
let evm_wallet = w.evm(&signer, chain_rpc_url.as_str(), U256::from(chain_id))?;
39+
.await
40+
.unwrap();
41+
let evm_wallet = w
42+
.evm(&signer, chain_rpc_url.as_str(), U256::from(chain_id))
43+
.unwrap();
4144

4245
// parsed function of "register(string name)"
4346
let func = Function {
@@ -62,7 +65,8 @@ async fn main() -> io::Result<()> {
6265
.urgent()
6366
.check_acceptance(true)
6467
.submit()
65-
.await?;
68+
.await
69+
.unwrap();
6670
log::info!("evm ethers wallet SUCCESS with transaction id {}", tx_id);
6771

6872
Ok(())

examples/evm_contract_simple_registry_register_forwarder_execute.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,15 @@ async fn main() -> io::Result<()> {
125125
let w = wallet::Builder::new(&gas_payer_key)
126126
.base_http_url(chain_rpc_url.clone())
127127
.build()
128-
.await?;
129-
let gas_payer_evm_wallet = w.evm(
130-
&gas_payer_signer,
131-
chain_rpc_url.as_str(),
132-
U256::from(chain_id),
133-
)?;
128+
.await
129+
.unwrap();
130+
let gas_payer_evm_wallet = w
131+
.evm(
132+
&gas_payer_signer,
133+
chain_rpc_url.as_str(),
134+
U256::from(chain_id),
135+
)
136+
.unwrap();
134137

135138
let tx_id = gas_payer_evm_wallet
136139
.eip1559()
@@ -139,7 +142,8 @@ async fn main() -> io::Result<()> {
139142
.urgent()
140143
.check_acceptance(true)
141144
.submit()
142-
.await?;
145+
.await
146+
.unwrap();
143147
log::info!("evm ethers wallet SUCCESS with transaction id {}", tx_id);
144148
log::info!("registered {name_to_register}");
145149

examples/evm_send_raw_transaction_eip1559_kms_aws.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use aws_manager::kms;
88
use ethers_providers::{Http, Middleware, Provider};
99
use primitive_types::U256;
1010

11-
/// cargo run --example evm_send_raw_transaction_eip1559_kms_aws -- [HTTP RPC ENDPOINT] [KMS_CMK_ARN]
11+
/// cargo run --example evm_send_raw_transaction_eip1559_kms_aws -- [HTTP RPC ENDPOINT] [KMS_KEY_ARN]
1212
#[tokio::main]
1313
async fn main() -> io::Result<()> {
1414
// ref. <https://github.com/env-logger-rs/env_logger/issues/47>
@@ -21,24 +21,24 @@ async fn main() -> io::Result<()> {
2121
.expect("could not instantiate HTTP Provider");
2222
log::info!("created chain rpc server provider for {chain_rpc_url}");
2323

24-
let kms_cmk_arn = args().nth(2).expect("no KMS CMK ARN given");
25-
log::info!("running with {kms_cmk_arn}");
24+
let kms_key_arn = args().nth(2).expect("no KMS key ARN given");
25+
log::info!("running with {kms_key_arn}");
2626

2727
let chain_id = random_manager::u64() % 3000;
2828
let signer_nonce = U256::from(random_manager::u64() % 10);
2929
let gas_limit = U256::from(random_manager::u64() % 10000);
3030
let max_fee_per_gas = U256::from(random_manager::u64() % 10000);
3131
let value = U256::from(random_manager::u64() % 100000);
3232

33-
let shared_config = aws_manager::load_config(None, None).await?;
33+
let shared_config = aws_manager::load_config(None, None).await;
3434
let kms_manager = kms::Manager::new(&shared_config);
3535
let k1 =
36-
avalanche_types::key::secp256k1::kms::aws::Cmk::from_arn(kms_manager.clone(), &kms_cmk_arn)
36+
avalanche_types::key::secp256k1::kms::aws::Key::from_arn(kms_manager.clone(), &kms_key_arn)
3737
.await
3838
.unwrap();
3939

4040
let key_info1 = k1.to_info(1).unwrap();
41-
log::info!("loaded CMK\n\n{}\n(network Id 1)\n", key_info1);
41+
log::info!("loaded key\n\n{}\n(network Id 1)\n", key_info1);
4242

4343
let k1_signer = KmsAwsSigner::new(k1, U256::from(chain_id)).unwrap();
4444

0 commit comments

Comments
 (0)