Skip to content

Commit

Permalink
Adapt contracts to new sylvuia version
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Jul 26, 2023
1 parent 77b9cdc commit 5615dbe
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions contracts/provider/native-staking-proxy/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ impl NativeStakingProxyContract<'_> {
set_contract_version(ctx.deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;

// Stake info.funds on validator
let res = self.stake(ctx, validator)?;
let exec_ctx = ExecCtx {
deps: ctx.deps,
env: ctx.env,
info: ctx.info,
};
let res = self.stake(exec_ctx, validator)?;

// Set owner as recipient of future withdrawals
let set_withdrawal = DistributionMsg::SetWithdrawAddress {
Expand Down Expand Up @@ -258,7 +263,12 @@ mod tests {
VALIDATOR.to_owned(),
)
.unwrap();
(ctx, contract)
let exec_ctx = ExecCtx {
deps: ctx.deps,
info: mock_info(OWNER, &[]),
env: ctx.env,
};
(exec_ctx, contract)
}

// Extra checks of instantiate returned messages and data
Expand Down Expand Up @@ -311,7 +321,6 @@ mod tests {
let (mut ctx, contract) = do_instantiate(deps.as_mut());

// The owner can vote
ctx.info = mock_info(OWNER, &[]);
let proposal_id = 1;
let vote = Yes;
let res = contract
Expand Down Expand Up @@ -352,7 +361,6 @@ mod tests {
let (mut ctx, contract) = do_instantiate(deps.as_mut());

// The owner can weighted vote
ctx.info = mock_info(OWNER, &[]);
let proposal_id = 2;
let vote = vec![WeightedVoteOption {
option: Yes,
Expand Down

0 comments on commit 5615dbe

Please sign in to comment.