Skip to content

Commit

Permalink
Adapt external-staking tests to new Tx format
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Jun 21, 2023
1 parent 7d8b268 commit 8fd2445
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions contracts/provider/external-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ anyhow = { workspace = true }
mesh-vault = { workspace = true, features = ["mt"] }
mesh-native-staking-proxy = { workspace = true, features = ["mt"] }
mesh-native-staking = { workspace = true, features = ["mt"] }
mesh-sync = { workspace = true }

[[bin]]
name = "schema"
Expand Down
10 changes: 7 additions & 3 deletions contracts/provider/external-staking/src/multitest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use anyhow::Result as AnyResult;

use cosmwasm_std::{coin, coins, to_binary, Addr, Decimal};
use mesh_native_staking::contract::multitest_utils::CodeId as NativeStakingCodeId;
use mesh_native_staking::contract::InstantiateMsg as NativeStakingInstantiateMsg;
Expand All @@ -6,6 +8,8 @@ use mesh_vault::contract::multitest_utils::{CodeId as VaultCodeId, VaultContract
use mesh_vault::contract::test_utils::VaultApi;
use mesh_vault::msg::StakingInitInfo;

use mesh_sync::Tx;

use cw_multi_test::App as MtApp;
use sylvia::multitest::App;

Expand All @@ -14,8 +18,6 @@ use crate::contract::multitest_utils::{CodeId, ExternalStakingContractProxy};
use crate::error::ContractError;
use crate::msg::{ReceiveVirtualStake, StakeInfo};

use anyhow::Result as AnyResult;

const OSMO: &str = "osmo";
const STAR: &str = "star";

Expand Down Expand Up @@ -285,7 +287,9 @@ fn staking() {
#[track_caller]
fn get_last_pending_tx_id(vault: &VaultContractProxy) -> Option<u64> {
let txs = vault.all_pending_txs(None, None).unwrap().txs;
txs.first().map(|tx| tx.id)
txs.first().map(|tx| match tx {
Tx::InFlightStaking { id, .. } => *id,
})
}

#[test]
Expand Down

0 comments on commit 8fd2445

Please sign in to comment.