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

feat(wasmd): integrate wasmd #2223

Open
wants to merge 130 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
341b286
chore: bump Go to 1.21
robert-zaremba Jan 27, 2024
151ba80
update github setup-go action
robert-zaremba Jan 27, 2024
9a18c70
update go.sum
robert-zaremba Jan 27, 2024
4b80aa2
go deps: update dependencies for cosmos-sdk v0.47
robert-zaremba Jan 27, 2024
5b2c56b
go.mod files
robert-zaremba Jan 27, 2024
4e7fb69
update proto scripts
robert-zaremba Jan 27, 2024
39f41a3
update proto buf files
robert-zaremba Jan 27, 2024
ed790cb
fix proto version
robert-zaremba Jan 27, 2024
8be648b
add cosmos-proto to types module
robert-zaremba Jan 27, 2024
cd2df58
update go.mod
robert-zaremba Jan 29, 2024
07e3745
fix protoc orm version
robert-zaremba Feb 6, 2024
528347e
Merge branch 'main' into robert/cosmos-sdk-047
robert-zaremba Feb 6, 2024
3812663
go tidy types
robert-zaremba Feb 6, 2024
1dd6a4b
regenerate proto
robert-zaremba Feb 6, 2024
f095f5b
go mod tidy api
robert-zaremba Feb 6, 2024
e8ddccd
go tidy intertx
robert-zaremba Feb 6, 2024
c9e5af2
update ecocredit
robert-zaremba Feb 6, 2024
0b223bd
go deps ecocredit
robert-zaremba Feb 6, 2024
512dea0
go deps data
robert-zaremba Feb 6, 2024
621b826
update app.go
robert-zaremba Feb 6, 2024
84ebc0e
update app/export.go
robert-zaremba Feb 6, 2024
3c59649
update app/simulation
robert-zaremba Feb 6, 2024
4359d0c
fix pruning/types import
robert-zaremba Feb 6, 2024
a5d7868
main go mod tidy
robert-zaremba Feb 6, 2024
9b3db15
fix Makefile
robert-zaremba Feb 6, 2024
c987e43
small cleanup
robert-zaremba Feb 8, 2024
d8ace46
troubleshooting inferred type error in types/math
robert-zaremba Feb 8, 2024
d5dcccc
fix build type error with golang.org/x/exp
robert-zaremba Feb 9, 2024
30e134b
remove types/testutil/network - we will use SDK version
robert-zaremba Feb 9, 2024
6bec40e
update GetEvents
robert-zaremba Feb 9, 2024
047bbd9
fix import
robert-zaremba Feb 9, 2024
07e8d6c
fix golang.org/x/exp version
robert-zaremba Feb 9, 2024
d01111d
fix types/testutil/fixture
robert-zaremba Feb 9, 2024
f598839
use github.com/cosmos/cosmos-sdk/api v0.1.0
robert-zaremba Feb 9, 2024
8b28960
x/intertx module and msg interface
robert-zaremba Feb 9, 2024
5a48a02
update x/data api
robert-zaremba Feb 10, 2024
6037b8c
x/data: add viper dep
robert-zaremba Feb 10, 2024
a4e8848
rollback buf opt update and regenerate proto
robert-zaremba Feb 10, 2024
c3a1b5d
update cosmos-sdk and cosmos-proto
robert-zaremba Mar 6, 2024
6bf6a8b
update cosmos-sdk to 0.47.10
robert-zaremba Mar 6, 2024
97b45f9
update types
robert-zaremba Mar 8, 2024
8d06489
update proto gen swagger
robert-zaremba Mar 8, 2024
a78ddff
revert buf puslar config overwrite for cosmosapi
robert-zaremba Mar 8, 2024
de882da
use cosmos/gogoproto rather than gogo/protobuf
robert-zaremba Mar 11, 2024
a77edbe
go mod tidy
robert-zaremba Mar 11, 2024
b0dd5e9
testutil cli deps in x/data
robert-zaremba Mar 11, 2024
8fe56c3
fix flags
robert-zaremba Mar 12, 2024
828ac8b
fix banktestutil.MsgSendExec
robert-zaremba Mar 12, 2024
94c01da
Merge remote-tracking branch 'origin/main' into robert/cosmos-sdk-047
robert-zaremba Mar 24, 2024
b3571fd
orm.store.kv adapter for cometbft-db
robert-zaremba Mar 24, 2024
ae022c7
x/data: use orm kv.Store adapter
robert-zaremba Mar 24, 2024
56baff7
proto: use cosmos/gogoproto/types for Time and Duration
robert-zaremba Mar 25, 2024
ec4a4bb
Merge remote-tracking branch 'origin/main' into robert/cosmos-sdk-047…
robert-zaremba Apr 9, 2024
0b34951
solve PageRequest compatibility issues
robert-zaremba Apr 21, 2024
ea36a1e
ecocredits: resolve modules
robert-zaremba Apr 21, 2024
ea63022
ecocredits: fix imports
robert-zaremba Apr 21, 2024
f301d30
ecocredits: use orm kv.Store adapter
robert-zaremba Apr 21, 2024
6cf453e
ecocredits: fix flags
robert-zaremba Apr 21, 2024
6f5f61c
ecocredits: fix banktestutil.MsgSendExec
robert-zaremba Apr 21, 2024
efe839f
remove Close from storeAdapter
robert-zaremba Apr 21, 2024
833826e
ecocredit: solve PageRequest compatibility issues
robert-zaremba Apr 21, 2024
44ecea4
ecocredit: solve pulsar coin convertions
robert-zaremba Apr 21, 2024
33c81e8
ecocredit: solve PageRequest compatibility issues
robert-zaremba Apr 21, 2024
a02b77b
ecocredit: module compatibility
robert-zaremba Apr 21, 2024
bbb8a6b
ecocredit: fix server/tests/utils
robert-zaremba Apr 21, 2024
fc04856
fix deps in app
robert-zaremba Apr 21, 2024
561d3a2
update deps
robert-zaremba Apr 21, 2024
043053d
update deps
robert-zaremba Apr 21, 2024
ccd97b8
migrate: old upgrade handlers
robert-zaremba Apr 21, 2024
b147aa1
fix app.go code
robert-zaremba Apr 21, 2024
9c3c063
fix app.go
robert-zaremba Apr 21, 2024
efb53ec
use cosmos-sdk SimulationOperations
robert-zaremba Apr 21, 2024
6924b72
resolve gov keeper.GetDepositParams
robert-zaremba Apr 21, 2024
b3cb0ef
import errro
robert-zaremba Apr 21, 2024
9da20aa
app: migrate root cmd
robert-zaremba Apr 22, 2024
17f787b
app: rework NewRegenApp args
robert-zaremba Apr 22, 2024
7950aa2
update cli testutil setup
robert-zaremba Apr 22, 2024
9dee0eb
app: remove skipUpgradeHeights from NewRegenApp args
robert-zaremba Apr 22, 2024
1302af7
adding upgrade handler
robert-zaremba Apr 28, 2024
84051c8
update ORM and other deps
robert-zaremba May 14, 2024
159bb92
fix golang.org/x/exp version
robert-zaremba May 14, 2024
581ef21
use orm robert/orm-alpha.13-rapid1.1
robert-zaremba May 16, 2024
acda7e3
update buf override
aaronc May 30, 2024
2fd6685
proto-gen
aaronc May 30, 2024
274c69b
update github.com/golang/protobuf
aaronc May 30, 2024
724f8e8
use orm v1.5.4
robert-zaremba May 30, 2024
9d345c8
update google protobuf to 1.5.4
robert-zaremba Jun 22, 2024
00b090f
fix golang.org/x/exp version
robert-zaremba Jun 22, 2024
5d9e720
use cosmossdk.io/api
robert-zaremba Jun 22, 2024
f3645c7
bump cosmos-sdk to 0.47.12
robert-zaremba Jun 22, 2024
677bbc0
use cosmos-sdk@robert/fix-group-orm-err-codespace
robert-zaremba Jun 22, 2024
6b6e794
fix: ecocredit module initialization
robert-zaremba Jun 22, 2024
4ec453b
fix: app: add missing keys
robert-zaremba Jun 22, 2024
c4f5f41
fix: wrong scoped ibctransfer keeper initialization
robert-zaremba Jun 22, 2024
6a1653e
debug: remove sdk local overwrite
robert-zaremba Jun 22, 2024
64830cc
dev: add helper start script
robert-zaremba Jun 22, 2024
fc0cdc2
chore: upgrade tests (#2222)
JeancarloBarrios Jul 3, 2024
7b7e1cf
feat(wasmd): integrate wasmd
JeancarloBarrios Jul 18, 2024
08f0b1b
feat(wasmd): add wasmd ante
JeancarloBarrios Jul 19, 2024
ee2f7e9
feat(wasmd): fix go mod
JeancarloBarrios Jul 19, 2024
e5c1b86
wiring fixes
JeancarloBarrios Jul 22, 2024
05e755e
fix: linter fixes
JeancarloBarrios Jul 30, 2024
3377156
fix: linter fixes
JeancarloBarrios Jul 30, 2024
721da2d
fix: add comit true for TestAppAfterImport
JeancarloBarrios Oct 2, 2024
32a02e9
feat: devnet for regen-ledger (#2224)
PJEstrada Oct 29, 2024
8fb2a77
fix: fix newDecFrom string to return error on NaN
JeancarloBarrios Nov 30, 2024
1dce468
fix: fix account setup plus some sequence errors
JeancarloBarrios Nov 30, 2024
c18bf1d
fix: fix account setup plus some sequence errors
JeancarloBarrios Nov 30, 2024
ec33dcc
fix: fix account setup plus some sequence errors
JeancarloBarrios Nov 30, 2024
fee4996
fix: dec nan cannot be finate given that it gives an werror
JeancarloBarrios Dec 6, 2024
3914107
fix: integration tests for cosmos v0.47 upgrade (#2227)
PJEstrada Dec 9, 2024
655376f
Fix simulationi staking types missing keys
JeancarloBarrios Dec 9, 2024
dfb893d
Merge branch 'robert/cosmos-sdk-047' into JeancarloBarrios/add-cosmow…
JeancarloBarrios Dec 17, 2024
77f8ef4
fix test app import export
JeancarloBarrios Dec 17, 2024
8bd5217
fix test app import export
JeancarloBarrios Dec 17, 2024
cb99db5
fix test app import export
JeancarloBarrios Dec 17, 2024
49ca3c4
fix test app import export
JeancarloBarrios Dec 17, 2024
bfc3cb6
fix test app import export
JeancarloBarrios Dec 17, 2024
2c39b73
fix: Lint fixes 047 (#2228)
PJEstrada Dec 17, 2024
75c028d
fix test app import export
JeancarloBarrios Dec 17, 2024
2a7acef
Merge branch 'robert/cosmos-sdk-047' of github.com:regen-network/rege…
JeancarloBarrios Dec 17, 2024
047ef89
fix test app import export
JeancarloBarrios Dec 17, 2024
f5b3c91
fix lint fix ingoring g115
JeancarloBarrios Dec 18, 2024
03dafeb
fix lint fix ingoring g115
JeancarloBarrios Dec 18, 2024
e1f7712
Merge branch 'robert/cosmos-sdk-047' into JeancarloBarrios/add-cosmow…
JeancarloBarrios Dec 18, 2024
dea6b2b
add import
JeancarloBarrios Dec 18, 2024
daa18a2
Add genesis for cosmowasm
JeancarloBarrios Dec 18, 2024
d2a8f3a
Add genesis for cosmowasm
JeancarloBarrios Dec 18, 2024
062d744
Lint and test fixes
JeancarloBarrios Dec 18, 2024
8b9270a
Merge branch 'main' into JeancarloBarrios/add-cosmowasm-support
JeancarloBarrios Dec 31, 2024
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
66 changes: 66 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package app

import (
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"

errorsmod "cosmossdk.io/errors"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"

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

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *keeper.Keeper
WasmKeeper *wasmkeeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.WasmConfig == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}
if options.TXCounterStoreKey == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
}
126 changes: 107 additions & 19 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"math/big"
"net/http"
"os"
"path/filepath"
"strings"

"github.com/CosmWasm/wasmd/x/wasm"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
Expand All @@ -18,6 +22,9 @@
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"

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

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -188,15 +195,14 @@
ica.AppModuleBasic{},
ibcfee.AppModuleBasic{},
intertxmodule.AppModule{},
wasm.AppModuleBasic{},
)

// module account permissions
maccPerms = func() map[string][]string {
perms := map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
icatypes.ModuleName: nil,
ibcfeetypes.ModuleName: nil,
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
Expand All @@ -205,6 +211,11 @@
ecocredit.ModuleName: {authtypes.Burner},
baskettypes.BasketSubModuleName: {authtypes.Burner, authtypes.Minter},
marketplace.FeePoolName: {authtypes.Burner},

// non sdk
icatypes.ModuleName: nil,
ibcfeetypes.ModuleName: nil,
wasmtypes.ModuleName: {authtypes.Burner},
}

return perms
Expand Down Expand Up @@ -249,25 +260,30 @@
FeeGrantKeeper feegrantkeeper.Keeper
GovKeeper *govkeeper.Keeper
GroupKeeper groupkeeper.Keeper
IBCFeeKeeper ibcfeekeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCTransferKeeper ibctransferkeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
InterTxKeeper intertxkeeper.Keeper
MintKeeper mintkeeper.Keeper
ParamsKeeper paramskeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper

IBCFeeKeeper ibcfeekeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCTransferKeeper ibctransferkeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper

WasmKeeper wasmkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedInterTxKeeper capabilitykeeper.ScopedKeeper

ScopedWasmKeeper capabilitykeeper.ScopedKeeper

// the module manager
ModuleManager *module.Manager

Expand All @@ -282,6 +298,7 @@
func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
invCheckPeriod uint,
appOpts servertypes.AppOptions,
wasmOpts []wasmkeeper.Option,
baseAppOptions ...func(*baseapp.BaseApp)) *RegenApp {

encCfg := MakeEncodingConfig()
Expand All @@ -305,6 +322,7 @@
ibcexported.StoreKey, ibctransfertypes.StoreKey,
icahosttypes.StoreKey, ibcfeetypes.StoreKey, icacontrollertypes.StoreKey,
ecocredit.ModuleName, data.ModuleName, intertx.ModuleName,
wasmtypes.StoreKey,
)

tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -353,6 +371,9 @@
app.ScopedICAControllerKeeper = app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
app.ScopedInterTxKeeper = app.CapabilityKeeper.ScopeToModule(intertx.ModuleName)

// grant capabilities for wasm modules
app.ScopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)

// Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating
// their scoped modules in `NewApp` with `ScopeToModule`
app.CapabilityKeeper.Seal()
Expand Down Expand Up @@ -515,6 +536,40 @@
app.ScopedInterTxKeeper,
)

// Wasm Keepr
wasmDir := filepath.Join(homePath, "wasm")
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
if err != nil {
panic(fmt.Sprintf("error while reading wasm config: %s", err))
}
availableCapabilities := strings.Join(AllCapabilities(), ",")
// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
app.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
keys[wasmtypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
distrkeeper.NewQuerier(app.DistrKeeper),
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.ScopedWasmKeeper,
app.IBCTransferKeeper,
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
availableCapabilities,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)
// Create fee enabled wasm ibc Stack
var wasmStack porttypes.IBCModule
wasmStack = wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, app.IBCFeeKeeper)

// Create IBC stacks to add to IBC router

interTxModule := intertxmodule.NewModule(app.InterTxKeeper)
Expand All @@ -535,7 +590,8 @@
AddRoute(ibctransfertypes.ModuleName, ibcTransferStack).
AddRoute(intertx.ModuleName, icaControllerStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)
AddRoute(icahosttypes.SubModuleName, icaHostStack).
AddRoute(wasmtypes.ModuleName, wasmStack)
app.IBCKeeper.SetRouter(ibcRouter)

