Skip to content

Commit

Permalink
Bump Go version in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
alpe committed Sep 8, 2023
1 parent 437530f commit e5f2096
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker build . -t cosmwasm/wasmd:latest
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
FROM golang:1.20-alpine3.17 AS go-builder
FROM golang:1.21-alpine3.17 AS go-builder
ARG arch=x86_64

# this comes from standard alpine nightly file
Expand Down
3 changes: 1 addition & 2 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import (

"github.com/CosmWasm/wasmd/app/params"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

// MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only
func MakeEncodingConfig(t testing.TB) params.EncodingConfig {
t.Helper()
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
// note, this is not necessary when using app wiring, as depinject can be directly used (see root_v2.go)
tempApp := NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, wasmtypes.EnableAllProposals, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), []wasmkeeper.Option{})
tempApp := NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), []wasmkeeper.Option{})
return makeEncodingConfig(tempApp)
}

Expand Down
3 changes: 1 addition & 2 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

// GenesisState of the blockchain is represented here as a map of raw json
Expand All @@ -29,6 +28,6 @@ func NewDefaultGenesisState(t *testing.T) GenesisState {
t.Helper()
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
// note, this is not necessary when using app wiring, as depinject can be directly used (see root_v2.go)
tempApp := NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, wasmtypes.EnableAllProposals, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), []wasmkeeper.Option{})
tempApp := NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), []wasmkeeper.Option{})
return tempApp.DefaultGenesis()
}
2 changes: 0 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import (
simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
2 changes: 0 additions & 2 deletions cmd/wasmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ func newApp(

return app.NewWasmApp(
logger, db, traceStore, true,
app.GetEnabledProposals(),
appOpts,
wasmOpts,
baseappOptions...,
Expand Down Expand Up @@ -244,7 +243,6 @@ func appExport(
db,
traceStore,
height == -1,
app.GetEnabledProposals(),
appOpts,
emptyWasmOpts,
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewRootCmd() *cobra.Command {
cfg.Seal()
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
// note, this is not necessary when using app wiring, as depinject can be directly used (see root_v2.go)
tempApp := app.NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, wasmtypes.EnableAllProposals, simtestutil.NewAppOptionsWithFlagHome(tempDir()), []wasmkeeper.Option{})
tempApp := app.NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir()), []wasmkeeper.Option{})
encodingConfig := params.EncodingConfig{
InterfaceRegistry: tempApp.InterfaceRegistry(),
Codec: tempApp.AppCodec(),
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/grants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func TestStoreCodeGrant(t *testing.T) {
otherPrivKey := secp256k1.GenPrivKey()
otherAddr := sdk.AccAddress(otherPrivKey.PubKey().Address().Bytes())

chain.Fund(granteeAddr, sdk.NewInt(1_000_000))
chain.Fund(otherAddr, sdk.NewInt(1_000_000))
assert.Equal(t, sdk.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)
chain.Fund(granteeAddr, sdkmath.NewInt(1_000_000))
chain.Fund(otherAddr, sdkmath.NewInt(1_000_000))
assert.Equal(t, sdkmath.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)

specs := map[string]struct {
codeHash []byte
Expand Down Expand Up @@ -209,13 +209,13 @@ func TestStoreCodeGrant(t *testing.T) {

// then
if spec.expErr != nil {
require.True(t, spec.expErr.Is(gotErr))
assert.Equal(t, sdk.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)
require.Contains(t, gotErr.Error(), spec.expErr.Error())
assert.Equal(t, sdkmath.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)
assert.Equal(t, granterStartBalance, chain.Balance(granterAddr, sdk.DefaultBondDenom).Amount)
return
}
require.NoError(t, gotErr)
assert.Equal(t, sdk.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)
assert.Equal(t, sdkmath.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)
// assert.True(t, granterStartBalance.GT(chain.Balance(granterAddr, sdk.DefaultBondDenom).Amount))
})
}
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/keeper/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ var moduleBasics = module.NewBasicManager(
distribution.AppModuleBasic{},
gov.NewAppModuleBasic([]govclient.ProposalHandler{
paramsclient.ProposalHandler,
//upgradeclient.LegacyProposalHandler,
//upgradeclient.LegacyCancelProposalHandler,
// upgradeclient.LegacyProposalHandler,
// upgradeclient.LegacyCancelProposalHandler,
}),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (a StoreCodeAuthorization) MsgTypeURL() string {
}

// Accept implements Authorization.Accept.
func (a *StoreCodeAuthorization) Accept(ctx sdk.Context, msg sdk.Msg) (authztypes.AcceptResponse, error) {
func (a *StoreCodeAuthorization) Accept(ctx context.Context, msg sdk.Msg) (authztypes.AcceptResponse, error) {
var code []byte
var permission AccessConfig
switch msg := msg.(type) {
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ func TestStoreCodeAuthorizationAccept(t *testing.T) {
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
ctx := sdk.Context{}.WithGasMeter(sdk.NewInfiniteGasMeter())
ctx := sdk.Context{}.WithGasMeter(storetypes.NewInfiniteGasMeter())
gotResult, gotErr := spec.auth.Accept(ctx, spec.msg)
if spec.expErr != nil {
require.ErrorIs(t, gotErr, spec.expErr)
Expand Down

0 comments on commit e5f2096

Please sign in to comment.