diff --git a/x/feemarket/plugins/mock/feemarket.go b/x/feemarket/plugins/mock/feemarket.go index 8e8b30b..bf161e4 100644 --- a/x/feemarket/plugins/mock/feemarket.go +++ b/x/feemarket/plugins/mock/feemarket.go @@ -1,6 +1,8 @@ package mock import ( + "encoding/json" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/skip-mev/feemarket/x/feemarket/types" @@ -20,23 +22,25 @@ func (fm *MockFeeMarket) Init(_ sdk.Context) error { return nil } -// EndBlockUpdateHandler allows the fee market to be updated -// after every block. This will be added to the EndBlock chain. -func (fm *MockFeeMarket) EndBlockUpdateHandler(_ sdk.Context) types.UpdateHandler { - return nil +// Export which exports the fee market (in ExportGenesis) +func (fm *MockFeeMarket) Export(_ sdk.Context) (json.RawMessage, error) { + return nil, nil } -// EpochUpdateHandler allows the fee market to be updated -// after every given epoch identifier. This maps the epoch -// identifier to the UpdateHandler that should be executed. -func (fm *MockFeeMarket) EpochUpdateHandler(_ sdk.Context) map[string]types.UpdateHandler { - return nil +// BeginBlockUpdateHandler allows the fee market to be updated +// after every block. This will be added to the BeginBlock chain. +func (fm *MockFeeMarket) BeginBlockUpdateHandler(_ sdk.Context) types.UpdateHandler { + return func(ctx sdk.Context) error { + return nil + } } -// GetMinGasPrice retrieves the minimum gas price(s) needed -// to be included in the block for the given transaction -func (fm *MockFeeMarket) GetMinGasPrice(_ sdk.Context, _ sdk.Tx) sdk.Coins { - return sdk.NewCoins() +// EndBlockUpdateHandler allows the fee market to be updated +// after every block. This will be added to the EndBlock chain. +func (fm *MockFeeMarket) EndBlockUpdateHandler(_ sdk.Context) types.UpdateHandler { + return func(ctx sdk.Context) error { + return nil + } } // GetFeeMarketInfo retrieves the fee market's information about diff --git a/x/feemarket/types/feemarket.go b/x/feemarket/types/feemarket.go index f538aaa..3876870 100644 --- a/x/feemarket/types/feemarket.go +++ b/x/feemarket/types/feemarket.go @@ -1,6 +1,8 @@ package types import ( + "encoding/json" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -18,21 +20,19 @@ type FeeMarketImplementation interface { // Init which initializes the fee market (in InitGenesis) Init(ctx sdk.Context) error + // Export which exports the fee market (in ExportGenesis) + Export(ctx sdk.Context) (json.RawMessage, error) + + // BeginBlockUpdateHandler allows the fee market to be updated + // after every block. This will be added to the BeginBlock chain. + BeginBlockUpdateHandler(ctx sdk.Context) UpdateHandler + // EndBlockUpdateHandler allows the fee market to be updated // after every block. This will be added to the EndBlock chain. EndBlockUpdateHandler(ctx sdk.Context) UpdateHandler - // EpochUpdateHandler allows the fee market to be updated - // after every given epoch identifier. This maps the epoch - // identifier to the UpdateHandler that should be executed. - EpochUpdateHandler(ctx sdk.Context) map[string]UpdateHandler - // ------------------- Fee Market Queries ------------------- // - // GetMinGasPrice retrieves the minimum gas price(s) needed - // to be included in the block for the given transaction - GetMinGasPrice(ctx sdk.Context, tx sdk.Tx) sdk.Coins - // 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.).