Skip to content

Commit dd22204

Browse files
authored
Add store code authz (#1591)
* 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
1 parent 42f3192 commit dd22204

29 files changed

+1567
-266
lines changed

app/ante.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type HandlerOptions struct {
2121
ante.HandlerOptions
2222

2323
IBCKeeper *keeper.Keeper
24+
WasmKeeper *wasmkeeper.Keeper
2425
WasmConfig *wasmTypes.WasmConfig
2526
TXCounterStoreKey storetypes.StoreKey
2627
}
@@ -46,6 +47,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
4647
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
4748
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
4849
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
50+
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
4951
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
5052
ante.NewValidateBasicDecorator(),
5153
ante.NewTxTimeoutHeightDecorator(),

app/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmtype
833833
IBCKeeper: app.IBCKeeper,
834834
WasmConfig: &wasmConfig,
835835
TXCounterStoreKey: txCounterStoreKey,
836+
WasmKeeper: &app.WasmKeeper,
836837
},
837838
)
838839
if err != nil {

0 commit comments

Comments
 (0)