-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from terra-money/fix/v2.9/proto
fix(v2.9): register pob interface
- Loading branch information
Showing
9 changed files
with
2,201 additions
and
1 deletion.
There are no files selected for viewing
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,44 @@ | ||
syntax = "proto3"; | ||
package pob.builder.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "amino/amino.proto"; | ||
|
||
option go_package = "github.com/skip-mev/pob/x/builder/types"; | ||
|
||
// GenesisState defines the genesis state of the x/builder module. | ||
message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; } | ||
|
||
// Params defines the parameters of the x/builder module. | ||
message Params { | ||
option (amino.name) = "cosmos-sdk/x/builder/Params"; | ||
|
||
// max_bundle_size is the maximum number of transactions that can be bundled | ||
// in a single bundle. | ||
uint32 max_bundle_size = 1; | ||
|
||
// escrow_account_address is the address of the account that will receive a | ||
// portion of the bid proceeds. | ||
bytes escrow_account_address = 2; | ||
|
||
// reserve_fee specifies the bid floor for the auction. | ||
cosmos.base.v1beta1.Coin reserve_fee = 3 | ||
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; | ||
|
||
// min_bid_increment specifies the minimum amount that the next bid must be | ||
// greater than the previous bid. | ||
cosmos.base.v1beta1.Coin min_bid_increment = 4 | ||
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; | ||
|
||
// front_running_protection specifies whether front running and sandwich | ||
// attack protection is enabled. | ||
bool front_running_protection = 5; | ||
|
||
// proposer_fee defines the portion of the winning bid that goes to the block | ||
// proposer that proposed the block. | ||
string proposer_fee = 6 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" | ||
]; | ||
} |
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,67 @@ | ||
syntax = "proto3"; | ||
package pob.builder.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "pob/builder/v1/genesis.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/msg/v1/msg.proto"; | ||
import "amino/amino.proto"; | ||
|
||
option go_package = "github.com/skip-mev/pob/x/builder/types"; | ||
|
||
// Msg defines the x/builder Msg service. | ||
service Msg { | ||
option (cosmos.msg.v1.service) = true; | ||
|
||
// AuctionBid defines a method for sending bids to the x/builder module. | ||
rpc AuctionBid(MsgAuctionBid) returns (MsgAuctionBidResponse) { | ||
option (google.api.http).post = "/pob/builder/v1/bid"; | ||
}; | ||
|
||
// UpdateParams defines a governance operation for updating the x/builder | ||
// module parameters. The authority is hard-coded to the x/gov module account. | ||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); | ||
} | ||
|
||
// MsgAuctionBid defines a request type for sending bids to the x/builder | ||
// module. | ||
message MsgAuctionBid { | ||
option (cosmos.msg.v1.signer) = "bidder"; | ||
option (amino.name) = "pob/x/builder/MsgAuctionBid"; | ||
|
||
option (gogoproto.equal) = false; | ||
|
||
// bidder is the address of the account that is submitting a bid to the | ||
// auction. | ||
string bidder = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; | ||
// bid is the amount of coins that the bidder is bidding to participate in the | ||
// auction. | ||
cosmos.base.v1beta1.Coin bid = 2 | ||
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; | ||
// transactions are the bytes of the transactions that the bidder wants to | ||
// bundle together. | ||
repeated bytes transactions = 3; | ||
} | ||
|
||
// MsgAuctionBidResponse defines the Msg/AuctionBid response type. | ||
message MsgAuctionBidResponse {} | ||
|
||
// MsgUpdateParams defines a request type for updating the x/builder module | ||
// parameters. | ||
message MsgUpdateParams { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
option (amino.name) = "pob/x/builder/MsgUpdateParams"; | ||
|
||
option (gogoproto.equal) = false; | ||
|
||
// authority is the address of the account that is authorized to update the | ||
// x/builder module parameters. | ||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; | ||
// params is the new parameters for the x/builder module. | ||
Params params = 2 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// MsgUpdateParamsResponse defines the Msg/UpdateParams response type. | ||
message MsgUpdateParamsResponse {} |
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,53 @@ | ||
package types | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/legacy" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/msgservice" | ||
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" | ||
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" | ||
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec" | ||
) | ||
|
||
var ( | ||
amino = codec.NewLegacyAmino() | ||
ModuleCdc = codec.NewAminoCodec(amino) | ||
) | ||
|
||
func init() { | ||
RegisterLegacyAminoCodec(amino) | ||
cryptocodec.RegisterCrypto(amino) | ||
sdk.RegisterLegacyAminoCodec(amino) | ||
|
||
// Register all Amino interfaces and concrete types on the authz and gov | ||
// Amino codec so that this can later be used to properly serialize MsgGrant, | ||
// MsgExec and MsgSubmitProposal instances. | ||
RegisterLegacyAminoCodec(authzcodec.Amino) | ||
RegisterLegacyAminoCodec(govcodec.Amino) | ||
RegisterLegacyAminoCodec(groupcodec.Amino) | ||
} | ||
|
||
// RegisterLegacyAminoCodec registers the necessary x/builder interfaces and | ||
// concrete types on the provided LegacyAmino codec. These types are used for | ||
// Amino JSON serialization. | ||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | ||
legacy.RegisterAminoMsg(cdc, &MsgAuctionBid{}, "pob/x/builder/MsgAuctionBid") | ||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "pob/x/builder/MsgUpdateParams") | ||
|
||
cdc.RegisterConcrete(Params{}, "pob/builder/Params", nil) | ||
} | ||
|
||
// RegisterInterfaces registers the x/builder interfaces types with the | ||
// interface registry. | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations( | ||
(*sdk.Msg)(nil), | ||
&MsgAuctionBid{}, | ||
&MsgUpdateParams{}, | ||
) | ||
|
||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) | ||
} |
Oops, something went wrong.