// Register the proposal types
Expand Down Expand Up @@ -596,6 +652,8 @@
params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
//
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
ibctransfer.NewAppModule(app.IBCTransferKeeper),
ecocreditMod,
dataMod,
Expand Down Expand Up @@ -636,6 +694,9 @@
icatypes.ModuleName,
ibcfeetypes.ModuleName,
intertx.ModuleName,

// wasm module
wasmtypes.ModuleName,
)
app.ModuleManager.SetOrderEndBlockers(
crisistypes.ModuleName,
Expand Down Expand Up @@ -664,6 +725,9 @@
icatypes.ModuleName,
ibcfeetypes.ModuleName,
intertx.ModuleName,

// wasm module
wasmtypes.ModuleName,
)
// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
Expand Down Expand Up @@ -697,6 +761,9 @@
icatypes.ModuleName,
ibcfeetypes.ModuleName,
intertx.ModuleName,

// wasm module
wasmtypes.ModuleName,
)

app.ModuleManager.RegisterInvariants(app.CrisisKeeper)
Expand Down Expand Up @@ -743,31 +810,51 @@
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)
app.setAnteHandler(txConfig)
app.setAnteHandler(txConfig, wasmConfig, keys[wasmtypes.StoreKey])
app.setPostHandler()

//
if manager := app.SnapshotManager(); manager != nil {
err = manager.RegisterExtensions(wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper))
if err != nil {
panic("failed to register snapshot extension: " + err.Error())
}
}

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
logger.Error("error on loading last version", "err", err)
os.Exit(1)
}

ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil {
logger.Error("WasmKeeper failed initialize pinned codes %s", "err", err)
os.Exit(1)
}
}

