Skip to content

Commit

Permalink
feat: keeper plugin wrappers (#10)
Browse files Browse the repository at this point in the history
* basic keeper funcs

* test4

* fix test

* test

* keeper

* beautify

* beautify

* add wrappers

* wrap

* keystate

* simplify

* docs

* Update x/feemarket/keeper/feemarket.go

Co-authored-by: David Terpay <[email protected]>

---------

Co-authored-by: aljo242 <[email protected]>
Co-authored-by: David Terpay <[email protected]>
  • Loading branch information
3 people authored Nov 10, 2023
1 parent a9338c2 commit 9fc2ceb
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions x/feemarket/keeper/feemarket.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package keeper

import (
"encoding/json"

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/skip-mev/feemarket/x/feemarket/interfaces"
)

// ------------------- Fee Market Updates ------------------- //

// Init which initializes the fee market (in InitGenesis)
func (k *Keeper) Init(ctx sdk.Context) error {
return k.plugin.Init(ctx)
}

// Export which exports the fee market (in ExportGenesis)
func (k *Keeper) Export(ctx sdk.Context) (json.RawMessage, error) {
return k.plugin.Export(ctx)
}

// BeginBlockUpdateHandler allows the fee market to be updated
// after every block. This will be added to the BeginBlock chain.
func (k *Keeper) BeginBlockUpdateHandler(ctx sdk.Context) interfaces.UpdateHandler {
return k.plugin.BeginBlockUpdateHandler(ctx)
}

// EndBlockUpdateHandler allows the fee market to be updated
// after every block. This will be added to the EndBlock chain.
func (k *Keeper) EndBlockUpdateHandler(ctx sdk.Context) interfaces.UpdateHandler {
return k.plugin.EndBlockUpdateHandler(ctx)
}

// ------------------- Fee Market Queries ------------------- //

// GetFeeMarketInfo retrieves the fee market's information about
// how to pay for a transaction (min gas price, min tip,
// where the fees are being distributed, etc.).
func (k *Keeper) GetFeeMarketInfo(ctx sdk.Context) map[string]string {
return k.plugin.GetFeeMarketInfo(ctx)
}

0 comments on commit 9fc2ceb

Please sign in to comment.