Skip to content

Commit

Permalink
fix: fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
shiki-tak committed Jun 17, 2022
1 parent a85ff59 commit feea968
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 2 additions & 0 deletions x/wasm/keeper/contract_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func (p PermissionedKeeper) SetContractInfoExtension(ctx sdk.Context, contract s

func (p PermissionedKeeper) UpdateContractStatus(ctx sdk.Context, contract sdk.AccAddress, caller sdk.AccAddress, status types.ContractStatus) error {
return p.nested.setContractStatus(ctx, contract, caller, status, p.authZPolicy)
}

// SetAccessConfig updates the access config of a code id.
func (p PermissionedKeeper) SetAccessConfig(ctx sdk.Context, codeID uint64, config types.AccessConfig) error {
return p.nested.setAccessConfig(ctx, codeID, config)
Expand Down
17 changes: 11 additions & 6 deletions x/wasm/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,13 @@ func TestQueryCodeInfo(t *testing.T) {
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)

ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil)
keeper := keepers.WasmKeeper

anyAddress, err := sdk.AccAddressFromBech32("cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz")
const anyAddress = "link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5"
err = sdk.ValidateAccAddress(anyAddress)
require.NoError(t, err)

require.NoError(t, err)
specs := map[string]struct {
codeId uint64
Expand All @@ -733,7 +736,7 @@ func TestQueryCodeInfo(t *testing.T) {
},
"with_address": {
codeId: 20,
accessConfig: types.AccessTypeOnlyAddress.With(anyAddress),
accessConfig: types.AccessTypeOnlyAddress.With(sdk.AccAddress(anyAddress)),
},
}
for msg, spec := range specs {
Expand Down Expand Up @@ -770,10 +773,12 @@ func TestQueryCodeInfoList(t *testing.T) {
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)

ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil)
keeper := keepers.WasmKeeper

anyAddress, err := sdk.AccAddressFromBech32("cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz")
const anyAddress = "link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5"
err = sdk.ValidateAccAddress(anyAddress)
require.NoError(t, err)
require.NoError(t, err)
codeInfoWithConfig := func(accessConfig types.AccessConfig) types.CodeInfo {
codeInfo := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode))
Expand All @@ -799,7 +804,7 @@ func TestQueryCodeInfoList(t *testing.T) {
{
name: "with_address",
codeId: 20,
codeInfo: codeInfoWithConfig(types.AccessTypeOnlyAddress.With(anyAddress)),
codeInfo: codeInfoWithConfig(types.AccessTypeOnlyAddress.With(sdk.AccAddress(anyAddress))),
},
}

Expand Down
10 changes: 0 additions & 10 deletions x/wasm/types/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,6 @@ func TestValidateParams(t *testing.T) {
},
expErr: true,
},
"reject empty max wasm code size": {
src: Params{
CodeUploadAccess: AllowNobody,
InstantiateDefaultPermission: AccessTypeNobody,
GasMultiplier: DefaultGasMultiplier,
InstanceCost: DefaultInstanceCost,
CompileCost: DefaultCompileCost,
},
expErr: true,
},
"reject empty gas multiplier": {
src: Params{
CodeUploadAccess: AllowNobody,
Expand Down

0 comments on commit feea968

Please sign in to comment.