return app
app.SetPostHandler(postHandler)

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / build

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / determinism

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / app

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / unit (app)

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / import-export

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / after-import

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / integration

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / golangci (app)

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / golangci (app)

undefined: postHandler

Check failure on line 837 in app/app.go

View workflow job for this annotation

GitHub Actions / golangci (app)

undefined: postHandler
}

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / build

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / determinism

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / app

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / unit (app)

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / unit (app)

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / unit (app)

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / import-export

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / after-import

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / integration

missing return

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / golangci (app)

missing return (typecheck)

Check failure on line 838 in app/app.go

View workflow job for this annotation

GitHub Actions / golangci (app)

missing return) (typecheck)

func (app *RegenApp) setAnteHandler(txConfig client.TxConfig) {
anteHandler, err := ante.NewAnteHandler(
ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
SignModeHandler: txConfig.SignModeHandler(),
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
func (app *RegenApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmtypes.WasmConfig, txCounterStoreKey storetypes.StoreKey) {
anteHandler, err := NewAnteHandler(
HandlerOptions{
HandlerOptions: ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
SignModeHandler: txConfig.SignModeHandler(),
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
IBCKeeper: app.IBCKeeper,
WasmConfig: &wasmConfig,
TXCounterStoreKey: txCounterStoreKey,
WasmKeeper: &app.WasmKeeper,
},
)
if err != nil {
panic(err)
panic(fmt.Errorf("failed to create AnteHandler: %s", err))
}
app.SetAnteHandler(anteHandler)
}
Expand Down Expand Up @@ -990,6 +1077,7 @@
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(ibcfeetypes.ModuleName)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(wasmtypes.ModuleName)

return paramsKeeper
}
Loading
Loading