Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
shiki-tak committed Jun 17, 2022
1 parent e4ed0e6 commit 0abdd6a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions x/wasm/keeper/proposal_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ func TestInstantiateProposal(t *testing.T) {
}

func TestInstantiateProposal_NoAdmin(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
ctx, keepers := CreateTestInput(t, false, "staking", nil, nil)
govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
wasmKeeper.setParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
})
Expand All @@ -146,7 +146,7 @@ func TestInstantiateProposal_NoAdmin(t *testing.T) {
)

var (
oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen)
oneAddress sdk.AccAddress = sdk.BytesToAccAddress(bytes.Repeat([]byte{0x1}, types.ContractAddrLen))
)

// test invalid admin address
Expand Down Expand Up @@ -178,10 +178,11 @@ func TestInstantiateProposal_NoAdmin(t *testing.T) {
require.NoError(t, err)

// then
contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr")
contractAddr := "link14hj2tavq8fpesdwxxcu44rty3hh90vhud63e6j"
err = sdk.ValidateAccAddress(contractAddr)
require.NoError(t, err)

cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr)
cInfo := wasmKeeper.GetContractInfo(ctx, sdk.AccAddress(contractAddr))
require.NotNil(t, cInfo)
assert.Equal(t, uint64(1), cInfo.CodeID)
assert.Equal(t, oneAddress.String(), cInfo.Creator)
Expand All @@ -193,7 +194,7 @@ func TestInstantiateProposal_NoAdmin(t *testing.T) {
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: src.Msg,
}}
assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr))
assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, sdk.AccAddress(contractAddr)))
// and event
require.Len(t, em.Events(), 3, "%#v", em.Events())
require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type)
Expand Down

0 comments on commit 0abdd6a

Please sign in to comment.