Skip to content

Commit

Permalink
Update vesting integration test (#110)
Browse files Browse the repository at this point in the history
* Update integration test with validating balances

* Optimize integration test

* Add delegating portion of initial vesting coins

* Track undelegation

* Update integration test for undelegation
  • Loading branch information
deep-quality-dev authored Jul 8, 2024
1 parent e2a919e commit 15a333f
Show file tree
Hide file tree
Showing 3 changed files with 655 additions and 67 deletions.
19 changes: 19 additions & 0 deletions testutil/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ func Delegate(
return DeliverTx(ctx, app, priv, nil, delegateMsg)
}

// Undelegate delivers a delegate tx
func Undelegate(
ctx sdk.Context,
app *app.App,
priv cryptotypes.PrivKey,
undelegateAmount sdk.Coin,
validator stakingtypes.Validator,
) (abci.ResponseDeliverTx, error) {
accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes())

val, err := sdk.ValAddressFromBech32(validator.OperatorAddress)
if err != nil {
return abci.ResponseDeliverTx{}, err
}

undelegateMsg := stakingtypes.NewMsgUndelegate(accountAddress, val, undelegateAmount)
return DeliverTx(ctx, app, priv, nil, undelegateMsg)
}

// Vote delivers a vote tx with the VoteOption "yes" or "no"
func Vote(
ctx sdk.Context,
Expand Down
Loading

0 comments on commit 15a333f

Please sign in to comment.