Skip to content
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

fix: use ctx cache in msg server integration test #77

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

### Bug Fixes
* [\#35](https://github.com/Finschia/wasmd/pull/35) stop wrap twice the response of handling non-plus wasm message in plus handler
* [\#77](https://github.com/Finschia/wasmd/pull/77) use ctx cache in msg server integration test

### Document Updates
* [\#44](https://github.com/Finschia/wasmd/pull/44) update notice
Expand Down
5 changes: 3 additions & 2 deletions x/wasm/keeper/msg_server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func TestInstantiateContract(t *testing.T) {
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
xCtx, _ := ctx.CacheContext()
// setup
_, _, sender := testdata.KeyTestPubAddr()
msg := types.MsgStoreCodeFixture(func(m *types.MsgStoreCode) {
Expand All @@ -98,7 +99,7 @@ func TestInstantiateContract(t *testing.T) {
})

// store code
rsp, err := wasmApp.MsgServiceRouter().Handler(msg)(ctx, msg)
rsp, err := wasmApp.MsgServiceRouter().Handler(msg)(xCtx, msg)
require.NoError(t, err)
var result types.MsgStoreCodeResponse
require.NoError(t, wasmApp.AppCodec().Unmarshal(rsp.Data, &result))
Expand All @@ -112,7 +113,7 @@ func TestInstantiateContract(t *testing.T) {
Msg: []byte(`{}`),
Funds: sdk.Coins{},
}
rsp, err = wasmApp.MsgServiceRouter().Handler(msgInstantiate)(ctx, msgInstantiate)
rsp, err = wasmApp.MsgServiceRouter().Handler(msgInstantiate)(xCtx, msgInstantiate)

//then
if spec.expErr {
Expand Down