-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aljo242
committed
Nov 9, 2023
1 parent
ff86779
commit 7c5d658
Showing
16 changed files
with
2,556 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto3"; | ||
package feemarket.feemarket.v1; | ||
|
||
option go_package = "github.com/skip-mev/feemarket/x/feemarket/types"; | ||
|
||
import "google/protobuf/any.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
|
||
// FeeMarket is the fee market implementation to be used by the x/feemarket | ||
// module. | ||
message FeeMarket { | ||
// Implementation is a byte array that must implement | ||
// x/feemarket/types/FeeMarketImplementation | ||
bytes implementation = 1 | ||
[ (cosmos_proto.accepts_interface) = | ||
"feemarket.feemarket.v1.FeeMarketImplementation" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
syntax = "proto3"; | ||
package feemarket.feemarket.v1; | ||
|
||
option go_package = "github.com/skip-mev/feemarket/x/feemarket/plugins/mock"; | ||
|
||
import "cosmos_proto/cosmos.proto"; | ||
|
||
// MockFeeMarket is a message that contains the information about a mock fee | ||
// market implementation. | ||
// | ||
// NOTE: This is an example of a mock fee market. It is not used in production. | ||
message MockFeeMarket { | ||
option (cosmos_proto.implements_interface) = | ||
"feemarket.feemarket.v1.FeeMarketImplementation"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package types | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/gogoproto/proto" | ||
) | ||
|
||
// FeeMarketImplementation represents the interface of various FeeMarket types implemented | ||
// by other modules or packages. | ||
type FeeMarketImplementation interface { | ||
proto.Message | ||
|
||
// ValidateBasic does a simple validation check that | ||
// doesn't require access to any other information. | ||
ValidateBasic() error | ||
|
||
// ------------------- Fee Market Parameters ------------------- // | ||
|
||
// Init which initializes the fee market (in InitGenesis) | ||
Init(ctx sdk.Context) error | ||
|
||
// 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.). | ||
GetFeeMarketInfo(ctx sdk.Context) map[string]string | ||
|
||
// GetID returns the identifier of the fee market | ||
GetID() string | ||
|
||
// ------------------- Fee Market Extraction ------------------- // | ||
|
||
// FeeAnteHandler will be called in the module AnteHandler, | ||
// this is where the fee market would extract and distribute | ||
// fees from a given transaction | ||
FeeAnteHandler( | ||
ctx sdk.Context, | ||
tx sdk.Tx, | ||
simulate bool, | ||
next sdk.AnteHandler, | ||
) sdk.AnteHandler | ||
|
||
// FeePostHandler will be called in the module PostHandler | ||
// if PostHandlers are implemented. This is another place | ||
// the fee market might refund users | ||
FeePostHandler( | ||
ctx sdk.Context, | ||
tx sdk.Tx, | ||
simulate, | ||
success bool, | ||
next sdk.PostHandler, | ||
) sdk.PostHandler | ||
} | ||
|
||
// UpdateHandler is responsible for updating the parameters of the | ||
// fee market plugin. Fees can optionally also be extracted here. | ||
type UpdateHandler func(ctx sdk.Context) error |
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.