-
Notifications
You must be signed in to change notification settings - Fork 31
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
test(x/wasm): add integration tests for dynamic call #590
test(x/wasm): add integration tests for dynamic call #590
Conversation
Codecov Report
@@ Coverage Diff @@
## dynamic_link #590 +/- ##
===============================================
Coverage ? 53.16%
===============================================
Files ? 642
Lines ? 67269
Branches ? 0
===============================================
Hits ? 35764
Misses ? 28562
Partials ? 2943 |
x/wasm/dynamic_link_test.go
Outdated
assert.Equal(t, len(res.Events), 3) | ||
assert.Equal(t, "wasm", res.Events[0].Type) | ||
assert.Equal(t, len(res.Events[0].Attributes), 6) | ||
assertAttribute(t, "contract_address", "link10pyejy66429refv3g35g2t7am0was7yaducgya", res.Events[0].Attributes[0]) |
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.
Where does this address, link10pyejy66429refv3g35g2t7am0was7yaducgya
, come from? And is this address always the same?
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.
And this address seems to be repeating. If so, how about changing to a const property?
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.
The contract address is always the same because the code id and the instance id are the same.
But, it is out of this test, so I will delete this assertion.
x/wasm/dynamic_link_test.go
Outdated
assertAttribute(t, "returned_pong_with_struct", "hello world 101", res.Events[0].Attributes[2]) | ||
assertAttribute(t, "returned_pong_with_tuple", "(hello world, 42)", res.Events[0].Attributes[3]) | ||
assertAttribute(t, "returned_pong_with_tuple_takes_2_args", "(hello world, 42)", res.Events[0].Attributes[4]) | ||
assertAttribute(t, "returned_contract_address", "link18vd8fpwxzck93qlwghaj6arh4p7c5n89fvcmzu", res.Events[0].Attributes[5]) |
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.
ditto
* More keeper tests x/wasm/keeper tests are extended to test various input validation. Keeper input is validated before passing to the keeper method when used within wasmd application. We cannot ensure such validation when this keeper is used outside of wasmd application. To keep it safe, fully validate keeper methods input. hackatom.wasm is loaded into memory during initialization to avoid reading file in each test separately. Once migrated to go 1.16, embed package should be used instead. Run goimport on certain files. Some comments fixed or removed. * ensure that creator address is not nil
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.
LGTM
Description
This PR adds integration tests for
Other than them, this PR includes
ErrorContains
Motivation and context
Finschia/cosmwasm#186 and Finschia/cosmwasm#191
How has this been tested?
These are integration tests themselves.
Checklist:
CHANGELOG.md
client/docs/swagger-ui/swagger.yaml
(not needed)