Skip to content

Commit

Permalink
Fix: receive virtual stake msg proper
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Jun 16, 2023
1 parent 62e302f commit e2f05c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions contracts/provider/external-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ pub mod cross_staking {
ctx: ExecCtx,
owner: String,
amount: Coin,
_tx_id: u64,
tx_id: u64,
msg: Binary,
) -> Result<Response, Self::Error> {
let config = self.config.load(ctx.deps.storage)?;
Expand Down Expand Up @@ -436,7 +436,7 @@ pub mod cross_staking {
.add_attribute("action", "receive_virtual_stake")
.add_attribute("owner", owner)
.add_attribute("amount", amount.amount.to_string())
.add_attribute("tx_id", msg.tx.to_string());
.add_attribute("tx_id", tx_id.to_string());

Ok(resp)
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/provider/external-staking/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ pub struct StakesResponse {
/// Message to be send as `msg` field on `receive_virtual_staking`
#[cw_serde]
pub struct ReceiveVirtualStake {
/// Associated transaction id
pub tx: u64,
pub validator: String,
}

Expand Down
14 changes: 2 additions & 12 deletions contracts/provider/external-staking/src/multitest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,20 @@ fn staking() {
contract.contract_addr.to_string(),
coin(100, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 1,
validator: validators[0].to_string(),
})
.unwrap(),
)
.call(users[0])
.unwrap();

// Need to process / commit IBC tx here

vault
.stake_remote(
contract.contract_addr.to_string(),
coin(100, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 2,
validator: validators[1].to_string(),
})
.unwrap(),
Expand All @@ -146,7 +146,6 @@ fn staking() {
contract.contract_addr.to_string(),
coin(100, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 3,
validator: validators[0].to_string(),
})
.unwrap(),
Expand All @@ -159,7 +158,6 @@ fn staking() {
contract.contract_addr.to_string(),
coin(200, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 4,
validator: validators[1].to_string(),
})
.unwrap(),
Expand All @@ -172,7 +170,6 @@ fn staking() {
contract.contract_addr.to_string(),
coin(100, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 5,
validator: validators[0].to_string(),
})
.unwrap(),
Expand Down Expand Up @@ -299,7 +296,6 @@ fn unstaking() {
contract.contract_addr.to_string(),
coin(200, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 1,
validator: validators[0].to_string(),
})
.unwrap(),
Expand All @@ -312,7 +308,6 @@ fn unstaking() {
contract.contract_addr.to_string(),
coin(100, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 2,
validator: validators[1].to_string(),
})
.unwrap(),
Expand All @@ -325,7 +320,6 @@ fn unstaking() {
contract.contract_addr.to_string(),
coin(300, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 3,
validator: validators[0].to_string(),
})
.unwrap(),
Expand Down Expand Up @@ -585,7 +579,6 @@ fn distribution() {
contract.contract_addr.to_string(),
coin(200, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 1,
validator: validators[0].to_string(),
})
.unwrap(),
Expand All @@ -598,7 +591,6 @@ fn distribution() {
contract.contract_addr.to_string(),
coin(100, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 2,
validator: validators[1].to_string(),
})
.unwrap(),
Expand All @@ -611,7 +603,6 @@ fn distribution() {
contract.contract_addr.to_string(),
coin(300, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 3,
validator: validators[0].to_string(),
})
.unwrap(),
Expand Down Expand Up @@ -829,7 +820,6 @@ fn distribution() {
contract.contract_addr.to_string(),
coin(300, OSMO),
to_binary(&ReceiveVirtualStake {
tx: 2,
validator: validators[1].to_string(),
})
.unwrap(),
Expand Down

0 comments on commit e2f05c1

Please sign in to comment.