Skip to content

Commit

Permalink
Accept staking token as an env arg in tests
Browse files Browse the repository at this point in the history
This is required for the validator set update tests to run properly on
downstream chains.
  • Loading branch information
jkilpatr committed May 19, 2021
1 parent bb18ef3 commit 093af6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion orchestrator/test_runner/src/happy_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::ADDRESS_PREFIX;
use crate::CHAIN_BINARY;
use crate::MINER_ADDRESS;
use crate::MINER_PRIVATE_KEY;
use crate::STAKING_TOKEN;
use crate::STARTING_STAKE_PER_VALIDATOR;
use crate::TOTAL_TIMEOUT;
use clarity::PrivateKey as EthPrivateKey;
Expand Down Expand Up @@ -202,7 +203,11 @@ pub async fn test_valset_update(web30: &Web3, keys: &[ValidatorKeys], gravity_ad
.to_address(&format!("{}valoper", *ADDRESS_PREFIX))
.unwrap()
.to_string();
let amount = &format!("{}stake", STARTING_STAKE_PER_VALIDATOR / 4);
let amount = &format!(
"{}{}",
STARTING_STAKE_PER_VALIDATOR / 4,
STAKING_TOKEN.as_str()
);
info!(
"Delegating {} to {} in order to generate a validator set update",
amount, delegate_address
Expand Down
2 changes: 2 additions & 0 deletions orchestrator/test_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ lazy_static! {
env::var("CHAIN_BINARY").unwrap_or_else(|_| "gravity".to_owned());
static ref ADDRESS_PREFIX: String =
env::var("ADDRESS_PREFIX").unwrap_or_else(|_| CosmosAddress::DEFAULT_PREFIX.to_owned());
static ref STAKING_TOKEN: String =
env::var("STAKING_TOKEN").unwrap_or_else(|_| "stake".to_owned());
static ref COSMOS_NODE_GRPC: String =
env::var("COSMOS_NODE_GRPC").unwrap_or_else(|_| "http://localhost:9090".to_owned());
static ref COSMOS_NODE_ABCI: String =
Expand Down

0 comments on commit 093af6b

Please sign in to comment.