Skip to content

Commit

Permalink
Update error handling and some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitryhil committed Oct 25, 2023
1 parent 69ef936 commit b36764b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion integration-tests/modules/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func TestValidatorUpdateWithLowMinSelfDelegation(t *testing.T) {
assert.EqualValues(t, editValidatorMsg.Description.Details, valResp.GetValidator().Description.Details)
}

// TestUnbondAndCancelUnbondingDelegation checks that it is possible to unbond and cancel unbondion delegation.
// TestUnbondAndCancelUnbondingDelegation checks that it is possible to unbond and cancel unbonding delegation.
func TestUnbondAndCancelUnbondingDelegation(t *testing.T) {
ctx, chain := integrationtests.NewCoreumTestingContext(t)

Expand Down
22 changes: 11 additions & 11 deletions integration-tests/modules/vesting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
customparamstypes "github.com/CoreumFoundation/coreum/v3/x/customparams/types"
)

// TestContinuousAndDelayedVestingAccountCreationAndBankSend tests continuous and delayed vesting account can be created, and it's send limits are applied.
// TestContinuousAndDelayedVestingAccountCreationAndBankSend tests continuous and delayed vesting account can be created, and its send limit are applied.
func TestContinuousAndDelayedVestingAccountCreationAndBankSend(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -95,7 +95,7 @@ func TestContinuousAndDelayedVestingAccountCreationAndBankSend(t *testing.T) {
chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSend)),
msgSend,
)
requireT.True(cosmoserrors.ErrInsufficientFunds.Is(err))
requireT.ErrorIs(err, cosmoserrors.ErrInsufficientFunds)

// await vesting time to unlock the vesting coins
select {
Expand All @@ -119,7 +119,7 @@ func TestContinuousAndDelayedVestingAccountCreationAndBankSend(t *testing.T) {
requireT.NoError(err)
}

// TestPeriodicVestingAccountCreationAndBankSend tests periodic vesting account can be created, and it's send limits are applied.
// TestPeriodicVestingAccountCreationAndBankSend tests periodic vesting account can be created, and its send limit are applied.
func TestPeriodicVestingAccountCreationAndBankSend(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -147,7 +147,7 @@ func TestPeriodicVestingAccountCreationAndBankSend(t *testing.T) {
StartTime: time.Now().Unix() - 1,
VestingPeriods: vestingtypes.Periods{
{
Length: 1, // activate is immediately
Length: 1, // activate it immediately
Amount: sdk.NewCoins(vestingCoinPeriod1),
},
{
Expand Down Expand Up @@ -200,7 +200,7 @@ func TestPeriodicVestingAccountCreationAndBankSend(t *testing.T) {
chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSend)),
msgSend,
)
requireT.True(cosmoserrors.ErrInsufficientFunds.Is(err))
requireT.ErrorIs(err, cosmoserrors.ErrInsufficientFunds)

// fund the vesting account to pay fees one more time
chain.FundAccountWithOptions(ctx, t, vestingAcc, integration.BalancesOptions{
Expand All @@ -222,8 +222,8 @@ func TestPeriodicVestingAccountCreationAndBankSend(t *testing.T) {
requireT.NoError(err)
}

// TestPermanentLockedAccountAccountCreationAndBankSend tests permanent locked account can be created, and it's send limits are applied.
func TestPermanentLockedAccountAccountCreationAndBankSend(t *testing.T) {
// TestPermanentLockedAccountCreationAndBankSend tests permanent locked account can be created, and its send limit are applied.
func TestPermanentLockedAccountCreationAndBankSend(t *testing.T) {
t.Parallel()

ctx, chain := integrationtests.NewCoreumTestingContext(t)
Expand Down Expand Up @@ -291,7 +291,7 @@ func TestPermanentLockedAccountAccountCreationAndBankSend(t *testing.T) {
chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSend)),
msgSend,
)
requireT.True(cosmoserrors.ErrInsufficientFunds.Is(err))
requireT.ErrorIs(err, cosmoserrors.ErrInsufficientFunds)
}

// TestVestingAccountStaking tests the vesting account can delegate coins.
Expand Down Expand Up @@ -508,7 +508,7 @@ func TestVestingAccountWithFTInteraction(t *testing.T) {
chain.TxFactory().WithGas(chain.GasLimitByMsgs(burnMsg)),
burnMsg,
)
requireT.True(cosmoserrors.ErrInsufficientFunds.Is(err))
requireT.ErrorIs(err, cosmoserrors.ErrInsufficientFunds)

// try to send vesting locker coins
msgSend := &banktypes.MsgSend{
Expand All @@ -522,7 +522,7 @@ func TestVestingAccountWithFTInteraction(t *testing.T) {
chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSend)),
msgSend,
)
requireT.True(cosmoserrors.ErrInsufficientFunds.Is(err))
requireT.ErrorIs(err, cosmoserrors.ErrInsufficientFunds)

// freeze coins, it should work even for the vested coins
freezeMsg := &assetfttypes.MsgFreeze{
Expand Down Expand Up @@ -575,7 +575,7 @@ func TestVestingAccountWithFTInteraction(t *testing.T) {
chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSend)),
msgSend,
)
requireT.True(cosmoserrors.ErrInsufficientFunds.Is(err))
requireT.ErrorIs(err, cosmoserrors.ErrInsufficientFunds)

// unfreeze coins, to let prev vesting account tx pass
unfreezeMsg := &assetfttypes.MsgUnfreeze{
Expand Down

0 comments on commit b36764b

Please sign in to comment.