Skip to content

Commit

Permalink
Use addrs consistent with other chain configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dowlandaiello committed Jul 1, 2024
1 parent 840d5f1 commit 6df58fc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 40 deletions.
12 changes: 6 additions & 6 deletions examples/chains/neutron_gaia.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"accounts": [
{
"name": "acc0",
"address": "cosmos1kuf2kxwuv2p8k3gnpja7mzf05zvep0cycmheu0",
"address": "cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr",
"amount": "20000000000%DENOM%",
"mnemonic": "south excuse merit payment amazing trash salon core cloth wine claw father fiscal anger entry hawk equip cream key inner away outdoor despair air"
"mnemonic": "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
}
]
}
Expand Down Expand Up @@ -145,9 +145,9 @@
"accounts": [
{
"name": "acc0",
"address": "neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"address": "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky",
"amount": "100000000000000000%DENOM%",
"mnemonic": "south excuse merit payment amazing trash salon core cloth wine claw father fiscal anger entry hawk equip cream key inner away outdoor despair air"
"mnemonic": "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
}
]
}
Expand Down Expand Up @@ -195,9 +195,9 @@
"accounts": [
{
"name": "acc0",
"address": "osmo1kuf2kxwuv2p8k3gnpja7mzf05zvep0cysqyf2a",
"address": "osmo1hj5fveer5cjtn4wd6wstzugjfdxzl0xpwhpz63",
"amount": "10000000000%DENOM%",
"mnemonic": "south excuse merit payment amazing trash salon core cloth wine claw father fiscal anger entry hawk equip cream key inner away outdoor despair air"
"mnemonic": "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
}
]
}
Expand Down
38 changes: 11 additions & 27 deletions examples/neutron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use cosmwasm_std::Decimal;
use localic_utils::{types::contract::MinAmount, ConfigChainBuilder, TestContextBuilder};
use std::error::Error;

const ACC_0_ADDR: &str = "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky";

/// Demonstrates using localic-utils for neutron.
fn main() -> Result<(), Box<dyn Error>> {
env_logger::init();
Expand All @@ -25,14 +27,8 @@ fn main() -> Result<(), Box<dyn Error>> {
.with_subdenom("amoguscoin")
.send()?;

let bruhtoken = ctx.get_tokenfactory_denom(
"neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"bruhtoken",
);
let amoguscoin = ctx.get_tokenfactory_denom(
"neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"amoguscoin",
);
let bruhtoken = ctx.get_tokenfactory_denom(ACC_0_ADDR, "bruhtoken");
let amoguscoin = ctx.get_tokenfactory_denom(ACC_0_ADDR, "amoguscoin");

// Deploy valence auctions
ctx.build_tx_create_auctions_manager()
Expand All @@ -43,7 +39,7 @@ fn main() -> Result<(), Box<dyn Error>> {
start_auction: "0".into(),
},
)])
.with_server_addr("neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg")
.with_server_addr(ACC_0_ADDR)
.send()?;
ctx.build_tx_create_price_oracle().send()?;
ctx.build_tx_manual_oracle_price_update()
Expand Down Expand Up @@ -73,26 +69,17 @@ fn main() -> Result<(), Box<dyn Error>> {
.with_amount_offer_asset(10000)
.send()?;

ctx.get_auction(("untrn", ctx.get_tokenfactory_denom(ACC_0_ADDR, "bruhtoken")))?;
ctx.get_auction((
"untrn",
ctx.get_tokenfactory_denom(
"neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"bruhtoken",
),
))?;
ctx.get_auction((
"untrn",
ctx.get_tokenfactory_denom(
"neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"amoguscoin",
),
ctx.get_tokenfactory_denom(ACC_0_ADDR, "amoguscoin"),
))?;

ctx.build_tx_create_token_registry()
.with_owner("neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg")
.with_owner(ACC_0_ADDR)
.send()?;
ctx.build_tx_create_factory()
.with_owner("neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg")
.with_owner(ACC_0_ADDR)
.send()?;
ctx.build_tx_create_pool()
.with_denom_a("untrn")
Expand All @@ -105,10 +92,7 @@ fn main() -> Result<(), Box<dyn Error>> {

let pool = ctx.get_astroport_pool(
"untrn",
ctx.get_tokenfactory_denom(
"neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"amoguscoin",
),
ctx.get_tokenfactory_denom(ACC_0_ADDR, "amoguscoin"),
)?;

assert!(pool
Expand Down Expand Up @@ -137,7 +121,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.with_amount_denom_a(10000)
.with_amount_denom_b(10000)
.with_slippage_tolerance(Decimal::percent(50))
.with_liq_token_receiver("neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg")
.with_liq_token_receiver(ACC_0_ADDR)
.send()?;

Ok(())
Expand Down
12 changes: 6 additions & 6 deletions examples/neutron_osmosis.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use localic_utils::{error::Error as LocalIcUtilsError, ConfigChainBuilder, TestContextBuilder};
use std::error::Error;

const ACC_0_ADDR: &str = "osmo1hj5fveer5cjtn4wd6wstzugjfdxzl0xpwhpz63";
const NEUTRON_ACC_0_ADDR: &str = "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky";

/// Demonstrates using localic-utils for neutron + osmosis.
fn main() -> Result<(), Box<dyn Error>> {
env_logger::init();
Expand All @@ -20,10 +23,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.with_chain_name("neutron")
.with_subdenom("bruhtoken")
.send()?;
let bruhtoken = ctx.get_tokenfactory_denom(
"neutron1kuf2kxwuv2p8k3gnpja7mzf05zvep0cyuy7mxg",
"bruhtoken",
);
let bruhtoken = ctx.get_tokenfactory_denom(NEUTRON_ACC_0_ADDR, "bruhtoken");
ctx.build_tx_mint_tokenfactory_token()
.with_chain_name("neutron")
.with_amount(10000000000000000000)
Expand All @@ -33,13 +33,13 @@ fn main() -> Result<(), Box<dyn Error>> {
// Transfer from osmosis to neutron and neutron to osmosis
ctx.build_tx_transfer()
.with_chain_name("neutron")
.with_recipient("osmo1kuf2kxwuv2p8k3gnpja7mzf05zvep0cysqyf2a")
.with_recipient(ACC_0_ADDR)
.with_denom("untrn")
.with_amount(1000000)
.send()?;
ctx.build_tx_transfer()
.with_chain_name("neutron")
.with_recipient("osmo1kuf2kxwuv2p8k3gnpja7mzf05zvep0cysqyf2a")
.with_recipient(ACC_0_ADDR)
.with_denom(&bruhtoken)
.with_amount(1000000)
.send()?;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub const NEUTRON_CHAIN_ADMIN_ADDR: &str = "neutron1hj5fveer5cjtn4wd6wstzugjfdxz
pub const OSMOSIS_CHAIN_ID: &str = "localosmosis-1";
pub const OSMOSIS_CHAIN_DENOM: &str = "uosmo";
pub const OSMOSIS_CHAIN_PREFIX: &str = "osmo";
pub const OSMOSIS_CHAIN_ADMIN_ADDR: &str = "osmo1kuf2kxwuv2p8k3gnpja7mzf05zvep0cysqyf2a";
pub const OSMOSIS_CHAIN_ADMIN_ADDR: &str = "osmo1hj5fveer5cjtn4wd6wstzugjfdxzl0xpwhpz63";
pub const OSMOSIS_CHAIN_NAME: &str = "osmosis";
pub const OSMOSIS_POOLFILE_PATH: &str = "/tmp/pool_file.json";

Expand Down

0 comments on commit 6df58fc

Please sign in to comment.