-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing transfers to non-whitelisted smart contract #676
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @miladz68, and @wojtek-coreum)
integration-tests/modules/assetft_test.go
line 2387 at r1 (raw file):
// TestAssetFTSendingToNonWhitelistedSmartContractIsDenied verifies that this is not possible to send token to smart contract // if it is not whitelisted. func TestAssetFTSendingToNonWhitelistedSmartContractIsDenied(t *testing.T) {
nit: I would squash these 3 into a single test since they test similar functionality and this will reduce amount of code significantly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68 and @wojtek-coreum)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @wojtek-coreum)
integration-tests/modules/assetft_test.go
line 2453 at r1 (raw file):
} _, err = client.BroadcastTx(ctx, clientCtx.WithFromAddress(issuer), txf, sendMsg) requireT.Error(err)
assert error type.
integration-tests/modules/assetft_test.go
line 2520 at r1 (raw file):
requireT.NoError(err) _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, issuer, contractAddr, incrementPayload, sdk.NewInt64Coin(denom, 100)) requireT.Error(err)
assert error type
integration-tests/modules/assetft_test.go
line 2583 at r1 (raw file):
}, ) requireT.Error(err)
assert error type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @miladz68, and @ysv)
integration-tests/modules/assetft_test.go
line 2453 at r1 (raw file):
Previously, miladz68 (milad) wrote…
assert error type.
Done.
integration-tests/modules/assetft_test.go
line 2520 at r1 (raw file):
Previously, miladz68 (milad) wrote…
assert error type
Done.
integration-tests/modules/assetft_test.go
line 2583 at r1 (raw file):
Previously, miladz68 (milad) wrote…
assert error type
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @miladz68 and @ysv)
integration-tests/modules/assetft_test.go
line 2453 at r1 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
Done.
You should be able to assert ErrWhitelistedLimitExceeded
type not string (same in other places).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68)
integration-tests/modules/assetft_test.go
line 2453 at r1 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
You should be able to assert
ErrWhitelistedLimitExceeded
type not string (same in other places).
no, because errors are returned from simulation, and those errors are not typed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dzmitryhil)
integration-tests/modules/assetft_test.go
line 2453 at r1 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
no, because errors are returned from simulation, and those errors are not typed
but it is not a simultaion !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68)
integration-tests/modules/assetft_test.go
line 2453 at r1 (raw file):
Previously, miladz68 (milad) wrote…
but it is not a simultaion !
yea, I rewrote a test a bit to turn off simulation for this transaction and now error type is asserted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @wojtek-coreum)
Description
Funds might be transferred to smart contract in 3 ways:
In this PR, tests are added to verify that in all 3 cases transfer fails if smart contract is not whitelisted.
Reviewers checklist:
Authors checklist
This change is