Skip to content

Commit

Permalink
Correct usage of DEFAULT_PREFIX in test runner
Browse files Browse the repository at this point in the history
Still trying to chase down all the various prefix issues and get the
full test suite running downstream.
  • Loading branch information
jkilpatr committed May 19, 2021
1 parent 65db373 commit e714ad3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion orchestrator/test_runner/src/happy_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub async fn happy_path_test(
let secret: [u8; 32] = rng.gen();
let dest_cosmos_private_key = CosmosPrivateKey::from_secret(&secret);
let dest_cosmos_address = dest_cosmos_private_key
.to_address(CosmosAddress::DEFAULT_PREFIX)
.to_address(ADDRESS_PREFIX.as_str())
.unwrap();
let dest_eth_private_key = EthPrivateKey::from_slice(&secret).unwrap();
let dest_eth_address = dest_eth_private_key.to_public_key().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/test_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub async fn main() {
let contact = Contact::new(
COSMOS_NODE_GRPC.as_str(),
TOTAL_TIMEOUT,
CosmosAddress::DEFAULT_PREFIX,
ADDRESS_PREFIX.as_str(),
)
.unwrap();
transaction_stress_test(&web30, &contact, keys, gravity_address, erc20_addresses).await;
Expand Down
15 changes: 7 additions & 8 deletions orchestrator/test_runner/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::get_test_token_name;
use crate::ADDRESS_PREFIX;
use crate::COSMOS_NODE_GRPC;
use crate::ETH_NODE;
use crate::TOTAL_TIMEOUT;
Expand Down Expand Up @@ -188,9 +189,7 @@ pub fn get_user_key() -> BridgeUserKey {
let eth_address = eth_key.to_public_key().unwrap();
// the destination on cosmos that sends along to the final ethereum destination
let cosmos_key = CosmosPrivateKey::from_secret(&secret);
let cosmos_address = cosmos_key
.to_address(CosmosAddress::DEFAULT_PREFIX)
.unwrap();
let cosmos_address = cosmos_key.to_address(ADDRESS_PREFIX.as_str()).unwrap();
let mut rng = rand::thread_rng();
let secret: [u8; 32] = rng.gen();
// the final destination of the tokens back on Ethereum
Expand Down Expand Up @@ -248,10 +247,10 @@ pub async fn start_orchestrators(
info!(
"Spawning Orchestrator with delegate keys {} {} and validator key {}",
k.eth_key.to_public_key().unwrap(),
k.orch_key
.to_address(CosmosAddress::DEFAULT_PREFIX)
.unwrap(),
k.validator_key.to_address("cosmosvaloper").unwrap()
k.orch_key.to_address(ADDRESS_PREFIX.as_str()).unwrap(),
k.validator_key
.to_address(&format!("{}valoper", ADDRESS_PREFIX.as_str()))
.unwrap()
);
let grpc_client = GravityQueryClient::connect(COSMOS_NODE_GRPC.as_str())
.await
Expand All @@ -263,7 +262,7 @@ pub async fn start_orchestrators(
let contact = Contact::new(
COSMOS_NODE_GRPC.as_str(),
OPERATION_TIMEOUT,
CosmosAddress::DEFAULT_PREFIX,
ADDRESS_PREFIX.as_str(),
)
.unwrap();
let fut = orchestrator_main_loop(
Expand Down

0 comments on commit e714ad3

Please sign in to comment.