Skip to content

Commit

Permalink
Add store code authz (#1591)
Browse files Browse the repository at this point in the history
* Start implementation

* Add implementation + some e2e test

* Fix lint

* Fix comments

* Add ante handler

* Add cli cmd + more test cases

* Add cli tests

* Add ante handler test

* Add more tests

* Fix comments

* Enable empty permissions for the grant

* Fix lint

* Update version
  • Loading branch information
pinosu authored Sep 14, 2023
1 parent 42f3192 commit dd22204
Show file tree
Hide file tree
Showing 29 changed files with 1,567 additions and 266 deletions.
2 changes: 2 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *keeper.Keeper
WasmKeeper *wasmkeeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
}
Expand All @@ -46,6 +47,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
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(),
Expand Down
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmtype
IBCKeeper: app.IBCKeeper,
WasmConfig: &wasmConfig,
TXCounterStoreKey: txCounterStoreKey,
WasmKeeper: &app.WasmKeeper,
},
)
if err != nil {
Expand Down
Loading

0 comments on commit dd22204

Please sign in to comment.