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

Commit adcc435

Browse files
Update avalanche-types
1 parent 50f5d41 commit adcc435

File tree

20 files changed

+1674
-1257
lines changed

20 files changed

+1674
-1257
lines changed

Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "avalanche-types"
3-
version = "0.0.394" # https://crates.io/crates/avalanche-types
3+
version = "0.0.396" # https://crates.io/crates/avalanche-types
44
edition = "2021"
55
rust-version = "1.69" # use "rustup override set stable" to overwrite current toolchain
66
publish = true
@@ -20,7 +20,7 @@ cert-manager = "0.0.10" # https://github.com/gyuho/cert-manager
2020
chrono = "0.4.24"
2121
cmp-manager = "0.0.1"
2222
ecdsa = { version = "0.16.7", features = ["rfc6979", "verifying"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
23-
ethers-core = { version = "=2.0.4", features = ["eip712"] } # https://github.com/gakonst/ethers-rs/releases
23+
ethers-core = { version = "=2.0.6", features = ["eip712"] } # https://github.com/gakonst/ethers-rs/releases
2424
hex = "0.4.3"
2525
hmac = "0.12.1"
2626
k256 = { version = "0.13.1", features = ["ecdsa"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
@@ -48,7 +48,7 @@ zeroize = "1.6.0" # for "BLS
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.28.0", features = ["kms"], optional = true } # https://github.com/gyuho/aws-manager/tags
51+
aws-manager = { version = "0.28.1", features = ["kms"], optional = true } # https://github.com/gyuho/aws-manager/tags
5252
aws-sdk-kms = { version = "0.28.0", optional = true } # https://crates.io/crates/aws-sdk-kms/versions
5353

5454
# [OPTIONAL] for "message"
@@ -66,9 +66,9 @@ tokio = { version = "1.28.1", features = ["full"], optional = true } # https://g
6666
rlp = { version = "0.5.2", default-features = false, features = ["std"], optional = true }
6767

6868
# [OPTIONAL] for "wallet_evm"
69-
ethers = { version = "=2.0.4", features = ["eip712"], optional = true } # https://github.com/gakonst/ethers-rs/releases
70-
ethers-providers = { version = "=2.0.4", optional = true } # https://github.com/gakonst/ethers-rs/releases
71-
ethers-signers = { version = "=2.0.4", optional = true } # https://github.com/gakonst/ethers-rs/releases
69+
ethers = { version = "=2.0.6", features = ["eip712"], optional = true } # https://github.com/gakonst/ethers-rs/releases
70+
ethers-providers = { version = "=2.0.6", optional = true } # https://github.com/gakonst/ethers-rs/releases
71+
ethers-signers = { version = "=2.0.6", optional = true } # https://github.com/gakonst/ethers-rs/releases
7272

7373
# [OPTIONAL] for "subnet"
7474
futures = { version = "0.3.28", optional = true }
@@ -90,7 +90,7 @@ tower-service = { version = "0.3.2", optional = true }
9090
prometheus = { version = "0.13.3", default-features = false, features = ["process"], optional = true }
9191

9292
# [OPTIONAL] for "codec"
93-
base64 = { version = "0.21.1", optional = true } # https://github.com/marshallpierce/rust-base64
93+
base64 = { version = "0.21.2", optional = true } # https://github.com/marshallpierce/rust-base64
9494
num-bigint = { version = "0.4.3", optional = true }
9595

9696
[build-dependencies]
@@ -107,7 +107,8 @@ tokio-test = "0.4.2"
107107

108108
# Add optional features to docs.
109109
[package.metadata.docs.rs]
110-
features = ["subnet", "subnet_metrics"]
110+
all-features = true
111+
rustdoc-args = ["--cfg", "docsrs"]
111112

112113
[features]
113114
default = [

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
| v0.0.201-271 | v1.9.6,v1.9.7 | 22 |
1414
| v0.0.272-291 | v1.9.8,v1.9.9 | 23 |
1515
| v0.0.292-335 | v1.9.10,v1.9.16 | 24 |
16-
| v0.0.336+ | v1.10.0 | 25 |
16+
| v0.0.336-390 | v1.10.0 | 25 |
17+
| v0.0.391+ | v1.10.1+ | 26 |
1718

1819
## Introduction
1920

scripts/examples.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if ! [[ "$0" =~ scripts/examples.sh ]]; then
66
exit 255
77
fi
88

9-
cargo run --example key_cert --features="cert" -- /tmp/test.insecure.key /tmp/test.insecure.cert
9+
cargo run --example key_cert -- /tmp/test.insecure.key /tmp/test.insecure.cert
1010

1111
# cargo run --example key_secp256k1_kms_aws --features="kms_aws"
1212

scripts/protobuf_codegen.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# protocol version is the version of the gRPC proto definitions
44
# as defined by the avalanchego rpcchainvm.
55
# ref. https://github.com/ava-labs/avalanchego/blob/v1.9.11/version/constants.go#L15-L17
6-
PROTOCOL_VERSION='24'
6+
PROTOCOL_VERSION='26'
77

88
if ! [[ "$0" =~ scripts/protobuf_codegen.sh ]]; then
99
echo "must be run from repository root"
1010
exit 255
1111
fi
1212

1313
# ref. https://docs.buf.build/installation
14-
BUF_VERSION='1.15.1'
14+
BUF_VERSION='1.19.0'
1515
if [[ $(buf --version | cut -f2 -d' ') != "${BUF_VERSION}" ]]; then
1616
echo "could not find buf ${BUF_VERSION}, is it installed + in PATH?"
1717
exit 255

src/jsonrpc/admin.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ mod tests {
7878

7979
#[test]
8080
fn test_deserialization() {
81-
let resp = ChainAliasResponse {
81+
let expected = ChainAliasResponse {
8282
jsonrpc: String::from(DEFAULT_VERSION),
8383
id: DEFAULT_ID,
8484
};
8585

86-
let expected = r#"{"jsonrpc": "2.0","id": 1,"result": {}}"#.as_bytes();
86+
let response = r#"{"jsonrpc": "2.0","id": 1,"result": {}}"#.as_bytes();
8787
let deserialized: ChainAliasResponse =
88-
serde_json::from_slice(expected).expect("failed deserialization");
88+
serde_json::from_slice(response).expect("failed deserialization");
8989

90-
assert_eq!(resp, deserialized);
90+
assert_eq!(expected, deserialized);
9191
}
9292
}

src/jsonrpc/client/admin.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ pub async fn alias_chain(
2222
}
2323
})?;
2424

25-
let u = if let Some(scheme) = scheme {
26-
if let Some(port) = port {
27-
format!("{scheme}://{host}:{port}/ext/admin")
28-
} else {
29-
format!("{scheme}://{host}/ext/admin")
30-
}
31-
} else {
32-
format!("http://{host}/ext/admin")
25+
let url = match (scheme, port) {
26+
(Some(scheme), Some(port)) => format!("{scheme}://{host}:{port}/ext/admin"),
27+
(Some(scheme), _) => format!("{scheme}://{host}/ext/admin"),
28+
_ => format!("http://{host}/ext/admin"),
3329
};
34-
log::info!("getting network name for {u}");
30+
log::info!("getting network name for {url}");
3531

3632
let data = ChainAliasRequest {
3733
params: Some(ChainAliasParams { chain, alias }),
@@ -58,7 +54,7 @@ pub async fn alias_chain(
5854
})?;
5955

6056
let resp = req_cli_builder
61-
.post(&u)
57+
.post(&url)
6258
.header(CONTENT_TYPE, "application/json")
6359
.body(d)
6460
.send()
@@ -77,9 +73,8 @@ pub async fn alias_chain(
7773
retryable: false,
7874
}
7975
})?;
80-
let out: Vec<u8> = out.into();
8176

82-
let response: ChainAliasResponse = serde_json::from_slice(&out)
77+
let response: ChainAliasResponse = serde_json::from_slice(out.as_ref())
8378
.map_err(|e| Error::Other {
8479
message: format!("failed serde_json::from_slice '{}'", e),
8580
retryable: false,

src/message/accepted.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl Message {
2222
chain_id: prost::bytes::Bytes::new(),
2323
request_id: 0,
2424
container_ids: Vec::new(),
25-
engine_type: p2p::EngineType::Unspecified.into(),
2625
},
2726
gzip_compress: false,
2827
}

src/message/accepted_frontier.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl Message {
2222
chain_id: prost::bytes::Bytes::new(),
2323
request_id: 0,
2424
container_ids: Vec::new(),
25-
engine_type: p2p::EngineType::Unspecified.into(),
2625
},
2726
gzip_compress: false,
2827
}

src/message/ancestors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl Message {
2222
chain_id: prost::bytes::Bytes::new(),
2323
request_id: 0,
2424
containers: Vec::new(),
25-
engine_type: p2p::EngineType::Unspecified.into(),
2625
},
2726
gzip_compress: false,
2827
}

src/message/chits.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ impl Message {
2323
request_id: 0,
2424
preferred_container_ids: Vec::new(),
2525
accepted_container_ids: Vec::new(),
26-
engine_type: p2p::EngineType::Unspecified.into(),
2726
},
2827
gzip_compress: false,
2928
}

0 commit comments

Comments
 (0)