Skip to content

Commit

Permalink
fix for gaia v15
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 authored and brentstone committed Apr 27, 2024
1 parent 4e7e85e commit 1480b49
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
17 changes: 17 additions & 0 deletions crates/tests/src/e2e/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,23 @@ pub fn update_gaia_config(test: &Test) -> Result<()> {
file.write_all(values.to_string().as_bytes()).map_err(|e| {
eyre!(format!("Writing a Gaia config file failed: {}", e))
})?;

let app_path = test.test_dir.as_ref().join("gaia/config/app.toml");
let s = std::fs::read_to_string(&app_path)
.expect("Reading Gaia app.toml failed");
let mut values = s
.parse::<toml::Value>()
.expect("Parsing Gaia app.toml failed");
if let Some(mininum_gas_prices) = values.get_mut("minimum-gas-prices") {
*mininum_gas_prices = "0.0001stake".into();
}
let mut file = OpenOptions::new()
.write(true)
.truncate(true)
.open(&app_path)?;
file.write_all(values.to_string().as_bytes())
.map_err(|e| eyre!(format!("Writing a Gaia app.toml failed: {}", e)))?;

Ok(())
}

Expand Down
2 changes: 2 additions & 0 deletions crates/tests/src/e2e/ibc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2174,6 +2174,8 @@ fn transfer_from_gaia(
&amount,
"--from",
sender.as_ref(),
"--gas-prices",
"0.001stake",
"--node",
&rpc,
"--keyring-backend",
Expand Down
14 changes: 10 additions & 4 deletions crates/tests/src/e2e/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,25 +1286,31 @@ pub fn setup_gaia() -> Result<Test> {

// Add tokens to a user account
let account = find_gaia_address(&test, constants::GAIA_USER)?;
let args = ["add-genesis-account", &account, "1000stake,1000samoleans"];
let args = [
"genesis",
"add-genesis-account",
&account,
"10000stake,1000samoleans",
];
let mut gaia = run_gaia_cmd(&test, args, Some(10))?;
gaia.assert_success();

// Add the stake token to the relayer
let account = find_gaia_address(&test, constants::GAIA_RELAYER)?;
let args = ["add-genesis-account", &account, "10000stake"];
let args = ["genesis", "add-genesis-account", &account, "10000stake"];
let mut gaia = run_gaia_cmd(&test, args, Some(10))?;
gaia.assert_success();

// Add the stake token to the validator
let validator = find_gaia_address(&test, constants::GAIA_VALIDATOR)?;
let stake = "100000000000stake";
let args = ["add-genesis-account", &validator, stake];
let args = ["genesis", "add-genesis-account", &validator, stake];
let mut gaia = run_gaia_cmd(&test, args, Some(10))?;
gaia.assert_success();

// stake
let args = [
"genesis",
"gentx",
constants::GAIA_VALIDATOR,
stake,
Expand All @@ -1316,7 +1322,7 @@ pub fn setup_gaia() -> Result<Test> {
let mut gaia = run_gaia_cmd(&test, args, Some(10))?;
gaia.assert_success();

let args = ["collect-gentxs"];
let args = ["genesis", "collect-gentxs"];
let mut gaia = run_gaia_cmd(&test, args, Some(10))?;
gaia.assert_success();

Expand Down

0 comments on commit 1480b49

Please sign in to comment.