-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tools] fix network address registration for validators (#74)
Co-authored-by: 0o-de-lally <[email protected]>
- Loading branch information
1 parent
038e42e
commit 9a9b65a
Showing
18 changed files
with
219 additions
and
65 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::path::Path; | ||
|
||
use diem_genesis::config::OperatorConfiguration; | ||
use diem_types::network_address::NetworkAddress; | ||
|
||
#[test] | ||
fn encode_net_addr() -> anyhow::Result<()> { | ||
let file = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/operator.yaml"); | ||
|
||
let yaml_str = std::fs::read_to_string(file)?; | ||
|
||
let oc: OperatorConfiguration = serde_yaml::from_str(&yaml_str)?; | ||
|
||
let val_net_protocol = oc | ||
.validator_host | ||
.as_network_address(oc.validator_network_public_key)?; | ||
let enc = bcs::to_bytes(&val_net_protocol)?; | ||
|
||
// dbg!(&hex::encode(&enc)); | ||
let dec: NetworkAddress = bcs::from_bytes(&enc)?; | ||
assert!(dec == val_net_protocol); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
operator_account_address: 40534327a3cfe4e93faf210b9b70e5958236a2ca6fb70eaa9d9ef351fdc2cf75 | ||
operator_account_public_key: "0x8f73437282e51577421450e528cc91a36e3257199bb5bd4cd16c670355789cee" | ||
consensus_public_key: "0xb0d9d43e8f0e0d8939f11529d91a3acf39b5bbfd09e102491696f804c69bd786f7865939b326b94c3131b6666acc70eb" | ||
consensus_proof_of_possession: "0x8c788101bc1ef2f7ed7d5b663dc3031d5484f17792402ca9de033e727b037dca4bdba1c16f789e160ea23ab791c5ba3a0e8a1808279e9deca0976dd01011377661a494760cc5b560fba510d1e2e620d5de0d82305ce20d2d0ac59469d8b73f47" | ||
validator_network_public_key: "0x64d495a02294e7a7a4f3e6c3be8c9a9f813dfd1e86a2127a2a43ddc9313bc263" | ||
validator_host: | ||
host: 134.209.32.159 | ||
port: 6180 | ||
full_node_network_public_key: "0x737f357ddc2d6fa10a4020846898083bc18a3cb5ea80ba08db8bb0095509c973" | ||
full_node_host: | ||
host: 134.209.32.159 | ||
port: 6182 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ pub mod load_keys; | |
pub mod utils; | ||
pub mod validator_files; | ||
pub mod wallet_cli; | ||
pub mod whoami; |
Oops, something went wrong.