Skip to content

Commit

Permalink
verify typed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojtek committed Oct 20, 2023
1 parent 112167b commit fe80b61
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions integration-tests/modules/assetft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2397,8 +2397,6 @@ func TestAssetFTSendingToNonWhitelistedSmartContractIsDenied(t *testing.T) {
)

clientCtx := chain.ClientContext
txf := chain.TxFactory().
WithSimulateAndExecute(true)

// Issue a fungible token which cannot be sent to the smart contract
issueMsg := &assetfttypes.MsgIssue{
Expand Down Expand Up @@ -2432,7 +2430,7 @@ func TestAssetFTSendingToNonWhitelistedSmartContractIsDenied(t *testing.T) {

contractAddr, _, err := chain.Wasm.DeployAndInstantiateWASMContract(
ctx,
txf,
chain.TxFactory().WithSimulateAndExecute(true),
issuer,
moduleswasm.SimpleStateWASM,
integration.InstantiateConfig{
Expand All @@ -2449,8 +2447,13 @@ func TestAssetFTSendingToNonWhitelistedSmartContractIsDenied(t *testing.T) {
ToAddress: contractAddr,
Amount: sdk.NewCoins(sdk.NewInt64Coin(denom, 100)),
}
_, err = client.BroadcastTx(ctx, clientCtx.WithFromAddress(issuer), txf, sendMsg)
requireT.ErrorContains(err, "whitelisted limit exceeded")
_, err = client.BroadcastTx(
ctx,
clientCtx.WithFromAddress(issuer),
chain.TxFactory().WithGas(chain.GasLimitByMsgs(sendMsg)),
sendMsg,
)
requireT.ErrorIs(err, assetfttypes.ErrWhitelistedLimitExceeded)
}

// TestAssetFTAttachingToNonWhitelistedSmartContractCallIsDenied verifies that this is not possible to attach token to smart contract call
Expand Down

0 comments on commit fe80b61

Please sign in to comment.