From 7d60841f3c5ed5d6aef3b3d04f2fccfc5f5b26bf Mon Sep 17 00:00:00 2001 From: emidev98 Date: Mon, 15 Jan 2024 09:18:54 +0200 Subject: [PATCH] fix(v2.9): pob types --- app/encoding.go | 6 + proto/pob/builder/v1/genesis.proto | 44 ++ proto/pob/builder/v1/tx.proto | 67 ++ scripts/protocgen.sh | 3 +- x/builder/types/codec.go | 53 ++ x/builder/types/genesis.pb.go | 754 ++++++++++++++++++++ x/builder/types/msgs.go | 50 ++ x/builder/types/tx.pb.go | 1054 ++++++++++++++++++++++++++++ x/builder/types/tx.pb.gw.go | 171 +++++ 9 files changed, 2201 insertions(+), 1 deletion(-) create mode 100644 proto/pob/builder/v1/genesis.proto create mode 100644 proto/pob/builder/v1/tx.proto create mode 100644 x/builder/types/codec.go create mode 100644 x/builder/types/genesis.pb.go create mode 100644 x/builder/types/msgs.go create mode 100644 x/builder/types/tx.pb.go create mode 100644 x/builder/types/tx.pb.gw.go diff --git a/app/encoding.go b/app/encoding.go index 2965a816..5b2cdecb 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/std" "github.com/terra-money/core/v2/app/params" + pobtypes "github.com/terra-money/core/v2/x/builder/types" ) var legacyCodecRegistered = false @@ -17,6 +18,11 @@ func MakeEncodingConfig() params.EncodingConfig { ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) + // Register POB interfaces and concrete types + // for the POB module that was used back in the day. + pobtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + pobtypes.RegisterLegacyAminoCodec(encodingConfig.Amino) + if !legacyCodecRegistered { // authz module use this codec to get signbytes. // authz MsgExec can execute all message types, diff --git a/proto/pob/builder/v1/genesis.proto b/proto/pob/builder/v1/genesis.proto new file mode 100644 index 00000000..d1417952 --- /dev/null +++ b/proto/pob/builder/v1/genesis.proto @@ -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" + ]; +} diff --git a/proto/pob/builder/v1/tx.proto b/proto/pob/builder/v1/tx.proto new file mode 100644 index 00000000..9f4461a2 --- /dev/null +++ b/proto/pob/builder/v1/tx.proto @@ -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 {} \ No newline at end of file diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 888c3d90..22fe156c 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -5,7 +5,7 @@ set -e echo "Generating gogo proto code" cd proto -proto_dirs=$(find ./osmosis ./juno ./terra -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +proto_dirs=$(find ./osmosis ./juno ./terra ./pob -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for dir in $proto_dirs; do for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do # this regex checks if a proto file has its go_package set to cosmossdk.io/api/... @@ -22,5 +22,6 @@ cd .. # move proto files to the right places cp -r github.com/osmosis-labs/osmosis/v17/* ./ cp -r github.com/CosmosContracts/juno/* ./ +cp -r github.com/skip-mev/pob/* ./ cp -r github.com/terra-money/core/v2/* ./ rm -rf github.com diff --git a/x/builder/types/codec.go b/x/builder/types/codec.go new file mode 100644 index 00000000..fe9f750c --- /dev/null +++ b/x/builder/types/codec.go @@ -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) +} diff --git a/x/builder/types/genesis.pb.go b/x/builder/types/genesis.pb.go new file mode 100644 index 00000000..72e0aad9 --- /dev/null +++ b/x/builder/types/genesis.pb.go @@ -0,0 +1,754 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pob/builder/v1/genesis.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the genesis state of the x/builder module. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_287f1bdff5ccfc33, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// Params defines the parameters of the x/builder module. +type Params struct { + // max_bundle_size is the maximum number of transactions that can be bundled + // in a single bundle. + MaxBundleSize uint32 `protobuf:"varint,1,opt,name=max_bundle_size,json=maxBundleSize,proto3" json:"max_bundle_size,omitempty"` + // escrow_account_address is the address of the account that will receive a + // portion of the bid proceeds. + EscrowAccountAddress []byte `protobuf:"bytes,2,opt,name=escrow_account_address,json=escrowAccountAddress,proto3" json:"escrow_account_address,omitempty"` + // reserve_fee specifies the bid floor for the auction. + ReserveFee types.Coin `protobuf:"bytes,3,opt,name=reserve_fee,json=reserveFee,proto3" json:"reserve_fee"` + // min_bid_increment specifies the minimum amount that the next bid must be + // greater than the previous bid. + MinBidIncrement types.Coin `protobuf:"bytes,4,opt,name=min_bid_increment,json=minBidIncrement,proto3" json:"min_bid_increment"` + // front_running_protection specifies whether front running and sandwich + // attack protection is enabled. + FrontRunningProtection bool `protobuf:"varint,5,opt,name=front_running_protection,json=frontRunningProtection,proto3" json:"front_running_protection,omitempty"` + // proposer_fee defines the portion of the winning bid that goes to the block + // proposer that proposed the block. + ProposerFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=proposer_fee,json=proposerFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"proposer_fee"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_287f1bdff5ccfc33, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMaxBundleSize() uint32 { + if m != nil { + return m.MaxBundleSize + } + return 0 +} + +func (m *Params) GetEscrowAccountAddress() []byte { + if m != nil { + return m.EscrowAccountAddress + } + return nil +} + +func (m *Params) GetReserveFee() types.Coin { + if m != nil { + return m.ReserveFee + } + return types.Coin{} +} + +func (m *Params) GetMinBidIncrement() types.Coin { + if m != nil { + return m.MinBidIncrement + } + return types.Coin{} +} + +func (m *Params) GetFrontRunningProtection() bool { + if m != nil { + return m.FrontRunningProtection + } + return false +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "pob.builder.v1.GenesisState") + proto.RegisterType((*Params)(nil), "pob.builder.v1.Params") +} + +func init() { proto.RegisterFile("pob/builder/v1/genesis.proto", fileDescriptor_287f1bdff5ccfc33) } + +var fileDescriptor_287f1bdff5ccfc33 = []byte{ + // 474 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6e, 0xd4, 0x3c, + 0x14, 0x85, 0x27, 0x7f, 0xfb, 0x8f, 0xa8, 0x67, 0x4a, 0xd5, 0xa8, 0x1a, 0x85, 0x82, 0xd2, 0xa8, + 0x8b, 0x32, 0xaa, 0x54, 0x5b, 0x03, 0x2c, 0x10, 0xbb, 0x09, 0xa5, 0x88, 0xdd, 0x90, 0xee, 0xd8, + 0x44, 0x4e, 0x72, 0x1b, 0xac, 0xd6, 0x76, 0x64, 0x3b, 0x61, 0xe8, 0x23, 0xb0, 0xe2, 0x31, 0x58, + 0xa1, 0x3e, 0x46, 0x97, 0x5d, 0x22, 0x16, 0x15, 0x9a, 0x59, 0xf4, 0x35, 0x50, 0xec, 0xb4, 0x94, + 0x25, 0x9b, 0x24, 0xf2, 0x77, 0x7d, 0xce, 0x3d, 0xb9, 0x17, 0x3d, 0xa9, 0x64, 0x46, 0xb2, 0x9a, + 0x9d, 0x15, 0xa0, 0x48, 0x33, 0x21, 0x25, 0x08, 0xd0, 0x4c, 0xe3, 0x4a, 0x49, 0x23, 0xfd, 0x87, + 0x95, 0xcc, 0x70, 0x47, 0x71, 0x33, 0xd9, 0xde, 0x2a, 0x65, 0x29, 0x2d, 0x22, 0xed, 0x97, 0xab, + 0xda, 0x0e, 0x73, 0xa9, 0xb9, 0xd4, 0x24, 0xa3, 0x1a, 0x48, 0x33, 0xc9, 0xc0, 0xd0, 0x09, 0xc9, + 0x25, 0x13, 0x1d, 0xdf, 0xa4, 0x9c, 0x09, 0x49, 0xec, 0xd3, 0x1d, 0xed, 0x1e, 0xa2, 0xe1, 0x5b, + 0xe7, 0x74, 0x6c, 0xa8, 0x01, 0xff, 0x05, 0xea, 0x57, 0x54, 0x51, 0xae, 0x03, 0x2f, 0xf2, 0xc6, + 0x83, 0x67, 0x23, 0xfc, 0xb7, 0x33, 0x9e, 0x59, 0x1a, 0xaf, 0x5e, 0x5e, 0xef, 0xf4, 0x92, 0xae, + 0x76, 0xf7, 0xfb, 0x0a, 0xea, 0x3b, 0xe0, 0xef, 0xa1, 0x0d, 0x4e, 0xe7, 0x69, 0x56, 0x8b, 0xe2, + 0x0c, 0x52, 0xcd, 0xce, 0xc1, 0x2a, 0xad, 0x27, 0xeb, 0x9c, 0xce, 0x63, 0x7b, 0x7a, 0xcc, 0xce, + 0x5b, 0xa3, 0x11, 0xe8, 0x5c, 0xc9, 0x4f, 0x29, 0xcd, 0x73, 0x59, 0x0b, 0x93, 0xd2, 0xa2, 0x50, + 0xa0, 0x75, 0xf0, 0x5f, 0xe4, 0x8d, 0x87, 0xc9, 0x96, 0xa3, 0x53, 0x07, 0xa7, 0x8e, 0xf9, 0x6f, + 0xd0, 0x40, 0x81, 0x06, 0xd5, 0x40, 0x7a, 0x02, 0x10, 0xac, 0xd8, 0x1e, 0x1f, 0x61, 0x97, 0x1b, + 0xb7, 0xb9, 0x71, 0x97, 0x1b, 0xbf, 0x96, 0x4c, 0xc4, 0x6b, 0x6d, 0x9b, 0xdf, 0x6e, 0x2e, 0xf6, + 0xbd, 0x04, 0x75, 0x17, 0x8f, 0x00, 0xfc, 0x19, 0xda, 0xe4, 0x4c, 0xa4, 0x19, 0x2b, 0x52, 0x26, + 0x72, 0x05, 0x1c, 0x84, 0x09, 0x56, 0xff, 0x41, 0x6c, 0x83, 0x33, 0x11, 0xb3, 0xe2, 0xdd, 0xed, + 0x65, 0xff, 0x25, 0x0a, 0x4e, 0x94, 0x14, 0x26, 0x55, 0xb5, 0x10, 0x4c, 0x94, 0x69, 0xfb, 0x7b, + 0x21, 0x37, 0x4c, 0x8a, 0xe0, 0xff, 0xc8, 0x1b, 0x3f, 0x48, 0x46, 0x96, 0x27, 0x0e, 0xcf, 0xee, + 0xa8, 0xff, 0x1e, 0x0d, 0x2b, 0x25, 0x2b, 0xa9, 0x41, 0xd9, 0x4c, 0xfd, 0xc8, 0x1b, 0xaf, 0xc5, + 0xb8, 0xf5, 0xfa, 0x79, 0xbd, 0xb3, 0x57, 0x32, 0xf3, 0xb1, 0xce, 0x70, 0x2e, 0x39, 0xe9, 0xa6, + 0xeb, 0x5e, 0x07, 0xba, 0x38, 0x25, 0xe6, 0x73, 0x05, 0x1a, 0x1f, 0x42, 0x9e, 0x0c, 0x6e, 0x35, + 0x8e, 0x00, 0x5e, 0x45, 0x5f, 0x6e, 0x2e, 0xf6, 0x1f, 0xdf, 0xab, 0x9b, 0xdf, 0x6d, 0x56, 0x37, + 0xbe, 0xe9, 0xe5, 0x22, 0xf4, 0xae, 0x16, 0xa1, 0xf7, 0x6b, 0x11, 0x7a, 0x5f, 0x97, 0x61, 0xef, + 0x6a, 0x19, 0xf6, 0x7e, 0x2c, 0xc3, 0xde, 0x87, 0xa7, 0xf7, 0x0c, 0xf5, 0x29, 0xab, 0x0e, 0x38, + 0x34, 0xa4, 0xdd, 0xcd, 0x3f, 0x1a, 0xd6, 0x35, 0xeb, 0xdb, 0x05, 0x7a, 0xfe, 0x3b, 0x00, 0x00, + 0xff, 0xff, 0x3d, 0xb6, 0x59, 0xc6, 0xb9, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ProposerFee.Size() + i -= size + if _, err := m.ProposerFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.FrontRunningProtection { + i-- + if m.FrontRunningProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size, err := m.MinBidIncrement.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.ReserveFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.EscrowAccountAddress) > 0 { + i -= len(m.EscrowAccountAddress) + copy(dAtA[i:], m.EscrowAccountAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.EscrowAccountAddress))) + i-- + dAtA[i] = 0x12 + } + if m.MaxBundleSize != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.MaxBundleSize)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxBundleSize != 0 { + n += 1 + sovGenesis(uint64(m.MaxBundleSize)) + } + l = len(m.EscrowAccountAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.ReserveFee.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.MinBidIncrement.Size() + n += 1 + l + sovGenesis(uint64(l)) + if m.FrontRunningProtection { + n += 2 + } + l = m.ProposerFee.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBundleSize", wireType) + } + m.MaxBundleSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxBundleSize |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowAccountAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EscrowAccountAddress = append(m.EscrowAccountAddress[:0], dAtA[iNdEx:postIndex]...) + if m.EscrowAccountAddress == nil { + m.EscrowAccountAddress = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReserveFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ReserveFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinBidIncrement", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinBidIncrement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontRunningProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FrontRunningProtection = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProposerFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/builder/types/msgs.go b/x/builder/types/msgs.go new file mode 100644 index 00000000..20dfa08b --- /dev/null +++ b/x/builder/types/msgs.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgAuctionBid{} +) + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m MsgUpdateParams) ValidateBasic() error { + return nil +} + +func NewMsgAuctionBid(bidder sdk.AccAddress, bid sdk.Coin, transactions [][]byte) *MsgAuctionBid { + return &MsgAuctionBid{ + Bidder: bidder.String(), + Bid: bid, + Transactions: transactions, + } +} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgAuctionBid) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgAuctionBid message. +func (m MsgAuctionBid) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Bidder) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m MsgAuctionBid) ValidateBasic() error { + return nil +} diff --git a/x/builder/types/tx.pb.go b/x/builder/types/tx.pb.go new file mode 100644 index 00000000..224f734b --- /dev/null +++ b/x/builder/types/tx.pb.go @@ -0,0 +1,1054 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pob/builder/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgAuctionBid defines a request type for sending bids to the x/builder +// module. +type MsgAuctionBid struct { + // bidder is the address of the account that is submitting a bid to the + // auction. + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bid is the amount of coins that the bidder is bidding to participate in the + // auction. + Bid types.Coin `protobuf:"bytes,2,opt,name=bid,proto3" json:"bid"` + // transactions are the bytes of the transactions that the bidder wants to + // bundle together. + Transactions [][]byte `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"` +} + +func (m *MsgAuctionBid) Reset() { *m = MsgAuctionBid{} } +func (m *MsgAuctionBid) String() string { return proto.CompactTextString(m) } +func (*MsgAuctionBid) ProtoMessage() {} +func (*MsgAuctionBid) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{0} +} +func (m *MsgAuctionBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuctionBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuctionBid.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAuctionBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuctionBid.Merge(m, src) +} +func (m *MsgAuctionBid) XXX_Size() int { + return m.Size() +} +func (m *MsgAuctionBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuctionBid.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuctionBid proto.InternalMessageInfo + +func (m *MsgAuctionBid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *MsgAuctionBid) GetBid() types.Coin { + if m != nil { + return m.Bid + } + return types.Coin{} +} + +func (m *MsgAuctionBid) GetTransactions() [][]byte { + if m != nil { + return m.Transactions + } + return nil +} + +// MsgAuctionBidResponse defines the Msg/AuctionBid response type. +type MsgAuctionBidResponse struct { +} + +func (m *MsgAuctionBidResponse) Reset() { *m = MsgAuctionBidResponse{} } +func (m *MsgAuctionBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAuctionBidResponse) ProtoMessage() {} +func (*MsgAuctionBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{1} +} +func (m *MsgAuctionBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuctionBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuctionBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAuctionBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuctionBidResponse.Merge(m, src) +} +func (m *MsgAuctionBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAuctionBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuctionBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuctionBidResponse proto.InternalMessageInfo + +// MsgUpdateParams defines a request type for updating the x/builder module +// parameters. +type MsgUpdateParams struct { + // authority is the address of the account that is authorized to update the + // x/builder module parameters. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params is the new parameters for the x/builder module. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{2} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the Msg/UpdateParams response type. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{3} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgAuctionBid)(nil), "pob.builder.v1.MsgAuctionBid") + proto.RegisterType((*MsgAuctionBidResponse)(nil), "pob.builder.v1.MsgAuctionBidResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "pob.builder.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "pob.builder.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("pob/builder/v1/tx.proto", fileDescriptor_5cab4e3a4b082d0a) } + +var fileDescriptor_5cab4e3a4b082d0a = []byte{ + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0x34, 0x1a, 0xc8, 0x18, 0x15, 0xd7, 0xd6, 0xfc, 0xa8, 0xdd, 0x84, 0x05, 0x69, 0x08, + 0x74, 0xc7, 0xd4, 0xd2, 0x43, 0x6f, 0x59, 0xcf, 0x01, 0x59, 0x11, 0xc4, 0x8b, 0xcc, 0x66, 0x87, + 0xe9, 0x60, 0x77, 0x66, 0xd9, 0x99, 0x84, 0xf6, 0x26, 0x3d, 0x7a, 0x12, 0xfc, 0x07, 0x3c, 0x7a, + 0xcc, 0x41, 0xff, 0x87, 0x9e, 0xa4, 0xe8, 0x41, 0x4f, 0x22, 0x89, 0x10, 0xff, 0x0c, 0x99, 0xdd, + 0xd9, 0x36, 0x1b, 0xc5, 0x5e, 0x42, 0xf6, 0x7d, 0xdf, 0xfb, 0xde, 0xfb, 0xbe, 0x79, 0xb0, 0x1e, + 0x8b, 0x00, 0x05, 0x63, 0x76, 0x14, 0x92, 0x04, 0x4d, 0xfa, 0x48, 0x1d, 0xbb, 0x71, 0x22, 0x94, + 0xb0, 0x6e, 0xc5, 0x22, 0x70, 0x0d, 0xe0, 0x4e, 0xfa, 0xad, 0x75, 0x2a, 0xa8, 0x48, 0x21, 0xa4, + 0xff, 0x65, 0xac, 0xd6, 0x7d, 0x2a, 0x04, 0x3d, 0x22, 0x08, 0xc7, 0x0c, 0x61, 0xce, 0x85, 0xc2, + 0x8a, 0x09, 0x2e, 0x0d, 0x6a, 0x8f, 0x84, 0x8c, 0x84, 0x44, 0x01, 0x96, 0x04, 0x4d, 0xfa, 0x01, + 0x51, 0xb8, 0x8f, 0x46, 0x82, 0xf1, 0xbc, 0x7b, 0x65, 0x38, 0x25, 0x9c, 0x48, 0x96, 0x77, 0x37, + 0xb3, 0xee, 0x97, 0xd9, 0xd0, 0xec, 0xc3, 0x40, 0x75, 0x23, 0x1c, 0x49, 0xaa, 0xfb, 0x22, 0x49, + 0x0d, 0x70, 0x07, 0x47, 0x8c, 0x0b, 0x94, 0xfe, 0x66, 0x25, 0xe7, 0x33, 0x80, 0x37, 0x87, 0x92, + 0x0e, 0xc6, 0x23, 0xbd, 0x9a, 0xc7, 0x42, 0xeb, 0x21, 0xac, 0x04, 0x2c, 0x0c, 0x49, 0xd2, 0x00, + 0x1d, 0xd0, 0xad, 0x7a, 0x8d, 0x2f, 0x1f, 0x77, 0xd6, 0x8d, 0xfe, 0x20, 0x0c, 0x13, 0x22, 0xe5, + 0x53, 0x95, 0x30, 0x4e, 0x7d, 0xc3, 0xb3, 0xf6, 0x61, 0x39, 0x60, 0x61, 0x63, 0xad, 0x03, 0xba, + 0x37, 0x76, 0x9b, 0xae, 0xe1, 0x6a, 0x5b, 0xae, 0xb1, 0xe5, 0x3e, 0x16, 0x8c, 0x7b, 0xd5, 0xb3, + 0x1f, 0xed, 0xd2, 0x87, 0xc5, 0xb4, 0x07, 0x7c, 0xdd, 0x60, 0x39, 0xb0, 0xa6, 0x12, 0xcc, 0x25, + 0x4e, 0x67, 0xcb, 0x46, 0xb9, 0x53, 0xee, 0xd6, 0xfc, 0x42, 0xed, 0x00, 0xfd, 0x7e, 0xdf, 0x2e, + 0x9d, 0x2e, 0xa6, 0x3d, 0x33, 0xec, 0xcd, 0x62, 0xda, 0xdb, 0xd4, 0xc1, 0x1c, 0x5f, 0x44, 0x53, + 0x58, 0xdf, 0xa9, 0xc3, 0x8d, 0x42, 0xc1, 0x27, 0x32, 0x16, 0x5c, 0x12, 0xe7, 0x13, 0x80, 0xb7, + 0x87, 0x92, 0x3e, 0x8b, 0x43, 0xac, 0xc8, 0x13, 0x9c, 0xe0, 0x48, 0x5a, 0xfb, 0xb0, 0x8a, 0xc7, + 0xea, 0x50, 0x24, 0x4c, 0x9d, 0x5c, 0x69, 0xf7, 0x92, 0x6a, 0xed, 0xc1, 0x4a, 0x9c, 0x2a, 0x18, + 0xd3, 0xf7, 0xdc, 0xe2, 0x3d, 0xb8, 0x99, 0xbe, 0x77, 0x4d, 0x3b, 0xf6, 0x0d, 0xf7, 0x60, 0x2f, + 0xf7, 0x72, 0xa9, 0xa4, 0xed, 0x6c, 0xfd, 0x65, 0x67, 0x79, 0x47, 0xa7, 0x09, 0xeb, 0x2b, 0xa5, + 0xdc, 0xd2, 0xee, 0x37, 0x00, 0xcb, 0x43, 0x49, 0x2d, 0x01, 0xe1, 0xd2, 0x03, 0x6e, 0xad, 0x2e, + 0x53, 0xc8, 0xa3, 0xf5, 0xe0, 0xbf, 0xf0, 0x45, 0x5c, 0x9b, 0xa7, 0x5f, 0x7f, 0xbd, 0x5b, 0xdb, + 0x70, 0xee, 0xa2, 0x95, 0x33, 0xd4, 0x2f, 0xf7, 0x1c, 0xd6, 0x0a, 0x39, 0xb6, 0xff, 0xa1, 0xb9, + 0x4c, 0x68, 0x6d, 0x5f, 0x41, 0xc8, 0xc7, 0xb6, 0xae, 0xbf, 0xd6, 0xf7, 0xe1, 0x0d, 0xce, 0x66, + 0x36, 0x38, 0x9f, 0xd9, 0xe0, 0xe7, 0xcc, 0x06, 0x6f, 0xe7, 0x76, 0xe9, 0x7c, 0x6e, 0x97, 0xbe, + 0xcf, 0xed, 0xd2, 0x8b, 0x6d, 0xca, 0xd4, 0xe1, 0x38, 0x70, 0x47, 0x22, 0x42, 0xf2, 0x15, 0x8b, + 0x77, 0x22, 0x32, 0x41, 0xc5, 0x04, 0xd5, 0x49, 0x4c, 0x64, 0x50, 0x49, 0x0f, 0xfc, 0xd1, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xeb, 0xfe, 0x5c, 0xc4, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // AuctionBid defines a method for sending bids to the x/builder module. + AuctionBid(ctx context.Context, in *MsgAuctionBid, opts ...grpc.CallOption) (*MsgAuctionBidResponse, error) + // UpdateParams defines a governance operation for updating the x/builder + // module parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) AuctionBid(ctx context.Context, in *MsgAuctionBid, opts ...grpc.CallOption) (*MsgAuctionBidResponse, error) { + out := new(MsgAuctionBidResponse) + err := c.cc.Invoke(ctx, "/pob.builder.v1.Msg/AuctionBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/pob.builder.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // AuctionBid defines a method for sending bids to the x/builder module. + AuctionBid(context.Context, *MsgAuctionBid) (*MsgAuctionBidResponse, error) + // UpdateParams defines a governance operation for updating the x/builder + // module parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) AuctionBid(ctx context.Context, req *MsgAuctionBid) (*MsgAuctionBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuctionBid not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_AuctionBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAuctionBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AuctionBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pob.builder.v1.Msg/AuctionBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AuctionBid(ctx, req.(*MsgAuctionBid)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pob.builder.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pob.builder.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AuctionBid", + Handler: _Msg_AuctionBid_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pob/builder/v1/tx.proto", +} + +func (m *MsgAuctionBid) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAuctionBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuctionBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Transactions) > 0 { + for iNdEx := len(m.Transactions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Transactions[iNdEx]) + copy(dAtA[i:], m.Transactions[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Transactions[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAuctionBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAuctionBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuctionBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAuctionBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Bid.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.Transactions) > 0 { + for _, b := range m.Transactions { + l = len(b) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAuctionBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAuctionBid) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAuctionBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuctionBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transactions", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Transactions = append(m.Transactions, make([]byte, postIndex-iNdEx)) + copy(m.Transactions[len(m.Transactions)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAuctionBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAuctionBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuctionBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/builder/types/tx.pb.gw.go b/x/builder/types/tx.pb.gw.go new file mode 100644 index 00000000..bb907aa0 --- /dev/null +++ b/x/builder/types/tx.pb.gw.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: pob/builder/v1/tx.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Msg_AuctionBid_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Msg_AuctionBid_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgAuctionBid + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_AuctionBid_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AuctionBid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_AuctionBid_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgAuctionBid + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_AuctionBid_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AuctionBid(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". +// UnaryRPC :call MsgServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. +func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { + + mux.Handle("POST", pattern_Msg_AuctionBid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_AuctionBid_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_AuctionBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMsgHandler(ctx, mux, conn) +} + +// RegisterMsgHandler registers the http handlers for service Msg to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) +} + +// RegisterMsgHandlerClient registers the http handlers for service Msg +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MsgClient" to call the correct interceptors. +func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { + + mux.Handle("POST", pattern_Msg_AuctionBid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_AuctionBid_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_AuctionBid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Msg_AuctionBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pob", "builder", "v1", "bid"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Msg_AuctionBid_0 = runtime.ForwardResponseMessage +)