Skip to content

Commit

Permalink
nit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Nov 9, 2023
1 parent 7ce863c commit ee0b83f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
30 changes: 17 additions & 13 deletions x/feemarket/plugins/mock/feemarket.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package mock

import (
"encoding/json"

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

"github.com/skip-mev/feemarket/x/feemarket/types"
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions x/feemarket/types/feemarket.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package types

import (
"encoding/json"

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

Expand All @@ -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.).
Expand Down

0 comments on commit ee0b83f

Please sign in to comment.