Skip to content

Commit

Permalink
Merge branch 'ava-labs:main' into add_gossipable
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanghren authored Sep 11, 2023
2 parents 1fea689 + b3d0d6d commit 9f1ab3b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions crates/avalanche-types/src/jsonrpc/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ pub struct GetNetworkIdResponse {

#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<GetNetworkIdResult>,

#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<jsonrpc::ResponseError>,
}

/// ref. <https://docs.avax.network/build/avalanchego-apis/info/#infogetnetworkid>
Expand Down Expand Up @@ -104,6 +107,7 @@ fn test_get_network_id() {
result: Some(GetNetworkIdResult {
network_id: 9999999_u32,
}),
error: None,
};
assert_eq!(resp, expected);
}
Expand All @@ -116,6 +120,9 @@ pub struct GetBlockchainIdResponse {

#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<GetBlockchainIdResult>,

#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<jsonrpc::ResponseError>,
}

/// ref. <https://docs.avax.network/build/avalanchego-apis/info/#infogetblockchainid>
Expand Down Expand Up @@ -167,6 +174,7 @@ fn test_get_blockchain_id() {
blockchain_id: ids::Id::from_str("sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM")
.unwrap(),
}),
error: None,
};
assert_eq!(resp, expected);
}
Expand Down Expand Up @@ -422,6 +430,9 @@ pub struct GetVmsResponse {

#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<GetVmsResult>,

#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<jsonrpc::ResponseError>,
}

/// ref. <https://docs.avax.network/build/avalanchego-apis/info/#infogetvms>
Expand Down Expand Up @@ -486,6 +497,9 @@ pub struct GetTxFeeResponse {

#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<GetTxFeeResult>,

#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<jsonrpc::ResponseError>,
}

/// ref. <https://docs.avax.network/build/avalanchego-apis/info/#infogettxfee>
Expand Down Expand Up @@ -577,6 +591,7 @@ fn test_get_tx_fee() {
add_subnet_validator_fee: 1000000,
add_subnet_delegator_fee: 1000000,
}),
error: None,
};
assert_eq!(resp, expected);
}
Expand Down Expand Up @@ -700,6 +715,9 @@ pub struct PeersResponse {

#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<PeersResult>,

#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<jsonrpc::ResponseError>,
}

/// ref. <https://docs.avax.network/apis/avalanchego/apis/info#infopeers>
Expand Down Expand Up @@ -890,6 +908,7 @@ fn test_peers() {
]),
..PeersResult::default()
}),
error: None,
};
assert_eq!(resp, expected);
}

0 comments on commit 9f1ab3b

Please sign in to comment.