From 2bb466f17240cd70dd7895802d1d20babccb299a Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 11 Sep 2024 15:47:05 +0700 Subject: [PATCH 1/4] initial version --- proto/reserve/auction/module/module.proto | 15 + proto/reserve/auction/v1/auction.proto | 95 ++ proto/reserve/auction/v1/genesis.proto | 23 + proto/reserve/auction/v1/params.proto | 40 + proto/reserve/auction/v1/tx.proto | 88 ++ proto/reserve/oracle/query.proto | 1 - proto/scripts/protocgen-pulsar.sh | 8 + x/auction/client/cli/tx.go | 31 + x/auction/keeper/abci.go | 200 +++ x/auction/keeper/grpc_query.go | 26 + x/auction/keeper/grpc_query_test.go | 20 + x/auction/keeper/keeper.go | 189 +++ x/auction/keeper/msg_server.go | 80 ++ x/auction/keeper/msg_server_test.go | 79 ++ x/auction/keeper/params.go | 33 + x/auction/keeper/params_test.go | 18 + x/auction/module/autocli.go | 35 + x/auction/module/genesis.go | 23 + x/auction/module/genesis_test.go | 32 + x/auction/module/module.go | 221 ++++ x/auction/module/simulation.go | 60 + x/auction/simulation/helpers.go | 15 + x/auction/types/auction.pb.go | 1360 +++++++++++++++++++ x/auction/types/codec.go | 27 + x/auction/types/errors.go | 15 + x/auction/types/events.go | 8 + x/auction/types/expected_keepers.go | 32 + x/auction/types/genesis.go | 22 + x/auction/types/genesis.pb.go | 454 +++++++ x/auction/types/genesis_test.go | 32 + x/auction/types/keys.go | 28 + x/auction/types/msg_update_params.go | 21 + x/auction/types/params.go | 32 + x/auction/types/params.pb.go | 640 +++++++++ x/auction/types/query.pb.go | 539 ++++++++ x/auction/types/query.pb.gw.go | 153 +++ x/auction/types/tx.pb.go | 1454 +++++++++++++++++++++ x/oracle/types/query.pb.go | 41 +- 38 files changed, 6167 insertions(+), 23 deletions(-) create mode 100644 proto/reserve/auction/module/module.proto create mode 100644 proto/reserve/auction/v1/auction.proto create mode 100644 proto/reserve/auction/v1/genesis.proto create mode 100644 proto/reserve/auction/v1/params.proto create mode 100644 proto/reserve/auction/v1/tx.proto create mode 100644 proto/scripts/protocgen-pulsar.sh create mode 100644 x/auction/client/cli/tx.go create mode 100644 x/auction/keeper/abci.go create mode 100644 x/auction/keeper/grpc_query.go create mode 100644 x/auction/keeper/grpc_query_test.go create mode 100644 x/auction/keeper/keeper.go create mode 100644 x/auction/keeper/msg_server.go create mode 100644 x/auction/keeper/msg_server_test.go create mode 100644 x/auction/keeper/params.go create mode 100644 x/auction/keeper/params_test.go create mode 100644 x/auction/module/autocli.go create mode 100644 x/auction/module/genesis.go create mode 100644 x/auction/module/genesis_test.go create mode 100644 x/auction/module/module.go create mode 100644 x/auction/module/simulation.go create mode 100644 x/auction/simulation/helpers.go create mode 100644 x/auction/types/auction.pb.go create mode 100644 x/auction/types/codec.go create mode 100644 x/auction/types/errors.go create mode 100644 x/auction/types/events.go create mode 100644 x/auction/types/expected_keepers.go create mode 100644 x/auction/types/genesis.go create mode 100644 x/auction/types/genesis.pb.go create mode 100644 x/auction/types/genesis_test.go create mode 100644 x/auction/types/keys.go create mode 100644 x/auction/types/msg_update_params.go create mode 100644 x/auction/types/params.go create mode 100644 x/auction/types/params.pb.go create mode 100644 x/auction/types/query.pb.go create mode 100644 x/auction/types/query.pb.gw.go create mode 100644 x/auction/types/tx.pb.go diff --git a/proto/reserve/auction/module/module.proto b/proto/reserve/auction/module/module.proto new file mode 100644 index 0000000..06e92ab --- /dev/null +++ b/proto/reserve/auction/module/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package reserve.auction.module; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import : "github.com/onomyprotocol/reserve/x/auction" + }; + + // authority defines the custom module authority. If not set, defaults to the + // governance module. + string authority = 1; +} \ No newline at end of file diff --git a/proto/reserve/auction/v1/auction.proto b/proto/reserve/auction/v1/auction.proto new file mode 100644 index 0000000..1f7f5ca --- /dev/null +++ b/proto/reserve/auction/v1/auction.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; +package reserve.auction.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/onomyprotocol/reserve/x/auction/types"; + +// AuctionStatus enumerates the valid auction status. +enum AuctionStatus { + // AUCTION_STATUS_UNSPECIFIED defines unknow auction status default is active. + AUCTION_STATUS_UNSPECIFIED= 0; + // AUCTION_STATUS_ACTIVE defines auction active status. + AUCTION_STATUS_ACTIVE= 1; + // AUCTION_STATUS_FINISHED defines auction finished with a winning bid. + AUCTION_STATUS_FINISHED = 2; + // AUCTION_STATUS_EXPIRED defines auction finished without a winning bid. + AUCTION_STATUS_EXPIRED = 3; + } + +// Auction struct +message Auction { + // start_time defines auction's start time + google.protobuf.Timestamp start_time = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // end_time defines where the auction ended when there are no winning bid + google.protobuf.Timestamp end_time = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // for simplicity, will use vault id that start the auction as auction id + uint64 auction_id = 3; + + // starting price (currently only support usd stable token) + cosmos.base.v1beta1.Coin initial_price = 4 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // items defines liquidate assets + cosmos.base.v1beta1.Coin item = 5 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // current_rate defines the rate compare with the initial price + string current_rate = 6 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + + // last_discount_time defines the last time a discount has been apply + google.protobuf.Timestamp last_discount_time = 7 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // status defines auction current status + AuctionStatus status = 8; + + // final_bid contain the winning bid or empty if auction ended without a winner + Bid final_bid = 9; + + // target_goal defines the debt the auction is trying to recover + cosmos.base.v1beta1.Coin target_goal = 10; +} + +// Bid defines bid entry +message Bid { + // id of bid + string bid_id = 1; + + // bidder address + string bidder = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // bidding amount + cosmos.base.v1beta1.Coin amount = 3 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // recive_rate defines the rate compare to the price at the start of the auction + // that the bid is willing to pay + string recive_rate = 4 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; +} + +// BidQueue defines a list of bid entries for a single auction +message BidQueue { + // bidder address + uint64 auction_id = 1; + + // map of bid entries with bidder address + map bids = 2; +} \ No newline at end of file diff --git a/proto/reserve/auction/v1/genesis.proto b/proto/reserve/auction/v1/genesis.proto new file mode 100644 index 0000000..20a4c3a --- /dev/null +++ b/proto/reserve/auction/v1/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package reserve.auction.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "reserve/auction/v1/params.proto"; +import "reserve/auction/v1/auction.proto"; + +option go_package = "github.com/onomyprotocol/reserve/x/auction/types"; + +// GenesisState defines the auction module's genesis state. +message GenesisState { + + // params defines all the parameters of the module. + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // list of auctions + repeated Auction auctions = 2; + + // list of all bid entries + repeated Bid bid_entries = 3; +} diff --git a/proto/reserve/auction/v1/params.proto b/proto/reserve/auction/v1/params.proto new file mode 100644 index 0000000..d3f9c84 --- /dev/null +++ b/proto/reserve/auction/v1/params.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package reserve.auction.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/onomyprotocol/reserve/x/auction/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "reserve/x/auction/Params"; + option (gogoproto.equal) = true; + // defines how long (either in blocktime or blockheight) + // between each auction + google.protobuf.Duration auction_periods = 1 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // duration between each price reduction + google.protobuf.Duration reduce_step = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // rate compared with the collaterals price from the + // oracle at which the auction will start with + string starting_rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + + // rate compared with the initial price that the price + // can drop to + string lowest_rate = 4 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + + // rate that are decrease every reduce_step + string discount_rate = 5 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; +} \ No newline at end of file diff --git a/proto/reserve/auction/v1/tx.proto b/proto/reserve/auction/v1/tx.proto new file mode 100644 index 0000000..9155458 --- /dev/null +++ b/proto/reserve/auction/v1/tx.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; +package reserve.auction.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "reserve/auction/v1/params.proto"; + +option go_package = "github.com/onomyprotocol/reserve/x/auction/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // Bid defines an operation for submit a bid entry. + rpc Bid(MsgBid) returns (MsgBidResponse); + + // CancelBid defines an operation for cancel an existing bid entry. + rpc CancelBid(MsgCancelBid) returns (MsgCancelBidResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "reserve/x/oracle/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} + +// MsgBid is the Msg/Bid request type. +message MsgBid { + option (cosmos.msg.v1.signer) = "bidder"; + option (amino.name) = "reserve/x/oracle/MsgBid"; + + // bidder is the address that submitting the bid entry. + string bidder = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // bidding auction id + uint64 auction_id = 2; + + // amount defines the amount that the bidder willing to pay. + cosmos.base.v1beta1.Coin amount = 3 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // recive_rate defines the rate compare to the price at the start of the auction + // that the bid is willing to pay + string recive_rate = 4 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; +} + +// MsgBidResponse defines the response structure for executing a +// MsgBid message. +message MsgBidResponse { + string response = 1; +} + +// MsgCancelBid is the Msg/CancelBid request type. +message MsgCancelBid { + option (cosmos.msg.v1.signer) = "bidder"; + option (amino.name) = "reserve/x/oracle/MsgUpdateBid"; + + // bid_id is the unique id. + string bid_id = 1; + + // bidding auction id + uint64 auction_id = 2; +} + +// MsgCancelBidResponse defines the response structure for executing a +// MsgCancelBid message. +message MsgCancelBidResponse {} \ No newline at end of file diff --git a/proto/reserve/oracle/query.proto b/proto/reserve/oracle/query.proto index bbc5e36..8e783c5 100644 --- a/proto/reserve/oracle/query.proto +++ b/proto/reserve/oracle/query.proto @@ -4,7 +4,6 @@ package reserve.oracle; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "reserve/oracle/params.proto"; option go_package = "github.com/onomyprotocol/reserve/x/oracle/types"; diff --git a/proto/scripts/protocgen-pulsar.sh b/proto/scripts/protocgen-pulsar.sh new file mode 100644 index 0000000..93198ee --- /dev/null +++ b/proto/scripts/protocgen-pulsar.sh @@ -0,0 +1,8 @@ +# this script is for generating protobuf files for the new google.golang.org/protobuf API +set -eo pipefail + +echo "Cleaning API directory" +(cd api; find ./ -type f \( -iname \*.pulsar.go -o -iname \*.pb.go -o -iname \*.cosmos_orm.go -o -iname \*.pb.gw.go \) -delete; find . -empty -type d -delete; cd ..) + +echo "Generating API module" +(cd proto; buf generate --template buf.gen.pulsar.yaml) diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go new file mode 100644 index 0000000..8126e0a --- /dev/null +++ b/x/auction/client/cli/tx.go @@ -0,0 +1,31 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/onomyprotocol/reserve/x/oracle/types" +) + +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) + +const listSeparator = "," + +// GetTxCmd returns the transaction commands for this module. +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/auction/keeper/abci.go b/x/auction/keeper/abci.go new file mode 100644 index 0000000..25643ee --- /dev/null +++ b/x/auction/keeper/abci.go @@ -0,0 +1,200 @@ +package keeper + +import ( + "context" + "time" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onomyprotocol/reserve/x/auction/types" +) + +func (k *Keeper) BeginBlocker(ctx context.Context) error { + params := k.GetParams(ctx) + + currentTime := sdk.UnwrapSDKContext(ctx).BlockHeader().Time + lastAuctionPeriods, err := k.lastestAuctionPeriod.Get(ctx) + if err != nil { + return err + } + + // check if has reached the next auction periods + if lastAuctionPeriods.Add(params.AuctionPeriods).Before(currentTime) { + return nil + } + + k.lastestAuctionPeriod.Set(ctx, lastAuctionPeriods.Add(params.AuctionDurations)) + + // TODO: check vault module for liquidate vault + + // loop through all auctions + err = k.Auctions.Walk(ctx, nil, func(auctionId uint64, auction types.Auction) (bool, error) { + // check if auction is ended or a bidder won + if auction.EndTime.After(currentTime) || + auction.Status == types.AuctionStatus_AUCTION_STATUS_EXPIRED || + auction.Status == types.AuctionStatus_AUCTION_STATUS_FINISHED { + if auction.FinalBid == nil || + auction.FinalBid.Bidder == "" || + auction.FinalBid.Amount.IsZero() { + // TODO: notify vault module about auction without winner + } + + bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(auction.FinalBid.Bidder) + if err != nil { + err := k.revertFinishedStatus(ctx, auction, currentTime) + return err == nil, err + } + + spendable := k.bankKeeper.SpendableCoins(ctx, bidderAddr) + if spendable.AmountOf(auction.FinalBid.Amount.Denom).LT(auction.FinalBid.Amount.Amount) { + // if bidder does not have enough token to pay, revert the status of auction + err := k.revertFinishedStatus(ctx, auction, currentTime) + return err == nil, err + } + + // send the bid amount to auction module + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(auction.FinalBid.Amount)) + if err != nil { + err := k.revertFinishedStatus(ctx, auction, currentTime) + return err == nil, err + } + + // send the liquidate assets to auction winner + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, auction.Items) + if err != nil { + err := k.revertFinishedStatus(ctx, auction, currentTime) + return err == nil, err + } + + // TODO: notify vault module about the winner and return raised token from the auction + + // clear the auction afterward + err = k.DeleteAuction(ctx, auction.AuctionId) + if err != nil { + return true, err + } + + // skip other logic + return false, nil + } + + // check if reach next reduce step + if auction.LastDiscountTime.Add(params.ReduceStep).Before(currentTime) { + // get new discount rate + newRate, err := k.discountRate(auction, params) + if err != nil { + return true, err + } + + // apply new changes + auction.CurrentRate = newRate + auction.LastDiscountTime = auction.LastDiscountTime.Add(params.ReduceStep) + + // update new rate and last discount time + err = k.Auctions.Set(ctx, auctionId, auction) + if err != nil { + return true, err + } + } + + highestBid, amt, err := k.checkBidEntry(ctx, auction) + if err != nil { + return true, err + } + if highestBid == "" || amt.Amount.IsZero() { + return false, nil + } + + // update status and final bid + auction.Status = types.AuctionStatus_AUCTION_STATUS_FINISHED + auction.FinalBid = &types.Bid{ + Bidder: highestBid, + Amount: amt, + } + err = k.Auctions.Set(ctx, auctionId, auction) + if err != nil { + return true, err + } + + return false, nil + }) + if err != nil { + return err + } + + return nil +} + +func (k Keeper) revertFinishedStatus(ctx context.Context, auction types.Auction, currTime time.Time) error { + auction.FinalBid = nil + if currTime.After(auction.EndTime) { + auction.Status = types.AuctionStatus_AUCTION_STATUS_EXPIRED + } else { + auction.Status = types.AuctionStatus_AUCTION_STATUS_ACTIVE + } + + return k.Auctions.Set(ctx, auction.AuctionId, auction) +} + +func (k Keeper) checkBidEntry(ctx context.Context, auction types.Auction) (highestBidder string, amt sdk.Coin, err error) { + denom := auction.InitialPrice.Denom + + bidQueue, err := k.Bids.Get(ctx, auction.AuctionId) + if err != nil { + return "", sdk.NewCoin(denom, sdkmath.ZeroInt()), err + } + + currentRate, err := sdkmath.LegacyNewDecFromStr(auction.CurrentRate) + if err != nil { + return "", sdk.NewCoin(denom, sdkmath.ZeroInt()), err + } + + currentPriceAmt := sdkmath.LegacyNewDecFromInt(auction.InitialPrice.Amount).Mul(currentRate).RoundInt() + + maxBidder := struct { + addr string + amt sdkmath.Int + }{ + addr: "", + amt: currentPriceAmt, + } + for addr, bid := range bidQueue.Bids { + // get the highest bid that greater or equal the current price + if bid.Amount.Amount.GT(maxBidder.amt) { + maxBidder.addr = addr + maxBidder.amt = bid.Amount.Amount + } + } + + if maxBidder.addr == "" { + return "", sdk.NewCoin(denom, sdkmath.ZeroInt()), err + } + + return maxBidder.addr, sdk.NewCoin(denom, maxBidder.amt), nil + +} + +func (k Keeper) discountRate(auction types.Auction, params types.Params) (string, error) { + lowestRate, err := sdkmath.LegacyNewDecFromStr(params.LowestRate) + if err != nil { + return sdkmath.LegacyZeroDec().String(), err + } + + discountRate, err := sdkmath.LegacyNewDecFromStr(params.DiscountRate) + if err != nil { + return sdkmath.LegacyZeroDec().String(), err + } + + currentRate, err := sdkmath.LegacyNewDecFromStr(auction.CurrentRate) + if err != nil { + return sdkmath.LegacyZeroDec().String(), err + } + + if currentRate.LT(lowestRate) || currentRate.Sub(discountRate).LT(lowestRate) { + return currentRate.String(), nil + } + + newCurrentRate := currentRate.Sub(discountRate) + + return newCurrentRate.String(), nil +} diff --git a/x/auction/keeper/grpc_query.go b/x/auction/keeper/grpc_query.go new file mode 100644 index 0000000..8e88caf --- /dev/null +++ b/x/auction/keeper/grpc_query.go @@ -0,0 +1,26 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/onomyprotocol/reserve/x/auction/types" +) + +var _ types.QueryServer = Querier{} + +type Querier struct { + Keeper +} + +func (k Querier) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/auction/keeper/grpc_query_test.go b/x/auction/keeper/grpc_query_test.go new file mode 100644 index 0000000..0979c07 --- /dev/null +++ b/x/auction/keeper/grpc_query_test.go @@ -0,0 +1,20 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/onomyprotocol/reserve/testutil/keeper" + "github.com/onomyprotocol/reserve/x/oracle/types" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + params := types.DefaultParams() + require.NoError(t, keeper.SetParams(ctx, params)) + + response, err := keeper.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go new file mode 100644 index 0000000..1d00463 --- /dev/null +++ b/x/auction/keeper/keeper.go @@ -0,0 +1,189 @@ +package keeper + +import ( + "context" + "errors" + "fmt" + "time" + + "cosmossdk.io/collections" + "cosmossdk.io/core/store" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/onomyprotocol/reserve/x/auction/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeService store.KVStoreService + logger log.Logger + + // keepers + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper + + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string + + // timestamp of lastest auction period + lastestAuctionPeriod collections.Item[time.Time] + + // Auctions maps auction id with auction struct + Auctions collections.Map[uint64, types.Auction] + + // Bids maps auction id with bids queue + Bids collections.Map[uint64, types.BidQueue] + + // BidByAddress maps bidder address + auction id to a bid entry + BidByAddress collections.Map[collections.Pair[uint64, sdk.AccAddress], types.Bid] + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeService store.KVStoreService, + logger log.Logger, + authority string, + +) Keeper { + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + panic(fmt.Sprintf("invalid authority address: %s", authority)) + } + + sb := collections.NewSchemaBuilder(storeService) + return Keeper{ + cdc: cdc, + storeService: storeService, + authority: authority, + logger: logger, + Auctions: collections.NewMap(sb, types.AuctionsPrefix, "auctions", collections.Uint64Key, codec.CollValue[types.Auction](cdc)), + Bids: collections.NewMap(sb, types.BidsPrefix, "bids", collections.Uint64Key, codec.CollValue[types.BidQueue](cdc)), + BidByAddress: collections.NewMap(sb, types.BidByAddressPrefix, "bids_by_address", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[types.Bid](cdc)), + } +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +// clear all state of the given auction id +func (k Keeper) DeleteAuction(ctx context.Context, auctionId uint64) error { + err := k.Auctions.Remove(ctx, auctionId) + if err != nil { + return fmt.Errorf("failed to remove auction: %s", err) + } + + // clear the bid queue + err = k.Bids.Remove(ctx, auctionId) + if err != nil { + return fmt.Errorf("failed to remove bid queue: %s", err) + } + + // clear all bids for that auction id + rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](auctionId) + return k.BidByAddress.Clear(ctx, rng) +} + +// AddBidEntry adds new bid entry for the given auction id +func (k Keeper) AddBidEntry(ctx context.Context, auctionId uint64, bidderAddr sdk.AccAddress, bid types.Bid) error { + has, err := k.Auctions.Has(ctx, auctionId) + if err != nil { + return err + } + if !has { + return fmt.Errorf("cannot bid for non-existing/expired auction with id: %v", auctionId) + } + + has = k.authKeeper.HasAccount(ctx, bidderAddr) + if !has { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address %s: account does not exist", bid.Bidder) + } + + bidQueue, err := k.Bids.Get(ctx, auctionId) + if err != nil { + return err + } + + _, has = bidQueue.Bids[bid.Bidder] + if has { + return fmt.Errorf("bid entry already exist for address %s and auction %v", bid.Bidder, auctionId) + } + + bidQueue.Bids[bid.Bidder] = &bid + err = k.Bids.Set(ctx, auctionId, bidQueue) + if err != nil { + return err + } + + err = k.BidByAddress.Set(ctx, collections.Join(auctionId, bidderAddr), bid) + if err != nil { + return err + } + + return nil +} + +// UpdateBidEntry udpdate existing bid entry for the given auction id +func (k Keeper) UpdateBidEntry(ctx context.Context, auctionId uint64, bidderAddr sdk.AccAddress, updatedBid types.Bid) error { + has, err := k.Auctions.Has(ctx, auctionId) + if err != nil { + return err + } + if !has { + return fmt.Errorf("cannot bid for non-existing/expired auction with id: %v", auctionId) + } + + has = k.authKeeper.HasAccount(ctx, bidderAddr) + if !has { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address %s: account does not exist", updatedBid.Bidder) + } + + bidQueue, err := k.Bids.Get(ctx, auctionId) + if err != nil { + return err + } + + currBid, has := bidQueue.Bids[updatedBid.Bidder] + if !has { + return fmt.Errorf("bid entry does not exist for address %s and auction %v", updatedBid.Bidder, auctionId) + } + + // locked additional amount when bidder raise the amount + // or refund amount when bidder lower the amount + if currBid.Amount.Amount.Equal(updatedBid.Amount.Amount) { + return errors.New("updated bidding amount must be different from the current bidding amount") + } + + // update the entry + bidQueue.Bids[currBid.Bidder] = currBid + err = k.Bids.Set(ctx, auctionId, bidQueue) + if err != nil { + return err + } + + err = k.BidByAddress.Set(ctx, collections.Join(auctionId, bidderAddr), *currBid) + if err != nil { + return err + } + + return nil +} + +func (k Keeper) lockedToken(ctx context.Context, amt sdk.Coins, bidderAdrr sdk.AccAddress) error { + return k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAdrr, types.ModuleName, amt) +} + +func (k Keeper) refundToken(ctx context.Context, amt sdk.Coins, bidderAdrr sdk.AccAddress) error { + return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAdrr, amt) +} diff --git a/x/auction/keeper/msg_server.go b/x/auction/keeper/msg_server.go new file mode 100644 index 0000000..63c75b1 --- /dev/null +++ b/x/auction/keeper/msg_server.go @@ -0,0 +1,80 @@ +package keeper + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onomyprotocol/reserve/x/auction/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + if err := k.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} + +func (k msgServer) Bid(ctx context.Context, msg *types.MsgBid) (*types.MsgBidResponse, error) { + bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(msg.Bidder) + if err != nil { + return nil, err + } + + bid := types.Bid{ + Bidder: msg.Bidder, + Amount: msg.Amount, + } + err = k.AddBidEntry(ctx, msg.AuctionId, bidderAddr, bid) + if err != nil { + return nil, err + } + + sdk.UnwrapSDKContext(ctx).EventManager().EmitEvent(sdk.NewEvent( + types.EventAddBid, + sdk.NewAttribute(types.AttributeKeyBidEntry, fmt.Sprintf("bidder %s has submit an entry with amount: %s", msg.Bidder, msg.Amount.String())), + )) + + return &types.MsgBidResponse{}, nil +} + +func (k msgServer) UpdateBid(ctx context.Context, msg *types.MsgUpdateBid) (*types.MsgUpdateBidResponse, error) { + bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(msg.Bidder) + if err != nil { + return nil, err + } + + bid := types.Bid{ + Bidder: msg.Bidder, + Amount: msg.Amount, + } + err = k.UpdateBidEntry(ctx, msg.AuctionId, bidderAddr, bid) + if err != nil { + return nil, err + } + + sdk.UnwrapSDKContext(ctx).EventManager().EmitEvent(sdk.NewEvent( + types.EventUpdateBid, + sdk.NewAttribute(types.AttributeKeyBidEntry, fmt.Sprintf("bidder %s has update their entry to amount: %s", msg.Bidder, msg.Amount.String())), + )) + + return &types.MsgUpdateBidResponse{}, nil +} diff --git a/x/auction/keeper/msg_server_test.go b/x/auction/keeper/msg_server_test.go new file mode 100644 index 0000000..31d44c1 --- /dev/null +++ b/x/auction/keeper/msg_server_test.go @@ -0,0 +1,79 @@ +package keeper_test + +import ( + "context" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/onomyprotocol/reserve/testutil/keeper" + "github.com/onomyprotocol/reserve/x/oracle/keeper" + "github.com/onomyprotocol/reserve/x/oracle/types" +) + +func setupMsgServer(t testing.TB) (keeper.Keeper, types.MsgServer, context.Context) { + k, ctx := keepertest.OracleKeeper(t) + return k, keeper.NewMsgServerImpl(k), ctx +} + +func TestMsgServer(t *testing.T) { + k, ms, ctx := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) + require.NotEmpty(t, k) +} + +func TestMsgUpdateParams(t *testing.T) { + k, ms, ctx := setupMsgServer(t) + params := types.DefaultParams() + require.NoError(t, k.SetParams(ctx, params)) + wctx := sdk.UnwrapSDKContext(ctx) + + // default params + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Params: params, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + { + name: "send enabled param", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: types.Params{}, + }, + expErr: false, + }, + { + name: "all good", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: params, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := ms.UpdateParams(wctx, tc.input) + + if tc.expErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/auction/keeper/params.go b/x/auction/keeper/params.go new file mode 100644 index 0000000..92db535 --- /dev/null +++ b/x/auction/keeper/params.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/runtime" + + "github.com/onomyprotocol/reserve/x/auction/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx context.Context) (params types.Params) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams set the params +func (k Keeper) SetParams(ctx context.Context, params types.Params) error { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + + return nil +} diff --git a/x/auction/keeper/params_test.go b/x/auction/keeper/params_test.go new file mode 100644 index 0000000..f433b5e --- /dev/null +++ b/x/auction/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/onomyprotocol/reserve/testutil/keeper" + "github.com/onomyprotocol/reserve/x/oracle/types" +) + +func TestGetParams(t *testing.T) { + k, ctx := keepertest.OracleKeeper(t) + params := types.DefaultParams() + + require.NoError(t, k.SetParams(ctx, params)) + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/auction/module/autocli.go b/x/auction/module/autocli.go new file mode 100644 index 0000000..e5377fe --- /dev/null +++ b/x/auction/module/autocli.go @@ -0,0 +1,35 @@ +package oracle + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/onomyprotocol/reserve/api/reserve/oracle" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the module", + }, + // this line is used by ignite scaffolding # autocli/query + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // only required if you want to use the custom command + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + // this line is used by ignite scaffolding # autocli/tx + }, + }, + } +} diff --git a/x/auction/module/genesis.go b/x/auction/module/genesis.go new file mode 100644 index 0000000..9b2d6b6 --- /dev/null +++ b/x/auction/module/genesis.go @@ -0,0 +1,23 @@ +package oracle + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/onomyprotocol/reserve/x/auction/keeper" + "github.com/onomyprotocol/reserve/x/auction/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + if err := k.SetParams(ctx, genState.Params); err != nil { + panic(err) + } +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + return genesis +} diff --git a/x/auction/module/genesis_test.go b/x/auction/module/genesis_test.go new file mode 100644 index 0000000..6410bd4 --- /dev/null +++ b/x/auction/module/genesis_test.go @@ -0,0 +1,32 @@ +package oracle_test + +import ( + "testing" + + keepertest "github.com/onomyprotocol/reserve/testutil/keeper" + "github.com/onomyprotocol/reserve/testutil/nullify" + oracle "github.com/onomyprotocol/reserve/x/oracle/module" + "github.com/onomyprotocol/reserve/x/oracle/types" + + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + PortId: types.PortID, + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.OracleKeeper(t) + oracle.InitGenesis(ctx, k, genesisState) + got := oracle.ExportGenesis(ctx, k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + require.Equal(t, genesisState.PortId, got.PortId) + + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/auction/module/module.go b/x/auction/module/module.go new file mode 100644 index 0000000..b75809c --- /dev/null +++ b/x/auction/module/module.go @@ -0,0 +1,221 @@ +package oracle + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + modulev1 "github.com/onomyprotocol/reserve/api/reserve/auction/module" + "github.com/onomyprotocol/reserve/x/auction/client/cli" + "github.com/onomyprotocol/reserve/x/auction/keeper" + "github.com/onomyprotocol/reserve/x/auction/types" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the +// independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used +// to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message. +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. +// The default GenesisState need to be defined by the module developer and is primarily used for testing. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns the root Tx command for the module. +// These commands enrich the AutoCLI tx commands. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{ + Keeper: am.keeper, + }) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. +// It should be incremented on each consensus-breaking change introduced by the module. +// To avoid wrong/empty versions, the initial version should be set to 1. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block. +// The begin block implementation is optional. +func (am AppModule) BeginBlock(ctx context.Context) error { + return am.keeper.BeginBlocker(ctx) +} + +// EndBlock contains the logic that is automatically triggered at the end of each block. +// The end block implementation is optional. +func (am AppModule) EndBlock(ctx context.Context) error { + return am.keeper.EndBlocker(ctx) +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper +} + +type ModuleOutputs struct { + depinject.Out + + OracleKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.StoreService, + in.Logger, + authority.String(), + ) + m := NewAppModule( + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, + ) + + return ModuleOutputs{OracleKeeper: k, Module: m} +} diff --git a/x/auction/module/simulation.go b/x/auction/module/simulation.go new file mode 100644 index 0000000..b5c5a65 --- /dev/null +++ b/x/auction/module/simulation.go @@ -0,0 +1,60 @@ +package oracle + +import ( + "math/rand" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/onomyprotocol/reserve/testutil/sample" + oraclesimulation "github.com/onomyprotocol/reserve/x/oracle/simulation" + "github.com/onomyprotocol/reserve/x/oracle/types" +) + +// avoid unused import issue +var ( + _ = oraclesimulation.FindAccount + _ = rand.Rand{} + _ = sample.AccAddress + _ = sdk.AccAddress{} + _ = simulation.MsgEntryKind +) + +const ( +// this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + oracleGenesis := types.GenesisState{ + Params: types.DefaultParams(), + PortId: types.PortID, + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&oracleGenesis) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/auction/simulation/helpers.go b/x/auction/simulation/helpers.go new file mode 100644 index 0000000..92c437c --- /dev/null +++ b/x/auction/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/auction/types/auction.pb.go b/x/auction/types/auction.pb.go new file mode 100644 index 0000000..2ec0e17 --- /dev/null +++ b/x/auction/types/auction.pb.go @@ -0,0 +1,1360 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: reserve/auction/v1/auction.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// AuctionStatus enumerates the valid auction status. +type AuctionStatus int32 + +const ( + // AUCTION_STATUS_UNSPECIFIED defines unknow auction status default is active. + AuctionStatus_AUCTION_STATUS_UNSPECIFIED AuctionStatus = 0 + // AUCTION_STATUS_ACTIVE defines auction active status. + AuctionStatus_AUCTION_STATUS_ACTIVE AuctionStatus = 1 + // AUCTION_STATUS_FINISHED defines auction finished with a winning bid. + AuctionStatus_AUCTION_STATUS_FINISHED AuctionStatus = 2 + // AUCTION_STATUS_EXPIRED defines auction finished without a winning bid. + AuctionStatus_AUCTION_STATUS_EXPIRED AuctionStatus = 3 +) + +var AuctionStatus_name = map[int32]string{ + 0: "AUCTION_STATUS_UNSPECIFIED", + 1: "AUCTION_STATUS_ACTIVE", + 2: "AUCTION_STATUS_FINISHED", + 3: "AUCTION_STATUS_EXPIRED", +} + +var AuctionStatus_value = map[string]int32{ + "AUCTION_STATUS_UNSPECIFIED": 0, + "AUCTION_STATUS_ACTIVE": 1, + "AUCTION_STATUS_FINISHED": 2, + "AUCTION_STATUS_EXPIRED": 3, +} + +func (x AuctionStatus) String() string { + return proto.EnumName(AuctionStatus_name, int32(x)) +} + +func (AuctionStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_8758264ed04201a2, []int{0} +} + +// Auction struct +type Auction struct { + // start_time defines auction's start time + StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + // end_time defines where the auction ended when there are no winning bid + EndTime time.Time `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` + // for simplicity, will use vault id that start the auction as auction id + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // starting price (currently only support usd stable token) + InitialPrice types.Coin `protobuf:"bytes,4,opt,name=initial_price,json=initialPrice,proto3" json:"initial_price"` + // items defines liquidate assets + Items []types.Coin `protobuf:"bytes,5,rep,name=items,proto3" json:"items"` + // current_rate defines the rate compare with the initial price + CurrentRate string `protobuf:"bytes,6,opt,name=current_rate,json=currentRate,proto3" json:"current_rate,omitempty"` + // last_discount_time defines the last time a discount has been apply + LastDiscountTime time.Time `protobuf:"bytes,7,opt,name=last_discount_time,json=lastDiscountTime,proto3,stdtime" json:"last_discount_time"` + // status defines auction current status + Status AuctionStatus `protobuf:"varint,8,opt,name=status,proto3,enum=reserve.auction.v1.AuctionStatus" json:"status,omitempty"` + // final_bid contain the winning bid or empty if auction ended without a winner + FinalBid *Bid `protobuf:"bytes,9,opt,name=final_bid,json=finalBid,proto3" json:"final_bid,omitempty"` +} + +func (m *Auction) Reset() { *m = Auction{} } +func (m *Auction) String() string { return proto.CompactTextString(m) } +func (*Auction) ProtoMessage() {} +func (*Auction) Descriptor() ([]byte, []int) { + return fileDescriptor_8758264ed04201a2, []int{0} +} +func (m *Auction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Auction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Auction.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 *Auction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Auction.Merge(m, src) +} +func (m *Auction) XXX_Size() int { + return m.Size() +} +func (m *Auction) XXX_DiscardUnknown() { + xxx_messageInfo_Auction.DiscardUnknown(m) +} + +var xxx_messageInfo_Auction proto.InternalMessageInfo + +func (m *Auction) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *Auction) GetEndTime() time.Time { + if m != nil { + return m.EndTime + } + return time.Time{} +} + +func (m *Auction) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *Auction) GetInitialPrice() types.Coin { + if m != nil { + return m.InitialPrice + } + return types.Coin{} +} + +func (m *Auction) GetItems() []types.Coin { + if m != nil { + return m.Items + } + return nil +} + +func (m *Auction) GetCurrentRate() string { + if m != nil { + return m.CurrentRate + } + return "" +} + +func (m *Auction) GetLastDiscountTime() time.Time { + if m != nil { + return m.LastDiscountTime + } + return time.Time{} +} + +func (m *Auction) GetStatus() AuctionStatus { + if m != nil { + return m.Status + } + return AuctionStatus_AUCTION_STATUS_UNSPECIFIED +} + +func (m *Auction) GetFinalBid() *Bid { + if m != nil { + return m.FinalBid + } + return nil +} + +// Bid defines bid entry +type Bid struct { + // bidder address + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bidding amount + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` +} + +func (m *Bid) Reset() { *m = Bid{} } +func (m *Bid) String() string { return proto.CompactTextString(m) } +func (*Bid) ProtoMessage() {} +func (*Bid) Descriptor() ([]byte, []int) { + return fileDescriptor_8758264ed04201a2, []int{1} +} +func (m *Bid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bid.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 *Bid) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bid.Merge(m, src) +} +func (m *Bid) XXX_Size() int { + return m.Size() +} +func (m *Bid) XXX_DiscardUnknown() { + xxx_messageInfo_Bid.DiscardUnknown(m) +} + +var xxx_messageInfo_Bid proto.InternalMessageInfo + +func (m *Bid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *Bid) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// BidQueue defines a list of bid entries for a single auction +type BidQueue struct { + // bidder address + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // map of bid entries with bidder address + Bids map[string]*Bid `protobuf:"bytes,2,rep,name=bids,proto3" json:"bids,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *BidQueue) Reset() { *m = BidQueue{} } +func (m *BidQueue) String() string { return proto.CompactTextString(m) } +func (*BidQueue) ProtoMessage() {} +func (*BidQueue) Descriptor() ([]byte, []int) { + return fileDescriptor_8758264ed04201a2, []int{2} +} +func (m *BidQueue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BidQueue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BidQueue.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 *BidQueue) XXX_Merge(src proto.Message) { + xxx_messageInfo_BidQueue.Merge(m, src) +} +func (m *BidQueue) XXX_Size() int { + return m.Size() +} +func (m *BidQueue) XXX_DiscardUnknown() { + xxx_messageInfo_BidQueue.DiscardUnknown(m) +} + +var xxx_messageInfo_BidQueue proto.InternalMessageInfo + +func (m *BidQueue) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *BidQueue) GetBids() map[string]*Bid { + if m != nil { + return m.Bids + } + return nil +} + +func init() { + proto.RegisterEnum("reserve.auction.v1.AuctionStatus", AuctionStatus_name, AuctionStatus_value) + proto.RegisterType((*Auction)(nil), "reserve.auction.v1.Auction") + proto.RegisterType((*Bid)(nil), "reserve.auction.v1.Bid") + proto.RegisterType((*BidQueue)(nil), "reserve.auction.v1.BidQueue") + proto.RegisterMapType((map[string]*Bid)(nil), "reserve.auction.v1.BidQueue.BidsEntry") +} + +func init() { proto.RegisterFile("reserve/auction/v1/auction.proto", fileDescriptor_8758264ed04201a2) } + +var fileDescriptor_8758264ed04201a2 = []byte{ + // 688 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0x8e, 0x93, 0x34, 0x8d, 0xaf, 0x1f, 0x0a, 0xa7, 0x42, 0xdd, 0x20, 0xdc, 0xd0, 0x01, 0x45, + 0x95, 0x6a, 0x37, 0x85, 0x01, 0x2a, 0x96, 0x38, 0x49, 0x55, 0x33, 0x94, 0xe0, 0xa4, 0x80, 0x58, + 0x2c, 0xdb, 0x77, 0x0d, 0x27, 0x62, 0x5f, 0xe4, 0x3b, 0x47, 0x64, 0xe6, 0x0f, 0xf4, 0x67, 0x30, + 0x32, 0x54, 0x62, 0xe1, 0x07, 0x74, 0xac, 0x3a, 0x31, 0x01, 0x6a, 0x07, 0xfe, 0x06, 0xf2, 0xf9, + 0x52, 0x89, 0x40, 0xa5, 0x76, 0xb1, 0x5e, 0xdf, 0xfb, 0x3c, 0xcf, 0xfb, 0x71, 0x8f, 0x0e, 0xd4, + 0x62, 0xcc, 0x70, 0x3c, 0xc6, 0xa6, 0x97, 0x04, 0x9c, 0xd0, 0xc8, 0x1c, 0x37, 0xa6, 0xa1, 0x31, + 0x8a, 0x29, 0xa7, 0x10, 0x4a, 0x84, 0x31, 0x3d, 0x1e, 0x37, 0xaa, 0x77, 0xbc, 0x90, 0x44, 0xd4, + 0x14, 0xdf, 0x0c, 0x56, 0x5d, 0x19, 0xd0, 0x01, 0x15, 0xa1, 0x99, 0x46, 0xf2, 0x74, 0x2d, 0xa0, + 0x2c, 0xa4, 0xcc, 0xcd, 0x12, 0xd9, 0x8f, 0x4c, 0xad, 0x0f, 0x28, 0x1d, 0x0c, 0xb1, 0x29, 0xfe, + 0xfc, 0xe4, 0xc8, 0xe4, 0x24, 0xc4, 0x8c, 0x7b, 0xe1, 0x48, 0x02, 0xf4, 0x0c, 0x6e, 0xfa, 0x1e, + 0xc3, 0xe6, 0xb8, 0xe1, 0x63, 0xee, 0x35, 0xcc, 0x80, 0x12, 0xd9, 0xd8, 0xc6, 0xb7, 0x22, 0x98, + 0x6f, 0x66, 0x3d, 0xc1, 0x7d, 0x00, 0x18, 0xf7, 0x62, 0xee, 0xa6, 0x22, 0x9a, 0x52, 0x53, 0xea, + 0x0b, 0x3b, 0x55, 0x23, 0xab, 0x60, 0x4c, 0x2b, 0x18, 0xfd, 0x69, 0x05, 0x6b, 0xe9, 0xf4, 0xc7, + 0x7a, 0xee, 0xf8, 0xe7, 0xba, 0xf2, 0xf9, 0xf7, 0x97, 0x4d, 0xc5, 0x51, 0x05, 0x39, 0x4d, 0xc3, + 0x36, 0x28, 0xe3, 0x08, 0x65, 0x3a, 0xf9, 0xdb, 0xea, 0xcc, 0xe3, 0x08, 0x09, 0x95, 0x07, 0x00, + 0xc8, 0x75, 0xb9, 0x04, 0x69, 0x85, 0x9a, 0x52, 0x2f, 0x3a, 0xaa, 0x3c, 0xb1, 0x11, 0xb4, 0xc1, + 0x12, 0x89, 0x08, 0x27, 0xde, 0xd0, 0x1d, 0xc5, 0x24, 0xc0, 0x5a, 0x51, 0x54, 0x5a, 0x33, 0xe4, + 0x86, 0xd2, 0x91, 0x0d, 0x39, 0xb2, 0xd1, 0xa2, 0x24, 0xb2, 0xd4, 0xb4, 0x50, 0x56, 0x64, 0x51, + 0x52, 0xbb, 0x29, 0x13, 0xee, 0x82, 0x39, 0xc2, 0x71, 0xc8, 0xb4, 0xb9, 0x5a, 0xe1, 0xc6, 0x12, + 0x19, 0x05, 0x36, 0xc0, 0x62, 0x90, 0xc4, 0x31, 0x8e, 0xb8, 0x1b, 0x7b, 0x1c, 0x6b, 0xa5, 0x9a, + 0x52, 0x57, 0xad, 0xe5, 0xf3, 0x93, 0x2d, 0x20, 0x55, 0xda, 0x38, 0x70, 0x16, 0x24, 0xc6, 0xf1, + 0x38, 0x86, 0x6f, 0x00, 0x1c, 0x7a, 0x8c, 0xbb, 0x88, 0xb0, 0x80, 0x26, 0x91, 0x5c, 0xf8, 0xfc, + 0x6d, 0x17, 0x55, 0x49, 0x45, 0xda, 0x52, 0x43, 0x6c, 0xec, 0x19, 0x28, 0x31, 0xee, 0xf1, 0x84, + 0x69, 0xe5, 0x9a, 0x52, 0x5f, 0xde, 0x79, 0x68, 0xfc, 0xeb, 0x3b, 0x43, 0x5e, 0x77, 0x4f, 0x00, + 0x1d, 0x49, 0x80, 0x4f, 0x80, 0x7a, 0x44, 0x22, 0x6f, 0xe8, 0xfa, 0x04, 0x69, 0xaa, 0x68, 0x65, + 0xf5, 0x7f, 0x6c, 0x8b, 0x20, 0xa7, 0x2c, 0x90, 0x16, 0x41, 0x1b, 0x09, 0x28, 0x58, 0x04, 0xc1, + 0x6d, 0x50, 0xf2, 0x09, 0x42, 0x38, 0x16, 0xae, 0x51, 0x2d, 0xed, 0xfc, 0x64, 0x6b, 0x45, 0x4e, + 0xdf, 0x44, 0x28, 0xc6, 0x8c, 0xf5, 0x78, 0x4c, 0xa2, 0x81, 0x23, 0x71, 0xf0, 0x39, 0x28, 0x79, + 0x61, 0xda, 0xb7, 0xf4, 0xc7, 0xcd, 0x56, 0x2e, 0x39, 0x1b, 0x5f, 0x15, 0x50, 0xb6, 0x08, 0x7a, + 0x95, 0xe0, 0x64, 0xd6, 0x26, 0xca, 0xac, 0x4d, 0x76, 0x41, 0xd1, 0x27, 0x88, 0x69, 0x79, 0x71, + 0xb5, 0x8f, 0xae, 0x99, 0x49, 0x48, 0xa5, 0x01, 0xeb, 0x44, 0x3c, 0x9e, 0x38, 0x82, 0x53, 0xed, + 0x02, 0xf5, 0xea, 0x08, 0x56, 0x40, 0xe1, 0x03, 0x9e, 0x64, 0x13, 0x3a, 0x69, 0x08, 0xb7, 0xc0, + 0xdc, 0xd8, 0x1b, 0x26, 0x53, 0x8f, 0x5f, 0xbb, 0xaf, 0x0c, 0xb5, 0x9b, 0x7f, 0xaa, 0x6c, 0x7e, + 0x52, 0xc0, 0xd2, 0x5f, 0x17, 0x00, 0x75, 0x50, 0x6d, 0x1e, 0xb6, 0xfa, 0xf6, 0xcb, 0x03, 0xb7, + 0xd7, 0x6f, 0xf6, 0x0f, 0x7b, 0xee, 0xe1, 0x41, 0xaf, 0xdb, 0x69, 0xd9, 0x7b, 0x76, 0xa7, 0x5d, + 0xc9, 0xc1, 0x35, 0x70, 0x77, 0x26, 0xdf, 0x6c, 0xf5, 0xed, 0xd7, 0x9d, 0x8a, 0x02, 0xef, 0x83, + 0xd5, 0x99, 0xd4, 0x9e, 0x7d, 0x60, 0xf7, 0xf6, 0x3b, 0xed, 0x4a, 0x1e, 0x56, 0xc1, 0xbd, 0x99, + 0x64, 0xe7, 0x6d, 0xd7, 0x76, 0x3a, 0xed, 0x4a, 0xc1, 0x7a, 0x71, 0x7a, 0xa1, 0x2b, 0x67, 0x17, + 0xba, 0xf2, 0xeb, 0x42, 0x57, 0x8e, 0x2f, 0xf5, 0xdc, 0xd9, 0xa5, 0x9e, 0xfb, 0x7e, 0xa9, 0xe7, + 0xde, 0x6d, 0x0f, 0x08, 0x7f, 0x9f, 0xf8, 0x46, 0x40, 0x43, 0x93, 0x46, 0x34, 0x9c, 0x08, 0x1b, + 0x06, 0x74, 0x68, 0x4e, 0xdf, 0xb8, 0x8f, 0x57, 0xaf, 0x1c, 0x9f, 0x8c, 0x30, 0xf3, 0x4b, 0x02, + 0xf1, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x90, 0x33, 0x5a, 0x05, 0x05, 0x00, 0x00, +} + +func (m *Auction) 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 *Auction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FinalBid != nil { + { + size, err := m.FinalBid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Status != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x40 + } + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastDiscountTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastDiscountTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintAuction(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x3a + if len(m.CurrentRate) > 0 { + i -= len(m.CurrentRate) + copy(dAtA[i:], m.CurrentRate) + i = encodeVarintAuction(dAtA, i, uint64(len(m.CurrentRate))) + i-- + dAtA[i] = 0x32 + } + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + { + size, err := m.InitialPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x18 + } + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintAuction(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x12 + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintAuction(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Bid) 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 *Bid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintAuction(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BidQueue) 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 *BidQueue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BidQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bids) > 0 { + for k := range m.Bids { + v := m.Bids[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintAuction(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintAuction(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { + offset -= sovAuction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Auction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovAuction(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) + n += 1 + l + sovAuction(uint64(l)) + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + l = m.InitialPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + l = len(m.CurrentRate) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastDiscountTime) + n += 1 + l + sovAuction(uint64(l)) + if m.Status != 0 { + n += 1 + sovAuction(uint64(m.Status)) + } + if m.FinalBid != nil { + l = m.FinalBid.Size() + n += 1 + l + sovAuction(uint64(l)) + } + return n +} + +func (m *Bid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + +func (m *BidQueue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + if len(m.Bids) > 0 { + for k, v := range m.Bids { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovAuction(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovAuction(uint64(len(k))) + l + n += mapEntrySize + 1 + sovAuction(uint64(mapEntrySize)) + } + } + return n +} + +func sovAuction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuction(x uint64) (n int) { + return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Auction) 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 ErrIntOverflowAuction + } + 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: Auction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Auction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, types.Coin{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastDiscountTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastDiscountTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AuctionStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalBid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalBid == nil { + m.FinalBid = &Bid{} + } + if err := m.FinalBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bid) 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 ErrIntOverflowAuction + } + 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: Bid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bid: 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 ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + 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 Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BidQueue) 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 ErrIntOverflowAuction + } + 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: BidQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BidQueue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bids == nil { + m.Bids = make(map[string]*Bid) + } + var mapkey string + var mapvalue *Bid + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthAuction + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthAuction + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthAuction + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthAuction + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Bid{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Bids[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuction(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, ErrIntOverflowAuction + } + 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, ErrIntOverflowAuction + } + 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, ErrIntOverflowAuction + } + 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, ErrInvalidLengthAuction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auction/types/codec.go b/x/auction/types/codec.go new file mode 100644 index 0000000..5fff82e --- /dev/null +++ b/x/auction/types/codec.go @@ -0,0 +1,27 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgBid{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateBid{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/auction/types/errors.go b/x/auction/types/errors.go new file mode 100644 index 0000000..60d7929 --- /dev/null +++ b/x/auction/types/errors.go @@ -0,0 +1,15 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "cosmossdk.io/errors" +) + +// x/auction module sentinel errors +var ( + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + ErrInvalidPacketTimeout = sdkerrors.Register(ModuleName, 1500, "invalid packet timeout") + ErrInvalidVersion = sdkerrors.Register(ModuleName, 1501, "invalid version") +) diff --git a/x/auction/types/events.go b/x/auction/types/events.go new file mode 100644 index 0000000..4f1cd9a --- /dev/null +++ b/x/auction/types/events.go @@ -0,0 +1,8 @@ +package types + +const ( + EventAddBid = "submit_bid" + EventUpdateBid = "update_bid" + + AttributeKeyBidEntry = "bid_entry" +) diff --git a/x/auction/types/expected_keepers.go b/x/auction/types/expected_keepers.go new file mode 100644 index 0000000..c930b13 --- /dev/null +++ b/x/auction/types/expected_keepers.go @@ -0,0 +1,32 @@ +package types + +import ( + "context" + + addresscodec "cosmossdk.io/core/address" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// AccountKeeper defines the expected interface for the Account module. +type AccountKeeper interface { + AddressCodec() addresscodec.Codec + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI + HasAccount(ctx context.Context, addr sdk.AccAddress) bool +} + +// BankKeeper defines the expected interface for the Bank module. +type BankKeeper interface { + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error +} + +// ParamSubspace defines the expected Subspace interface for parameters. +type ParamSubspace interface { + Get(context.Context, []byte, interface{}) + Set(context.Context, []byte, interface{}) +} diff --git a/x/auction/types/genesis.go b/x/auction/types/genesis.go new file mode 100644 index 0000000..d420337 --- /dev/null +++ b/x/auction/types/genesis.go @@ -0,0 +1,22 @@ +package types + +// this line is used by starport scaffolding # genesis/types/import + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + Auctions: []*Auction{}, + BidEntries: []*Bid{}, + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + return gs.Params.Validate() +} diff --git a/x/auction/types/genesis.pb.go b/x/auction/types/genesis.pb.go new file mode 100644 index 0000000..4e1670a --- /dev/null +++ b/x/auction/types/genesis.pb.go @@ -0,0 +1,454 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: reserve/auction/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "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 auction module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // list of auctions + Auctions []*Auction `protobuf:"bytes,2,rep,name=auctions,proto3" json:"auctions,omitempty"` + // list of all bid entries + BidEntries []*Bid `protobuf:"bytes,3,rep,name=bid_entries,json=bidEntries,proto3" json:"bid_entries,omitempty"` +} + +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_3e716c21f756a4f6, []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{} +} + +func (m *GenesisState) GetAuctions() []*Auction { + if m != nil { + return m.Auctions + } + return nil +} + +func (m *GenesisState) GetBidEntries() []*Bid { + if m != nil { + return m.BidEntries + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "reserve.auction.v1.GenesisState") +} + +func init() { proto.RegisterFile("reserve/auction/v1/genesis.proto", fileDescriptor_3e716c21f756a4f6) } + +var fileDescriptor_3e716c21f756a4f6 = []byte{ + // 283 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0x4a, 0x2d, 0x4e, + 0x2d, 0x2a, 0x4b, 0xd5, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x4f, + 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xaa, + 0xd0, 0x83, 0xaa, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, + 0x10, 0x65, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0xc7, + 0x62, 0x7c, 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x74, 0x29, 0x6c, 0xf6, 0xc3, 0x2c, 0x02, 0xab, + 0x50, 0x3a, 0xc0, 0xc8, 0xc5, 0xe3, 0x0e, 0x71, 0x51, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x2d, + 0x17, 0x1b, 0xc4, 0x08, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x29, 0x3d, 0x4c, 0x17, 0xea, + 0x05, 0x80, 0x55, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, 0xc6, 0x20, + 0xa8, 0x26, 0x21, 0x73, 0x2e, 0x0e, 0xa8, 0xba, 0x62, 0x09, 0x26, 0x05, 0x66, 0x0d, 0x6e, 0x23, + 0x69, 0x6c, 0x06, 0x38, 0x42, 0x98, 0x41, 0x70, 0xc5, 0x42, 0x16, 0x5c, 0xdc, 0x49, 0x99, 0x29, + 0xf1, 0xa9, 0x79, 0x25, 0x45, 0x99, 0xa9, 0xc5, 0x12, 0xcc, 0x60, 0xbd, 0xe2, 0xd8, 0xf4, 0x3a, + 0x65, 0xa6, 0x04, 0x71, 0x25, 0x65, 0xa6, 0xb8, 0x42, 0x94, 0x3a, 0x79, 0x9d, 0x78, 0x24, 0xc7, + 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, + 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, + 0x7e, 0xae, 0x7e, 0x7e, 0x5e, 0x7e, 0x6e, 0x25, 0xd8, 0xcf, 0xc9, 0xf9, 0x39, 0xfa, 0xb0, 0x70, + 0xa9, 0x80, 0x87, 0x4c, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0x85, 0x31, 0x20, 0x00, + 0x00, 0xff, 0xff, 0x11, 0x7f, 0x93, 0xbb, 0xb9, 0x01, 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 + if len(m.BidEntries) > 0 { + for iNdEx := len(m.BidEntries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BidEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + 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 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)) + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.BidEntries) > 0 { + for _, e := range m.BidEntries { + l = e.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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", 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 + } + m.Auctions = append(m.Auctions, &Auction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidEntries", 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 + } + m.BidEntries = append(m.BidEntries, &Bid{}) + if err := m.BidEntries[len(m.BidEntries)-1].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/auction/types/genesis_test.go b/x/auction/types/genesis_test.go new file mode 100644 index 0000000..766c333 --- /dev/null +++ b/x/auction/types/genesis_test.go @@ -0,0 +1,32 @@ +package types_test + +import ( + "testing" + + "github.com/onomyprotocol/reserve/x/auction/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + tests := []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/auction/types/keys.go b/x/auction/types/keys.go new file mode 100644 index 0000000..f55a6ab --- /dev/null +++ b/x/auction/types/keys.go @@ -0,0 +1,28 @@ +package types + +import "cosmossdk.io/collections" + +const ( + // ModuleName defines the module name + ModuleName = "auction" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_auction" +) + +var ( + ParamsKey = []byte("p_auction") +) + +var ( + AuctionsPrefix = collections.NewPrefix(1) + BidsPrefix = collections.NewPrefix(2) + BidByAddressPrefix = collections.NewPrefix(3) +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/auction/types/msg_update_params.go b/x/auction/types/msg_update_params.go new file mode 100644 index 0000000..e36d023 --- /dev/null +++ b/x/auction/types/msg_update_params.go @@ -0,0 +1,21 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + if err := m.Params.Validate(); err != nil { + return err + } + + return nil +} diff --git a/x/auction/types/params.go b/x/auction/types/params.go new file mode 100644 index 0000000..4f3215e --- /dev/null +++ b/x/auction/types/params.go @@ -0,0 +1,32 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} diff --git a/x/auction/types/params.pb.go b/x/auction/types/params.pb.go new file mode 100644 index 0000000..933c488 --- /dev/null +++ b/x/auction/types/params.pb.go @@ -0,0 +1,640 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: reserve/auction/v1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// Params defines the parameters for the module. +type Params struct { + // defines how long (either in blocktime or blockheight) + // between each auction + AuctionPeriods time.Duration `protobuf:"bytes,1,opt,name=auction_periods,json=auctionPeriods,proto3,stdduration" json:"auction_periods"` + // defines how long the auction will takes + AuctionDurations time.Duration `protobuf:"bytes,2,opt,name=auction_durations,json=auctionDurations,proto3,stdduration" json:"auction_durations"` + // duration between each price reduction + ReduceStep time.Duration `protobuf:"bytes,3,opt,name=reduce_step,json=reduceStep,proto3,stdduration" json:"reduce_step"` + // rate compared with the collaterals price from the + // oracle at which the auction will start with + StartingRate string `protobuf:"bytes,4,opt,name=starting_rate,json=startingRate,proto3" json:"starting_rate,omitempty"` + // rate compared with the initial price that the price + // can drop to + LowestRate string `protobuf:"bytes,5,opt,name=lowest_rate,json=lowestRate,proto3" json:"lowest_rate,omitempty"` + // rate that are decrease every reduce_step + DiscountRate string `protobuf:"bytes,6,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` +} + +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_7e77e58d36f40199, []int{0} +} +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) GetAuctionPeriods() time.Duration { + if m != nil { + return m.AuctionPeriods + } + return 0 +} + +func (m *Params) GetAuctionDurations() time.Duration { + if m != nil { + return m.AuctionDurations + } + return 0 +} + +func (m *Params) GetReduceStep() time.Duration { + if m != nil { + return m.ReduceStep + } + return 0 +} + +func (m *Params) GetStartingRate() string { + if m != nil { + return m.StartingRate + } + return "" +} + +func (m *Params) GetLowestRate() string { + if m != nil { + return m.LowestRate + } + return "" +} + +func (m *Params) GetDiscountRate() string { + if m != nil { + return m.DiscountRate + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "reserve.auction.v1.Params") +} + +func init() { proto.RegisterFile("reserve/auction/v1/params.proto", fileDescriptor_7e77e58d36f40199) } + +var fileDescriptor_7e77e58d36f40199 = []byte{ + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x6f, 0xda, 0x40, + 0x14, 0xc7, 0x7d, 0xa5, 0x45, 0xea, 0x51, 0x68, 0xb1, 0x3a, 0x18, 0x06, 0x9b, 0x76, 0x42, 0x48, + 0xf5, 0x95, 0xb2, 0x75, 0x44, 0x2c, 0xed, 0x44, 0xa9, 0xba, 0x74, 0xb1, 0x0e, 0xfb, 0xea, 0x5a, + 0xc2, 0x7e, 0xd6, 0xdd, 0x99, 0x96, 0xaf, 0x90, 0x29, 0x63, 0xc6, 0x8c, 0x19, 0x19, 0xb2, 0xe5, + 0x0b, 0x30, 0xa2, 0x4c, 0x99, 0x92, 0x08, 0x06, 0xf2, 0x31, 0x22, 0xee, 0xce, 0x59, 0xc2, 0xc2, + 0x62, 0xdd, 0xbd, 0xf7, 0xff, 0xff, 0xfe, 0xd6, 0xbb, 0x87, 0x3d, 0xce, 0x04, 0xe3, 0x73, 0x46, + 0x68, 0x11, 0xca, 0x04, 0x32, 0x32, 0xef, 0x93, 0x9c, 0x72, 0x9a, 0x0a, 0x3f, 0xe7, 0x20, 0xc1, + 0xb6, 0x8d, 0xc0, 0x37, 0x02, 0x7f, 0xde, 0x6f, 0x37, 0x69, 0x9a, 0x64, 0x40, 0xd4, 0x57, 0xcb, + 0xda, 0xef, 0x63, 0x88, 0x41, 0x1d, 0xc9, 0xfe, 0x64, 0xaa, 0xad, 0x10, 0x44, 0x0a, 0x22, 0xd0, + 0x0d, 0x7d, 0x31, 0x2d, 0x37, 0x06, 0x88, 0x67, 0x8c, 0xa8, 0xdb, 0xb4, 0xf8, 0x43, 0xa2, 0x82, + 0x53, 0x15, 0xa0, 0x2a, 0x1f, 0xaf, 0x2a, 0xb8, 0x3a, 0x56, 0x3f, 0x62, 0xff, 0xc0, 0x6f, 0x4d, + 0x78, 0x90, 0x33, 0x9e, 0x40, 0x24, 0x1c, 0xd4, 0x41, 0xdd, 0xda, 0x97, 0x96, 0xaf, 0x21, 0x7e, + 0x09, 0xf1, 0x47, 0x06, 0x32, 0xac, 0xaf, 0x6e, 0x3d, 0xeb, 0xec, 0xce, 0x43, 0x17, 0xbb, 0x65, + 0x0f, 0x4d, 0x1a, 0x06, 0x30, 0xd6, 0x7e, 0xfb, 0x17, 0x6e, 0x96, 0xc8, 0x32, 0x57, 0x38, 0x2f, + 0x8e, 0x84, 0xbe, 0x33, 0x88, 0xb2, 0x2f, 0xec, 0x6f, 0xb8, 0xc6, 0x59, 0x54, 0x84, 0x2c, 0x10, + 0x92, 0xe5, 0x4e, 0xe5, 0x48, 0x20, 0xd6, 0xe6, 0x9f, 0x92, 0xe5, 0xf6, 0x00, 0xd7, 0x85, 0xa4, + 0x5c, 0x26, 0x59, 0x1c, 0x70, 0x2a, 0x99, 0xf3, 0xb2, 0x83, 0xba, 0xaf, 0x87, 0x8d, 0xeb, 0xcb, + 0x4f, 0xd8, 0x0c, 0x72, 0xc4, 0xc2, 0xc9, 0x9b, 0x52, 0x34, 0xa1, 0x92, 0xd9, 0x04, 0xd7, 0x66, + 0xf0, 0x8f, 0x09, 0xa9, 0x2d, 0xaf, 0x0e, 0x5a, 0xb0, 0x96, 0x28, 0xc3, 0x00, 0xd7, 0xa3, 0x44, + 0x84, 0x50, 0x64, 0xc6, 0x52, 0x3d, 0x9c, 0x52, 0x8a, 0xf6, 0xa6, 0xaf, 0x1f, 0x1e, 0xce, 0x3d, + 0x74, 0xb2, 0x5b, 0xf6, 0x9c, 0x72, 0x79, 0xfe, 0x3f, 0xad, 0x8f, 0x7e, 0xb2, 0xe1, 0xf7, 0xd5, + 0xc6, 0x45, 0xeb, 0x8d, 0x8b, 0xee, 0x37, 0x2e, 0x3a, 0xdd, 0xba, 0xd6, 0x7a, 0xeb, 0x5a, 0x37, + 0x5b, 0xd7, 0xfa, 0xfd, 0x39, 0x4e, 0xe4, 0xdf, 0x62, 0xea, 0x87, 0x90, 0x12, 0xc8, 0x20, 0x5d, + 0xa8, 0xa9, 0x84, 0x30, 0x23, 0xcf, 0x61, 0x72, 0x91, 0x33, 0x31, 0xad, 0x2a, 0xc5, 0xe0, 0x31, + 0x00, 0x00, 0xff, 0xff, 0x68, 0x16, 0xbb, 0xfb, 0xab, 0x02, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.AuctionPeriods != that1.AuctionPeriods { + return false + } + if this.AuctionDurations != that1.AuctionDurations { + return false + } + if this.ReduceStep != that1.ReduceStep { + return false + } + if this.StartingRate != that1.StartingRate { + return false + } + if this.LowestRate != that1.LowestRate { + return false + } + if this.DiscountRate != that1.DiscountRate { + return false + } + return true +} +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 + if len(m.DiscountRate) > 0 { + i -= len(m.DiscountRate) + copy(dAtA[i:], m.DiscountRate) + i = encodeVarintParams(dAtA, i, uint64(len(m.DiscountRate))) + i-- + dAtA[i] = 0x32 + } + if len(m.LowestRate) > 0 { + i -= len(m.LowestRate) + copy(dAtA[i:], m.LowestRate) + i = encodeVarintParams(dAtA, i, uint64(len(m.LowestRate))) + i-- + dAtA[i] = 0x2a + } + if len(m.StartingRate) > 0 { + i -= len(m.StartingRate) + copy(dAtA[i:], m.StartingRate) + i = encodeVarintParams(dAtA, i, uint64(len(m.StartingRate))) + i-- + dAtA[i] = 0x22 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.ReduceStep, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ReduceStep):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintParams(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.AuctionDurations, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionDurations):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintParams(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.AuctionPeriods, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionPeriods):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintParams(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionPeriods) + n += 1 + l + sovParams(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionDurations) + n += 1 + l + sovParams(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ReduceStep) + n += 1 + l + sovParams(uint64(l)) + l = len(m.StartingRate) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = len(m.LowestRate) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = len(m.DiscountRate) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowParams + } + 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.AuctionPeriods, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.AuctionDurations, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReduceStep", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.ReduceStep, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartingRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartingRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LowestRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LowestRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DiscountRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DiscountRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auction/types/query.pb.go b/x/auction/types/query.pb.go new file mode 100644 index 0000000..fc13944 --- /dev/null +++ b/x/auction/types/query.pb.go @@ -0,0 +1,539 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: reserve/oracle/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5be66edb02a359da, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5be66edb02a359da, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "reserve.oracle.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "reserve.oracle.QueryParamsResponse") +} + +func init() { proto.RegisterFile("reserve/oracle/query.proto", fileDescriptor_5be66edb02a359da) } + +var fileDescriptor_5be66edb02a359da = []byte{ + // 315 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc7, 0x13, 0xc1, 0x82, 0x11, 0x04, 0x63, 0x29, 0x25, 0xca, 0x29, 0x71, 0x91, 0x0e, 0x79, + 0xb4, 0x4e, 0xae, 0xdd, 0xdc, 0x6a, 0x47, 0xb7, 0x4b, 0x38, 0xce, 0x40, 0x73, 0xef, 0x7a, 0x77, + 0x2d, 0xd6, 0xd1, 0x4f, 0x20, 0xf8, 0x25, 0x1c, 0xfd, 0x18, 0x1d, 0x0b, 0x2e, 0x4e, 0x22, 0x8d, + 0xe0, 0xd7, 0x90, 0xde, 0x9d, 0x42, 0xab, 0xb8, 0x84, 0xc7, 0xfb, 0xff, 0xfe, 0xff, 0xfc, 0xdf, + 0x45, 0x89, 0x62, 0x9a, 0xa9, 0x29, 0x03, 0x54, 0xb4, 0x18, 0x31, 0x18, 0x4f, 0x98, 0x9a, 0x65, + 0x52, 0xa1, 0xc1, 0x78, 0xcf, 0x6b, 0x99, 0xd3, 0x92, 0x7d, 0x5a, 0x95, 0x02, 0xc1, 0x7e, 0x1d, + 0x92, 0x34, 0x39, 0x72, 0xb4, 0x23, 0xac, 0x26, 0xbf, 0x3d, 0xe2, 0x88, 0x7c, 0xc4, 0x80, 0xca, + 0x12, 0xa8, 0x10, 0x68, 0xa8, 0x29, 0x51, 0x68, 0xaf, 0x76, 0x0a, 0xd4, 0x15, 0x6a, 0xc8, 0xa9, + 0xf6, 0xff, 0x83, 0x69, 0x37, 0x67, 0x86, 0x76, 0x41, 0x52, 0x5e, 0x0a, 0x0b, 0x7b, 0xf6, 0x70, + 0xa3, 0x9e, 0xa4, 0x8a, 0x56, 0x3e, 0x28, 0x6d, 0x46, 0xf1, 0xd5, 0xca, 0x3e, 0xb0, 0xcb, 0x21, + 0x1b, 0x4f, 0x98, 0x36, 0xe9, 0x20, 0x3a, 0x58, 0xdb, 0x6a, 0x89, 0x42, 0xb3, 0xf8, 0x22, 0x6a, + 0x38, 0x73, 0x3b, 0x3c, 0x09, 0xcf, 0x76, 0x7b, 0xad, 0x6c, 0xfd, 0xba, 0xcc, 0xf1, 0xfd, 0x9d, + 0xf9, 0xdb, 0x71, 0xf0, 0xf4, 0xf9, 0xdc, 0x09, 0x87, 0xde, 0xd0, 0xbb, 0x8b, 0xb6, 0x6d, 0x62, + 0x3c, 0x8e, 0x1a, 0x8e, 0x8a, 0xd3, 0x4d, 0xf7, 0xef, 0x22, 0xc9, 0xe9, 0xbf, 0x8c, 0xab, 0x95, + 0x92, 0xfb, 0x97, 0x8f, 0xc7, 0xad, 0x76, 0xdc, 0x82, 0x3f, 0x2f, 0xed, 0x5f, 0xce, 0x97, 0x24, + 0x5c, 0x2c, 0x49, 0xf8, 0xbe, 0x24, 0xe1, 0x43, 0x4d, 0x82, 0x45, 0x4d, 0x82, 0xd7, 0x9a, 0x04, + 0xd7, 0xc0, 0x4b, 0x73, 0x33, 0xc9, 0xb3, 0x02, 0x2b, 0x40, 0x81, 0xd5, 0xcc, 0x3e, 0x4a, 0x81, + 0xa3, 0x9f, 0xa4, 0xdb, 0xef, 0x2c, 0x33, 0x93, 0x4c, 0xe7, 0x0d, 0x0b, 0x9c, 0x7f, 0x05, 0x00, + 0x00, 0xff, 0xff, 0xa8, 0x9f, 0x5c, 0x1f, 0xf3, 0x01, 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 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/reserve.oracle.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.oracle.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "reserve.oracle.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "reserve/oracle/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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 ErrIntOverflowQuery + } + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) 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 ErrIntOverflowQuery + } + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + 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 := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auction/types/query.pb.gw.go b/x/auction/types/query.pb.gw.go new file mode 100644 index 0000000..94c4c60 --- /dev/null +++ b/x/auction/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: reserve/oracle/query.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 + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer 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 RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Query_Params_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_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(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 RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"reserve", "oracle", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/auction/types/tx.pb.go b/x/auction/types/tx.pb.go new file mode 100644 index 0000000..9b9de54 --- /dev/null +++ b/x/auction/types/tx.pb.go @@ -0,0 +1,1454 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: reserve/auction/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" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + 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_18d11acb13497546, []int{0} +} +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 response structure for executing a +// MsgUpdateParams message. +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_18d11acb13497546, []int{1} +} +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 + +// MsgBid is the Msg/Bid request type. +type MsgBid struct { + // bidder is the address that submitting the bid entry. + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bidding auction id + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // amount defines the amount that the bidder willing to pay. + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgBid) Reset() { *m = MsgBid{} } +func (m *MsgBid) String() string { return proto.CompactTextString(m) } +func (*MsgBid) ProtoMessage() {} +func (*MsgBid) Descriptor() ([]byte, []int) { + return fileDescriptor_18d11acb13497546, []int{2} +} +func (m *MsgBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBid.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 *MsgBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBid.Merge(m, src) +} +func (m *MsgBid) XXX_Size() int { + return m.Size() +} +func (m *MsgBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBid.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBid proto.InternalMessageInfo + +func (m *MsgBid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *MsgBid) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *MsgBid) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// MsgBidResponse defines the response structure for executing a +// MsgBid message. +type MsgBidResponse struct { +} + +func (m *MsgBidResponse) Reset() { *m = MsgBidResponse{} } +func (m *MsgBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBidResponse) ProtoMessage() {} +func (*MsgBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_18d11acb13497546, []int{3} +} +func (m *MsgBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBidResponse.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 *MsgBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBidResponse.Merge(m, src) +} +func (m *MsgBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBidResponse proto.InternalMessageInfo + +// MsgUpdateBid is the Msg/UpdateBid request type. +type MsgUpdateBid struct { + // bidder is the address that submitting the bid entry. + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bidding auction id + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // amount defines the amount that the bidder willing to pay. + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgUpdateBid) Reset() { *m = MsgUpdateBid{} } +func (m *MsgUpdateBid) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBid) ProtoMessage() {} +func (*MsgUpdateBid) Descriptor() ([]byte, []int) { + return fileDescriptor_18d11acb13497546, []int{4} +} +func (m *MsgUpdateBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBid.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 *MsgUpdateBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBid.Merge(m, src) +} +func (m *MsgUpdateBid) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBid.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBid proto.InternalMessageInfo + +func (m *MsgUpdateBid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *MsgUpdateBid) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *MsgUpdateBid) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// MsgUpdateBidResponse defines the response structure for executing a +// MsgUpdateBid message. +type MsgUpdateBidResponse struct { +} + +func (m *MsgUpdateBidResponse) Reset() { *m = MsgUpdateBidResponse{} } +func (m *MsgUpdateBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBidResponse) ProtoMessage() {} +func (*MsgUpdateBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_18d11acb13497546, []int{5} +} +func (m *MsgUpdateBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBidResponse.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 *MsgUpdateBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBidResponse.Merge(m, src) +} +func (m *MsgUpdateBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBidResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "reserve.auction.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "reserve.auction.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgBid)(nil), "reserve.auction.v1.MsgBid") + proto.RegisterType((*MsgBidResponse)(nil), "reserve.auction.v1.MsgBidResponse") + proto.RegisterType((*MsgUpdateBid)(nil), "reserve.auction.v1.MsgUpdateBid") + proto.RegisterType((*MsgUpdateBidResponse)(nil), "reserve.auction.v1.MsgUpdateBidResponse") +} + +func init() { proto.RegisterFile("reserve/auction/v1/tx.proto", fileDescriptor_18d11acb13497546) } + +var fileDescriptor_18d11acb13497546 = []byte{ + // 535 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x93, 0xbf, 0x8b, 0x13, 0x41, + 0x14, 0xc7, 0x33, 0x17, 0x0d, 0x64, 0x3c, 0xfc, 0xb1, 0x04, 0x93, 0xac, 0xdc, 0x5e, 0x58, 0x0b, + 0x43, 0xe4, 0x76, 0x2e, 0x77, 0x60, 0x71, 0x68, 0xe1, 0x8a, 0x85, 0x42, 0x40, 0x22, 0x22, 0xd8, + 0x9c, 0xb3, 0x3b, 0xc3, 0xde, 0xc0, 0xed, 0xce, 0x32, 0x33, 0x09, 0x97, 0x4e, 0x2c, 0x2d, 0xc4, + 0x3f, 0xc3, 0x32, 0x85, 0xad, 0x60, 0x79, 0x85, 0xc5, 0x61, 0x65, 0x25, 0x92, 0x14, 0xf9, 0x37, + 0x64, 0x76, 0x67, 0x13, 0x2f, 0x26, 0x9e, 0xa5, 0xcd, 0x32, 0x33, 0xdf, 0x37, 0xdf, 0xf7, 0x3e, + 0xef, 0xcd, 0xc2, 0x5b, 0x82, 0x4a, 0x2a, 0x86, 0x14, 0xe1, 0x41, 0xa8, 0x18, 0x4f, 0xd0, 0xb0, + 0x8b, 0xd4, 0x89, 0x97, 0x0a, 0xae, 0xb8, 0x65, 0x19, 0xd1, 0x33, 0xa2, 0x37, 0xec, 0xda, 0x37, + 0x70, 0xcc, 0x12, 0x8e, 0xb2, 0x6f, 0x1e, 0x66, 0xd7, 0x22, 0x1e, 0xf1, 0x6c, 0x89, 0xf4, 0xca, + 0x9c, 0x36, 0x43, 0x2e, 0x63, 0x2e, 0x0f, 0x73, 0x21, 0xdf, 0x18, 0xa9, 0x9e, 0xef, 0x50, 0x2c, + 0x23, 0x9d, 0x2f, 0x96, 0x91, 0x11, 0x1c, 0x23, 0x04, 0x58, 0x52, 0x34, 0xec, 0x06, 0x54, 0xe1, + 0x2e, 0x0a, 0x39, 0x4b, 0x8c, 0xbe, 0xbd, 0xa2, 0xda, 0x14, 0x0b, 0x1c, 0x1b, 0x67, 0xf7, 0x33, + 0x80, 0xd7, 0x7a, 0x32, 0x7a, 0x91, 0x12, 0xac, 0xe8, 0xb3, 0x4c, 0xb1, 0xee, 0xc1, 0x2a, 0x1e, + 0xa8, 0x23, 0x2e, 0x98, 0x1a, 0x35, 0x40, 0x0b, 0xb4, 0xab, 0x7e, 0xe3, 0xdb, 0xa7, 0x9d, 0x9a, + 0x29, 0xe9, 0x21, 0x21, 0x82, 0x4a, 0xf9, 0x5c, 0x09, 0x96, 0x44, 0xfd, 0x45, 0xa8, 0xf5, 0x00, + 0x56, 0x72, 0xef, 0xc6, 0x46, 0x0b, 0xb4, 0xaf, 0xec, 0xd9, 0xde, 0x9f, 0xed, 0xf0, 0xf2, 0x1c, + 0x7e, 0xf5, 0xf4, 0xc7, 0x76, 0xe9, 0xe3, 0x6c, 0xdc, 0x01, 0x7d, 0x73, 0xe9, 0x60, 0xff, 0xed, + 0x6c, 0xdc, 0x59, 0xd8, 0xbd, 0x9b, 0x8d, 0x3b, 0xad, 0xa2, 0xfc, 0x13, 0xc4, 0x05, 0x0e, 0x8f, + 0x29, 0x5a, 0xaa, 0xd5, 0x6d, 0xc2, 0xfa, 0xd2, 0x51, 0x9f, 0xca, 0x94, 0x27, 0x92, 0xba, 0x5f, + 0x00, 0xac, 0xf4, 0x64, 0xe4, 0x33, 0x62, 0xed, 0xc2, 0x4a, 0xc0, 0x08, 0xa1, 0xe2, 0x42, 0x1c, + 0x13, 0x67, 0x6d, 0x41, 0x68, 0x8a, 0x3e, 0x64, 0x24, 0xe3, 0xb9, 0xa4, 0x51, 0xb3, 0x93, 0x27, + 0xc4, 0xba, 0x0f, 0x2b, 0x38, 0xe6, 0x83, 0x44, 0x35, 0xca, 0x19, 0x6a, 0xd3, 0x33, 0x6e, 0x7a, + 0x10, 0x9e, 0x19, 0x84, 0xf7, 0x88, 0xb3, 0xe4, 0x1c, 0x69, 0x7e, 0xe7, 0xe0, 0x8e, 0x26, 0x35, + 0x99, 0x34, 0x66, 0x7d, 0x15, 0xa6, 0xcf, 0x88, 0x7b, 0x1d, 0x5e, 0xcd, 0x57, 0x73, 0xa8, 0xaf, + 0x00, 0x6e, 0xce, 0x81, 0xff, 0x43, 0xb4, 0x9d, 0x25, 0xb4, 0xad, 0xf5, 0x13, 0xd4, 0x80, 0x37, + 0x61, 0xed, 0xf7, 0x7d, 0x81, 0xb9, 0xf7, 0x7e, 0x03, 0x96, 0x7b, 0x32, 0xb2, 0x5e, 0xc3, 0xcd, + 0x73, 0x4f, 0xf3, 0xf6, 0xaa, 0x27, 0xb5, 0xf4, 0x00, 0xec, 0xbb, 0xff, 0x10, 0x54, 0x64, 0xb2, + 0x1e, 0xc3, 0xb2, 0x6e, 0xa3, 0xbd, 0xe6, 0x8e, 0xcf, 0x88, 0xed, 0xae, 0xd7, 0xe6, 0x36, 0x2f, + 0x61, 0x75, 0x31, 0x93, 0xd6, 0x5f, 0x0b, 0xd0, 0x96, 0xed, 0x8b, 0x22, 0x0a, 0x63, 0xfb, 0xf2, + 0x1b, 0xdd, 0x5f, 0xff, 0xe9, 0xe9, 0xc4, 0x01, 0x67, 0x13, 0x07, 0xfc, 0x9c, 0x38, 0xe0, 0xc3, + 0xd4, 0x29, 0x9d, 0x4d, 0x9d, 0xd2, 0xf7, 0xa9, 0x53, 0x7a, 0xb5, 0x1b, 0x31, 0x75, 0x34, 0x08, + 0xbc, 0x90, 0xc7, 0x88, 0x27, 0x3c, 0x1e, 0x65, 0x3f, 0x76, 0xc8, 0x8f, 0xd1, 0xa2, 0xf5, 0xc5, + 0xdf, 0xaf, 0x46, 0x29, 0x95, 0x41, 0x25, 0x8b, 0xd8, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0x1b, + 0x37, 0xe7, 0x3a, 0xcb, 0x04, 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 { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // Bid defines an operation for submit a bid entry. + Bid(ctx context.Context, in *MsgBid, opts ...grpc.CallOption) (*MsgBidResponse, error) + // UpdateBid defines an operation for update an existing bid entry. + UpdateBid(ctx context.Context, in *MsgUpdateBid, opts ...grpc.CallOption) (*MsgUpdateBidResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/reserve.auction.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Bid(ctx context.Context, in *MsgBid, opts ...grpc.CallOption) (*MsgBidResponse, error) { + out := new(MsgBidResponse) + err := c.cc.Invoke(ctx, "/reserve.auction.v1.Msg/Bid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateBid(ctx context.Context, in *MsgUpdateBid, opts ...grpc.CallOption) (*MsgUpdateBidResponse, error) { + out := new(MsgUpdateBidResponse) + err := c.cc.Invoke(ctx, "/reserve.auction.v1.Msg/UpdateBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // Bid defines an operation for submit a bid entry. + Bid(context.Context, *MsgBid) (*MsgBidResponse, error) + // UpdateBid defines an operation for update an existing bid entry. + UpdateBid(context.Context, *MsgUpdateBid) (*MsgUpdateBidResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) Bid(ctx context.Context, req *MsgBid) (*MsgBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Bid not implemented") +} +func (*UnimplementedMsgServer) UpdateBid(ctx context.Context, req *MsgUpdateBid) (*MsgUpdateBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBid not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +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: "/reserve.auction.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) +} + +func _Msg_Bid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Bid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.auction.v1.Msg/Bid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Bid(ctx, req.(*MsgBid)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.auction.v1.Msg/UpdateBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateBid(ctx, req.(*MsgUpdateBid)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "reserve.auction.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Bid", + Handler: _Msg_Bid_Handler, + }, + { + MethodName: "UpdateBid", + Handler: _Msg_UpdateBid_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "reserve/auction/v1/tx.proto", +} + +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 (m *MsgBid) 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 *MsgBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x10 + } + 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 *MsgBidResponse) 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 *MsgBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateBid) 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 *MsgUpdateBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x10 + } + 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 *MsgUpdateBidResponse) 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 *MsgUpdateBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBidResponse) 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 *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 (m *MsgBid) 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)) + } + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateBid) 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)) + } + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateBidResponse) 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 *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 (m *MsgBid) 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: MsgBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBid: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount.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 *MsgBidResponse) 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: MsgBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBidResponse: 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 *MsgUpdateBid) 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: MsgUpdateBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBid: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount.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 *MsgUpdateBidResponse) 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: MsgUpdateBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBidResponse: 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/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index fc13944..84d82a4 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -6,7 +6,6 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -122,27 +121,25 @@ func init() { func init() { proto.RegisterFile("reserve/oracle/query.proto", fileDescriptor_5be66edb02a359da) } var fileDescriptor_5be66edb02a359da = []byte{ - // 315 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0xc7, 0x13, 0xc1, 0x82, 0x11, 0x04, 0x63, 0x29, 0x25, 0xca, 0x29, 0x71, 0x91, 0x0e, 0x79, - 0xb4, 0x4e, 0xae, 0xdd, 0xdc, 0x6a, 0x47, 0xb7, 0x4b, 0x38, 0xce, 0x40, 0x73, 0xef, 0x7a, 0x77, - 0x2d, 0xd6, 0xd1, 0x4f, 0x20, 0xf8, 0x25, 0x1c, 0xfd, 0x18, 0x1d, 0x0b, 0x2e, 0x4e, 0x22, 0x8d, - 0xe0, 0xd7, 0x90, 0xde, 0x9d, 0x42, 0xab, 0xb8, 0x84, 0xc7, 0xfb, 0xff, 0xfe, 0xff, 0xfc, 0xdf, - 0x45, 0x89, 0x62, 0x9a, 0xa9, 0x29, 0x03, 0x54, 0xb4, 0x18, 0x31, 0x18, 0x4f, 0x98, 0x9a, 0x65, - 0x52, 0xa1, 0xc1, 0x78, 0xcf, 0x6b, 0x99, 0xd3, 0x92, 0x7d, 0x5a, 0x95, 0x02, 0xc1, 0x7e, 0x1d, - 0x92, 0x34, 0x39, 0x72, 0xb4, 0x23, 0xac, 0x26, 0xbf, 0x3d, 0xe2, 0x88, 0x7c, 0xc4, 0x80, 0xca, - 0x12, 0xa8, 0x10, 0x68, 0xa8, 0x29, 0x51, 0x68, 0xaf, 0x76, 0x0a, 0xd4, 0x15, 0x6a, 0xc8, 0xa9, - 0xf6, 0xff, 0x83, 0x69, 0x37, 0x67, 0x86, 0x76, 0x41, 0x52, 0x5e, 0x0a, 0x0b, 0x7b, 0xf6, 0x70, - 0xa3, 0x9e, 0xa4, 0x8a, 0x56, 0x3e, 0x28, 0x6d, 0x46, 0xf1, 0xd5, 0xca, 0x3e, 0xb0, 0xcb, 0x21, - 0x1b, 0x4f, 0x98, 0x36, 0xe9, 0x20, 0x3a, 0x58, 0xdb, 0x6a, 0x89, 0x42, 0xb3, 0xf8, 0x22, 0x6a, - 0x38, 0x73, 0x3b, 0x3c, 0x09, 0xcf, 0x76, 0x7b, 0xad, 0x6c, 0xfd, 0xba, 0xcc, 0xf1, 0xfd, 0x9d, - 0xf9, 0xdb, 0x71, 0xf0, 0xf4, 0xf9, 0xdc, 0x09, 0x87, 0xde, 0xd0, 0xbb, 0x8b, 0xb6, 0x6d, 0x62, - 0x3c, 0x8e, 0x1a, 0x8e, 0x8a, 0xd3, 0x4d, 0xf7, 0xef, 0x22, 0xc9, 0xe9, 0xbf, 0x8c, 0xab, 0x95, - 0x92, 0xfb, 0x97, 0x8f, 0xc7, 0xad, 0x76, 0xdc, 0x82, 0x3f, 0x2f, 0xed, 0x5f, 0xce, 0x97, 0x24, - 0x5c, 0x2c, 0x49, 0xf8, 0xbe, 0x24, 0xe1, 0x43, 0x4d, 0x82, 0x45, 0x4d, 0x82, 0xd7, 0x9a, 0x04, - 0xd7, 0xc0, 0x4b, 0x73, 0x33, 0xc9, 0xb3, 0x02, 0x2b, 0x40, 0x81, 0xd5, 0xcc, 0x3e, 0x4a, 0x81, - 0xa3, 0x9f, 0xa4, 0xdb, 0xef, 0x2c, 0x33, 0x93, 0x4c, 0xe7, 0x0d, 0x0b, 0x9c, 0x7f, 0x05, 0x00, - 0x00, 0xff, 0xff, 0xa8, 0x9f, 0x5c, 0x1f, 0xf3, 0x01, 0x00, 0x00, + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x4a, 0x2d, 0x4e, + 0x2d, 0x2a, 0x4b, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, + 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xe9, 0x41, 0xe4, 0xa4, 0x04, 0x13, + 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x89, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, + 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x13, 0x0b, 0x32, + 0xf5, 0x13, 0xf3, 0xf2, 0xf2, 0x4b, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x8a, 0xa1, 0xb2, 0xd2, 0x68, + 0x56, 0x16, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x25, 0x95, 0x44, 0xb8, 0x84, 0x02, 0x41, 0x4e, 0x08, + 0x00, 0x0b, 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0x05, 0x70, 0x09, 0xa3, 0x88, 0x16, + 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x59, 0x72, 0xb1, 0x41, 0x34, 0x4b, 0x30, 0x2a, 0x30, 0x6a, + 0x70, 0x1b, 0x89, 0xe9, 0xa1, 0xba, 0x58, 0x0f, 0xa2, 0xde, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, + 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0x35, 0x18, 0x55, 0x71, 0xb1, 0x82, 0x4d, 0x14, 0x2a, + 0xe4, 0x62, 0x83, 0xa8, 0x12, 0x52, 0x42, 0xd7, 0x8d, 0xe9, 0x10, 0x29, 0x65, 0xbc, 0x6a, 0x20, + 0xce, 0x52, 0x92, 0x6b, 0xba, 0xfc, 0x64, 0x32, 0x93, 0x84, 0x90, 0x98, 0x3e, 0x56, 0x9f, 0x3a, + 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7e, 0x5e, 0x7e, 0x6e, 0x25, 0x38, 0x50, 0x92, + 0xf3, 0x73, 0xe0, 0x26, 0x55, 0xc0, 0xcc, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x2b, + 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xeb, 0xe9, 0x0e, 0xc7, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 6c5b383cf4cf586684da99075a0c9fdd8340958b Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 16 Sep 2024 10:44:38 +0700 Subject: [PATCH 2/4] update bid logic --- proto/reserve/auction/v1/auction.proto | 44 +- proto/reserve/auction/v1/tx.proto | 6 +- x/auction/keeper/abci.go | 171 ++--- x/auction/keeper/auction.go | 32 + x/auction/keeper/keeper.go | 89 +-- x/auction/keeper/msg_server.go | 39 +- x/auction/module/module.go | 7 - x/auction/types/auction.pb.go | 852 +++++++++++++++++-------- x/auction/types/codec.go | 2 +- x/auction/types/keys.go | 8 +- x/auction/types/params.pb.go | 130 ++-- x/auction/types/tx.pb.go | 403 ++++++------ 12 files changed, 1085 insertions(+), 698 deletions(-) create mode 100644 x/auction/keeper/auction.go diff --git a/proto/reserve/auction/v1/auction.proto b/proto/reserve/auction/v1/auction.proto index 1f7f5ca..7bec820 100644 --- a/proto/reserve/auction/v1/auction.proto +++ b/proto/reserve/auction/v1/auction.proto @@ -13,12 +13,14 @@ option go_package = "github.com/onomyprotocol/reserve/x/auction/types"; enum AuctionStatus { // AUCTION_STATUS_UNSPECIFIED defines unknow auction status default is active. AUCTION_STATUS_UNSPECIFIED= 0; - // AUCTION_STATUS_ACTIVE defines auction active status. - AUCTION_STATUS_ACTIVE= 1; - // AUCTION_STATUS_FINISHED defines auction finished with a winning bid. + // AUCTION_STATUS_ACTIVE defines auction active status. + AUCTION_STATUS_ACTIVE= 1; + // AUCTION_STATUS_FINISHED defines auction finished reaching target goal. AUCTION_STATUS_FINISHED = 2; - // AUCTION_STATUS_EXPIRED defines auction finished without a winning bid. - AUCTION_STATUS_EXPIRED = 3; + // AUCTION_STATUS_EXPIRED defines auction reach end time without reaching target goal. + AUCTION_STATUS_EXPIRED = 3; + // AUCTION_STATUS_OUT_OF_COLLATHERAL defines auction out of collatheral. + AUCTION_STATUS_OUT_OF_COLLATHERAL = 4; } // Auction struct @@ -58,20 +60,19 @@ message Auction { (amino.dont_omitempty) = true ]; - // status defines auction current status - AuctionStatus status = 8; + cosmos.base.v1beta1.Coin token_raised = 8 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - // final_bid contain the winning bid or empty if auction ended without a winner - Bid final_bid = 9; + // status defines auction current status + AuctionStatus status = 9; // target_goal defines the debt the auction is trying to recover - cosmos.base.v1beta1.Coin target_goal = 10; + cosmos.base.v1beta1.Coin target_goal = 10 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // Bid defines bid entry message Bid { // id of bid - string bid_id = 1; + uint64 bid_id = 1; // bidder address string bidder = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; @@ -83,13 +84,28 @@ message Bid { // recive_rate defines the rate compare to the price at the start of the auction // that the bid is willing to pay string recive_rate = 4 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + + // maxReceive maximum receive-able amount + cosmos.base.v1beta1.Coin max_receive = 5 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + bool is_handle = 6; + + // index in auction bid_queue + uint64 index = 7; } -// BidQueue defines a list of bid entries for a single auction +// BidQueue defines a list of bid entries for a single auction sorted by insertion time message BidQueue { // bidder address uint64 auction_id = 1; - // map of bid entries with bidder address - map bids = 2; + // array of bid entries with bidder address + repeated Bid bids = 2; +} + +// Bids defines a list of bid entries +message Bids { + // array of bid entries with bidder address + repeated Bid bids = 1; } \ No newline at end of file diff --git a/proto/reserve/auction/v1/tx.proto b/proto/reserve/auction/v1/tx.proto index 9155458..cce3c59 100644 --- a/proto/reserve/auction/v1/tx.proto +++ b/proto/reserve/auction/v1/tx.proto @@ -48,7 +48,7 @@ message MsgUpdateParamsResponse {} // MsgBid is the Msg/Bid request type. message MsgBid { option (cosmos.msg.v1.signer) = "bidder"; - option (amino.name) = "reserve/x/oracle/MsgBid"; + option (amino.name) = "reserve/x/auction/MsgBid"; // bidder is the address that submitting the bid entry. string bidder = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; @@ -74,10 +74,10 @@ message MsgBidResponse { // MsgCancelBid is the Msg/CancelBid request type. message MsgCancelBid { option (cosmos.msg.v1.signer) = "bidder"; - option (amino.name) = "reserve/x/oracle/MsgUpdateBid"; + option (amino.name) = "reserve/x/auction/MsgCancelBid"; // bid_id is the unique id. - string bid_id = 1; + uint64 bid_id = 1; // bidding auction id uint64 auction_id = 2; diff --git a/x/auction/keeper/abci.go b/x/auction/keeper/abci.go index 25643ee..18a214a 100644 --- a/x/auction/keeper/abci.go +++ b/x/auction/keeper/abci.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "time" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,50 +22,35 @@ func (k *Keeper) BeginBlocker(ctx context.Context) error { return nil } - k.lastestAuctionPeriod.Set(ctx, lastAuctionPeriods.Add(params.AuctionDurations)) + k.lastestAuctionPeriod.Set(ctx, lastAuctionPeriods.Add(params.AuctionPeriods)) // TODO: check vault module for liquidate vault // loop through all auctions err = k.Auctions.Walk(ctx, nil, func(auctionId uint64, auction types.Auction) (bool, error) { - // check if auction is ended or a bidder won - if auction.EndTime.After(currentTime) || - auction.Status == types.AuctionStatus_AUCTION_STATUS_EXPIRED || - auction.Status == types.AuctionStatus_AUCTION_STATUS_FINISHED { - if auction.FinalBid == nil || - auction.FinalBid.Bidder == "" || - auction.FinalBid.Amount.IsZero() { - // TODO: notify vault module about auction without winner - } + bidQueue, err := k.Bids.Get(ctx, auction.AuctionId) + if err != nil { + return true, err + } - bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(auction.FinalBid.Bidder) - if err != nil { - err := k.revertFinishedStatus(ctx, auction, currentTime) - return err == nil, err - } + needCleanup := false + if auction.Status == types.AuctionStatus_AUCTION_STATUS_FINISHED { + // TODO: notify vault that the debt goal has been reached - spendable := k.bankKeeper.SpendableCoins(ctx, bidderAddr) - if spendable.AmountOf(auction.FinalBid.Amount.Denom).LT(auction.FinalBid.Amount.Amount) { - // if bidder does not have enough token to pay, revert the status of auction - err := k.revertFinishedStatus(ctx, auction, currentTime) - return err == nil, err - } + needCleanup = true + // skip other logic + } else if auction.Status == types.AuctionStatus_AUCTION_STATUS_OUT_OF_COLLATHERAL { + // TODO: notify vault out of collatheral to auction - // send the bid amount to auction module - err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(auction.FinalBid.Amount)) - if err != nil { - err := k.revertFinishedStatus(ctx, auction, currentTime) - return err == nil, err - } + needCleanup = true + } else if auction.EndTime.After(currentTime) { + // TODO: notify vault that the auction has ended - // send the liquidate assets to auction winner - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, auction.Items) - if err != nil { - err := k.revertFinishedStatus(ctx, auction, currentTime) - return err == nil, err - } + needCleanup = true + } - // TODO: notify vault module about the winner and return raised token from the auction + if needCleanup { + k.refundBidders(ctx, bidQueue) // clear the auction afterward err = k.DeleteAuction(ctx, auction.AuctionId) @@ -74,7 +58,6 @@ func (k *Keeper) BeginBlocker(ctx context.Context) error { return true, err } - // skip other logic return false, nil } @@ -97,21 +80,7 @@ func (k *Keeper) BeginBlocker(ctx context.Context) error { } } - highestBid, amt, err := k.checkBidEntry(ctx, auction) - if err != nil { - return true, err - } - if highestBid == "" || amt.Amount.IsZero() { - return false, nil - } - - // update status and final bid - auction.Status = types.AuctionStatus_AUCTION_STATUS_FINISHED - auction.FinalBid = &types.Bid{ - Bidder: highestBid, - Amount: amt, - } - err = k.Auctions.Set(ctx, auctionId, auction) + err = k.fillBids(ctx, auction, bidQueue) if err != nil { return true, err } @@ -125,53 +94,85 @@ func (k *Keeper) BeginBlocker(ctx context.Context) error { return nil } -func (k Keeper) revertFinishedStatus(ctx context.Context, auction types.Auction, currTime time.Time) error { - auction.FinalBid = nil - if currTime.After(auction.EndTime) { - auction.Status = types.AuctionStatus_AUCTION_STATUS_EXPIRED - } else { - auction.Status = types.AuctionStatus_AUCTION_STATUS_ACTIVE +func (k Keeper) fillBids(ctx context.Context, auction types.Auction, bidQueue types.BidQueue) error { + itemDenom := auction.Item.Denom + + currentRate, err := sdkmath.LegacyNewDecFromStr(auction.CurrentRate) + if err != nil { + return err } - return k.Auctions.Set(ctx, auction.AuctionId, auction) -} + for i, bid := range bidQueue.Bids { + if bid.IsHandle { + continue + } + + if currentRate.Mul(auction.InitialPrice.Amount.ToLegacyDec()).TruncateInt().LTE(bid.Amount.Amount) { + bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(bid.Bidder) + if err != nil { + continue + } -func (k Keeper) checkBidEntry(ctx context.Context, auction types.Auction) (highestBidder string, amt sdk.Coin, err error) { - denom := auction.InitialPrice.Denom + receiveRate, err := sdkmath.LegacyNewDecFromStr(bid.ReciveRate) + if err != nil { + continue + } - bidQueue, err := k.Bids.Get(ctx, auction.AuctionId) - if err != nil { - return "", sdk.NewCoin(denom, sdkmath.ZeroInt()), err - } + receivePrice := receiveRate.Mul(auction.InitialPrice.Amount.ToLegacyDec()).TruncateInt() + receiveAmt := bid.Amount.Amount.Quo(receivePrice) + receiveCoin := sdk.NewCoin(itemDenom, receiveAmt) + // if out of collatheral + if auction.Item.Amount.LT(receiveAmt) { + auction.Status = types.AuctionStatus_AUCTION_STATUS_OUT_OF_COLLATHERAL + continue + } - currentRate, err := sdkmath.LegacyNewDecFromStr(auction.CurrentRate) - if err != nil { - return "", sdk.NewCoin(denom, sdkmath.ZeroInt()), err - } + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(receiveCoin)) + if err != nil { + continue + } - currentPriceAmt := sdkmath.LegacyNewDecFromInt(auction.InitialPrice.Amount).Mul(currentRate).RoundInt() + // update auction collatheral + auction.Item = auction.Item.Sub(receiveCoin) - maxBidder := struct { - addr string - amt sdkmath.Int - }{ - addr: "", - amt: currentPriceAmt, - } - for addr, bid := range bidQueue.Bids { - // get the highest bid that greater or equal the current price - if bid.Amount.Amount.GT(maxBidder.amt) { - maxBidder.addr = addr - maxBidder.amt = bid.Amount.Amount + auction.TokenRaised = auction.TokenRaised.Add(bid.Amount) + + if auction.TokenRaised.IsGTE(auction.TargetGoal) { + auction.Status = types.AuctionStatus_AUCTION_STATUS_FINISHED + } + + bidQueue.Bids[i].IsHandle = true + } + + // update auction status + err = k.Auctions.Set(ctx, auction.AuctionId, auction) + if err != nil { + return err } } - if maxBidder.addr == "" { - return "", sdk.NewCoin(denom, sdkmath.ZeroInt()), err + // update bid queue + err = k.Bids.Set(ctx, auction.AuctionId, bidQueue) + if err != nil { + return err } - return maxBidder.addr, sdk.NewCoin(denom, maxBidder.amt), nil + return nil + +} + +func (k Keeper) refundBidders(ctx context.Context, bidQueue types.BidQueue) error { + for _, bid := range bidQueue.Bids { + if bid.IsHandle { + continue + } + err := k.refundToken(ctx, sdk.NewCoins(bid.Amount), bid.Bidder) + if err != nil { + return err + } + } + return nil } func (k Keeper) discountRate(auction types.Auction, params types.Params) (string, error) { diff --git a/x/auction/keeper/auction.go b/x/auction/keeper/auction.go new file mode 100644 index 0000000..b3ee8a6 --- /dev/null +++ b/x/auction/keeper/auction.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onomyprotocol/reserve/x/auction/types" +) + +func (k Keeper) NewAuction(ctx context.Context, + startTime, currentTime time.Time, + initialPrice, item, + targetGoal sdk.Coin, + startingRate string, +) (*types.Auction, error) { + auctionId, err := k.AuctionIdSeq.Next(ctx) + if err != nil { + return nil, err + } + + return &types.Auction{ + StartTime: startTime, + AuctionId: auctionId, + InitialPrice: initialPrice, + Item: item, + CurrentRate: startingRate, + LastDiscountTime: currentTime, + Status: types.AuctionStatus_AUCTION_STATUS_ACTIVE, + TargetGoal: targetGoal, + }, nil +} diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 1d00463..7cca3d9 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "errors" "fmt" "time" @@ -33,14 +32,19 @@ type ( // timestamp of lastest auction period lastestAuctionPeriod collections.Item[time.Time] + AuctionIdSeq collections.Sequence + + // bid id seq by auction id + BidIdSeq collections.Map[uint64, uint64] + // Auctions maps auction id with auction struct Auctions collections.Map[uint64, types.Auction] // Bids maps auction id with bids queue Bids collections.Map[uint64, types.BidQueue] - // BidByAddress maps bidder address + auction id to a bid entry - BidByAddress collections.Map[collections.Pair[uint64, sdk.AccAddress], types.Bid] + // BidByAddress maps bidder auction id + address to a bid entry + BidByAddress collections.Map[collections.Pair[uint64, sdk.AccAddress], types.Bids] } ) @@ -61,9 +65,11 @@ func NewKeeper( storeService: storeService, authority: authority, logger: logger, + AuctionIdSeq: collections.NewSequence(sb, types.AuctionIdSeqPrefix, "auction_id_sequence"), + BidIdSeq: collections.NewMap(sb, types.BidIdSeqPrefix, "bid_id_sequence", collections.Uint64Key, collections.Uint64Value), Auctions: collections.NewMap(sb, types.AuctionsPrefix, "auctions", collections.Uint64Key, codec.CollValue[types.Auction](cdc)), Bids: collections.NewMap(sb, types.BidsPrefix, "bids", collections.Uint64Key, codec.CollValue[types.BidQueue](cdc)), - BidByAddress: collections.NewMap(sb, types.BidByAddressPrefix, "bids_by_address", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[types.Bid](cdc)), + BidByAddress: collections.NewMap(sb, types.BidByAddressPrefix, "bids_by_address", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[types.Bids](cdc)), } } @@ -90,6 +96,12 @@ func (k Keeper) DeleteAuction(ctx context.Context, auctionId uint64) error { return fmt.Errorf("failed to remove bid queue: %s", err) } + // clear the bid seq tracking + err = k.BidIdSeq.Remove(ctx, auctionId) + if err != nil { + return fmt.Errorf("failed to remove bid queue: %s", err) + } + // clear all bids for that auction id rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](auctionId) return k.BidByAddress.Clear(ctx, rng) @@ -115,27 +127,29 @@ func (k Keeper) AddBidEntry(ctx context.Context, auctionId uint64, bidderAddr sd return err } - _, has = bidQueue.Bids[bid.Bidder] - if has { - return fmt.Errorf("bid entry already exist for address %s and auction %v", bid.Bidder, auctionId) - } + bid.Index = uint64(len(bidQueue.Bids)) - bidQueue.Bids[bid.Bidder] = &bid + bidQueue.Bids = append(bidQueue.Bids, &bid) err = k.Bids.Set(ctx, auctionId, bidQueue) if err != nil { return err } - err = k.BidByAddress.Set(ctx, collections.Join(auctionId, bidderAddr), bid) + bids, err := k.BidByAddress.Get(ctx, collections.Join(auctionId, bidderAddr)) + if err != nil { + return err + } + bids.Bids = append(bids.Bids, &bid) + err = k.BidByAddress.Set(ctx, collections.Join(auctionId, bidderAddr), bids) if err != nil { return err } - return nil + return k.lockedToken(ctx, sdk.NewCoins(bid.Amount), bid.Bidder) } -// UpdateBidEntry udpdate existing bid entry for the given auction id -func (k Keeper) UpdateBidEntry(ctx context.Context, auctionId uint64, bidderAddr sdk.AccAddress, updatedBid types.Bid) error { +// CancelBidEntry cancel existing bid entry for the given auction id +func (k Keeper) CancelBidEntry(ctx context.Context, auctionId, bidId uint64) error { has, err := k.Auctions.Has(ctx, auctionId) if err != nil { return err @@ -144,46 +158,49 @@ func (k Keeper) UpdateBidEntry(ctx context.Context, auctionId uint64, bidderAddr return fmt.Errorf("cannot bid for non-existing/expired auction with id: %v", auctionId) } - has = k.authKeeper.HasAccount(ctx, bidderAddr) - if !has { - return sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address %s: account does not exist", updatedBid.Bidder) - } - bidQueue, err := k.Bids.Get(ctx, auctionId) if err != nil { return err } - currBid, has := bidQueue.Bids[updatedBid.Bidder] - if !has { - return fmt.Errorf("bid entry does not exist for address %s and auction %v", updatedBid.Bidder, auctionId) - } - - // locked additional amount when bidder raise the amount - // or refund amount when bidder lower the amount - if currBid.Amount.Amount.Equal(updatedBid.Amount.Amount) { - return errors.New("updated bidding amount must be different from the current bidding amount") + var refundAddr string + var refundAmt sdk.Coin + for i, bid := range bidQueue.Bids { + if bid.BidId == bidId { + bid.IsHandle = true + bidQueue.Bids[i] = bid + refundAddr = bid.Bidder + refundAmt = bid.Amount + break + } } - // update the entry - bidQueue.Bids[currBid.Bidder] = currBid err = k.Bids.Set(ctx, auctionId, bidQueue) if err != nil { return err } - err = k.BidByAddress.Set(ctx, collections.Join(auctionId, bidderAddr), *currBid) + if refundAddr == "" || refundAmt.IsNil() { + return fmt.Errorf("cannot find bid entry with id %v for auction %v", bidId, auctionId) + } + + return k.refundToken(ctx, sdk.NewCoins(refundAmt), refundAddr) +} + +func (k Keeper) lockedToken(ctx context.Context, amt sdk.Coins, bidderAdrr string) error { + bidderAcc, err := k.authKeeper.AddressCodec().StringToBytes(bidderAdrr) if err != nil { return err } - return nil + return k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAcc, types.ModuleName, amt) } -func (k Keeper) lockedToken(ctx context.Context, amt sdk.Coins, bidderAdrr sdk.AccAddress) error { - return k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAdrr, types.ModuleName, amt) -} +func (k Keeper) refundToken(ctx context.Context, amt sdk.Coins, bidderAdrr string) error { + bidderAcc, err := k.authKeeper.AddressCodec().StringToBytes(bidderAdrr) + if err != nil { + return err + } -func (k Keeper) refundToken(ctx context.Context, amt sdk.Coins, bidderAdrr sdk.AccAddress) error { - return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAdrr, amt) + return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAcc, amt) } diff --git a/x/auction/keeper/msg_server.go b/x/auction/keeper/msg_server.go index 63c75b1..2dfd7ca 100644 --- a/x/auction/keeper/msg_server.go +++ b/x/auction/keeper/msg_server.go @@ -35,13 +35,28 @@ func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) func (k msgServer) Bid(ctx context.Context, msg *types.MsgBid) (*types.MsgBidResponse, error) { bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(msg.Bidder) + if err != nil { + return &types.MsgBidResponse{ + Response: "Failed to submit bid", + }, err + } + bidIdSeq, err := k.BidIdSeq.Get(ctx, msg.AuctionId) + if err != nil { + return nil, err + } + + newBidId := bidIdSeq + 1 + err = k.BidIdSeq.Set(ctx, msg.AuctionId, newBidId) if err != nil { return nil, err } bid := types.Bid{ - Bidder: msg.Bidder, - Amount: msg.Amount, + BidId: newBidId, + Bidder: msg.Bidder, + Amount: msg.Amount, + ReciveRate: msg.ReciveRate, + IsHandle: false, } err = k.AddBidEntry(ctx, msg.AuctionId, bidderAddr, bid) if err != nil { @@ -53,28 +68,22 @@ func (k msgServer) Bid(ctx context.Context, msg *types.MsgBid) (*types.MsgBidRes sdk.NewAttribute(types.AttributeKeyBidEntry, fmt.Sprintf("bidder %s has submit an entry with amount: %s", msg.Bidder, msg.Amount.String())), )) - return &types.MsgBidResponse{}, nil + return &types.MsgBidResponse{ + Response: "Bid Accepted", + }, nil } -func (k msgServer) UpdateBid(ctx context.Context, msg *types.MsgUpdateBid) (*types.MsgUpdateBidResponse, error) { - bidderAddr, err := k.authKeeper.AddressCodec().StringToBytes(msg.Bidder) - if err != nil { - return nil, err - } +func (k msgServer) CancelBid(ctx context.Context, msg *types.MsgCancelBid) (*types.MsgCancelBidResponse, error) { - bid := types.Bid{ - Bidder: msg.Bidder, - Amount: msg.Amount, - } - err = k.UpdateBidEntry(ctx, msg.AuctionId, bidderAddr, bid) + err := k.CancelBidEntry(ctx, msg.AuctionId, msg.BidId) if err != nil { return nil, err } sdk.UnwrapSDKContext(ctx).EventManager().EmitEvent(sdk.NewEvent( types.EventUpdateBid, - sdk.NewAttribute(types.AttributeKeyBidEntry, fmt.Sprintf("bidder %s has update their entry to amount: %s", msg.Bidder, msg.Amount.String())), + sdk.NewAttribute(types.AttributeKeyBidEntry, fmt.Sprintf("cancel bid id %v for auction %v", msg.BidId, msg.AuctionId)), )) - return &types.MsgUpdateBidResponse{}, nil + return &types.MsgCancelBidResponse{}, nil } diff --git a/x/auction/module/module.go b/x/auction/module/module.go index b75809c..382dc89 100644 --- a/x/auction/module/module.go +++ b/x/auction/module/module.go @@ -33,7 +33,6 @@ var ( _ appmodule.AppModule = (*AppModule)(nil) _ appmodule.HasBeginBlocker = (*AppModule)(nil) - _ appmodule.HasEndBlocker = (*AppModule)(nil) ) // ---------------------------------------------------------------------------- @@ -156,12 +155,6 @@ func (am AppModule) BeginBlock(ctx context.Context) error { return am.keeper.BeginBlocker(ctx) } -// EndBlock contains the logic that is automatically triggered at the end of each block. -// The end block implementation is optional. -func (am AppModule) EndBlock(ctx context.Context) error { - return am.keeper.EndBlocker(ctx) -} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} diff --git a/x/auction/types/auction.pb.go b/x/auction/types/auction.pb.go index 2ec0e17..1f550cf 100644 --- a/x/auction/types/auction.pb.go +++ b/x/auction/types/auction.pb.go @@ -38,10 +38,12 @@ const ( AuctionStatus_AUCTION_STATUS_UNSPECIFIED AuctionStatus = 0 // AUCTION_STATUS_ACTIVE defines auction active status. AuctionStatus_AUCTION_STATUS_ACTIVE AuctionStatus = 1 - // AUCTION_STATUS_FINISHED defines auction finished with a winning bid. + // AUCTION_STATUS_FINISHED defines auction finished reaching target goal. AuctionStatus_AUCTION_STATUS_FINISHED AuctionStatus = 2 - // AUCTION_STATUS_EXPIRED defines auction finished without a winning bid. + // AUCTION_STATUS_EXPIRED defines auction reach end time without reaching target goal. AuctionStatus_AUCTION_STATUS_EXPIRED AuctionStatus = 3 + // AUCTION_STATUS_OUT_OF_COLLATHERAL defines auction out of collatheral. + AuctionStatus_AUCTION_STATUS_OUT_OF_COLLATHERAL AuctionStatus = 4 ) var AuctionStatus_name = map[int32]string{ @@ -49,13 +51,15 @@ var AuctionStatus_name = map[int32]string{ 1: "AUCTION_STATUS_ACTIVE", 2: "AUCTION_STATUS_FINISHED", 3: "AUCTION_STATUS_EXPIRED", + 4: "AUCTION_STATUS_OUT_OF_COLLATHERAL", } var AuctionStatus_value = map[string]int32{ - "AUCTION_STATUS_UNSPECIFIED": 0, - "AUCTION_STATUS_ACTIVE": 1, - "AUCTION_STATUS_FINISHED": 2, - "AUCTION_STATUS_EXPIRED": 3, + "AUCTION_STATUS_UNSPECIFIED": 0, + "AUCTION_STATUS_ACTIVE": 1, + "AUCTION_STATUS_FINISHED": 2, + "AUCTION_STATUS_EXPIRED": 3, + "AUCTION_STATUS_OUT_OF_COLLATHERAL": 4, } func (x AuctionStatus) String() string { @@ -77,15 +81,16 @@ type Auction struct { // starting price (currently only support usd stable token) InitialPrice types.Coin `protobuf:"bytes,4,opt,name=initial_price,json=initialPrice,proto3" json:"initial_price"` // items defines liquidate assets - Items []types.Coin `protobuf:"bytes,5,rep,name=items,proto3" json:"items"` + Item types.Coin `protobuf:"bytes,5,opt,name=item,proto3" json:"item"` // current_rate defines the rate compare with the initial price CurrentRate string `protobuf:"bytes,6,opt,name=current_rate,json=currentRate,proto3" json:"current_rate,omitempty"` // last_discount_time defines the last time a discount has been apply - LastDiscountTime time.Time `protobuf:"bytes,7,opt,name=last_discount_time,json=lastDiscountTime,proto3,stdtime" json:"last_discount_time"` + LastDiscountTime time.Time `protobuf:"bytes,7,opt,name=last_discount_time,json=lastDiscountTime,proto3,stdtime" json:"last_discount_time"` + TokenRaised types.Coin `protobuf:"bytes,8,opt,name=token_raised,json=tokenRaised,proto3" json:"token_raised"` // status defines auction current status - Status AuctionStatus `protobuf:"varint,8,opt,name=status,proto3,enum=reserve.auction.v1.AuctionStatus" json:"status,omitempty"` - // final_bid contain the winning bid or empty if auction ended without a winner - FinalBid *Bid `protobuf:"bytes,9,opt,name=final_bid,json=finalBid,proto3" json:"final_bid,omitempty"` + Status AuctionStatus `protobuf:"varint,9,opt,name=status,proto3,enum=reserve.auction.v1.AuctionStatus" json:"status,omitempty"` + // target_goal defines the debt the auction is trying to recover + TargetGoal types.Coin `protobuf:"bytes,10,opt,name=target_goal,json=targetGoal,proto3" json:"target_goal"` } func (m *Auction) Reset() { *m = Auction{} } @@ -149,11 +154,11 @@ func (m *Auction) GetInitialPrice() types.Coin { return types.Coin{} } -func (m *Auction) GetItems() []types.Coin { +func (m *Auction) GetItem() types.Coin { if m != nil { - return m.Items + return m.Item } - return nil + return types.Coin{} } func (m *Auction) GetCurrentRate() string { @@ -170,6 +175,13 @@ func (m *Auction) GetLastDiscountTime() time.Time { return time.Time{} } +func (m *Auction) GetTokenRaised() types.Coin { + if m != nil { + return m.TokenRaised + } + return types.Coin{} +} + func (m *Auction) GetStatus() AuctionStatus { if m != nil { return m.Status @@ -177,19 +189,29 @@ func (m *Auction) GetStatus() AuctionStatus { return AuctionStatus_AUCTION_STATUS_UNSPECIFIED } -func (m *Auction) GetFinalBid() *Bid { +func (m *Auction) GetTargetGoal() types.Coin { if m != nil { - return m.FinalBid + return m.TargetGoal } - return nil + return types.Coin{} } // Bid defines bid entry type Bid struct { + // id of bid + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` // bidder address - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` // bidding amount - Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + // recive_rate defines the rate compare to the price at the start of the auction + // that the bid is willing to pay + ReciveRate string `protobuf:"bytes,4,opt,name=recive_rate,json=reciveRate,proto3" json:"recive_rate,omitempty"` + // maxReceive maximum receive-able amount + MaxReceive types.Coin `protobuf:"bytes,5,opt,name=max_receive,json=maxReceive,proto3" json:"max_receive"` + IsHandle bool `protobuf:"varint,6,opt,name=is_handle,json=isHandle,proto3" json:"is_handle,omitempty"` + // index in auction bid_queue + Index uint64 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` } func (m *Bid) Reset() { *m = Bid{} } @@ -225,6 +247,13 @@ func (m *Bid) XXX_DiscardUnknown() { var xxx_messageInfo_Bid proto.InternalMessageInfo +func (m *Bid) GetBidId() uint64 { + if m != nil { + return m.BidId + } + return 0 +} + func (m *Bid) GetBidder() string { if m != nil { return m.Bidder @@ -239,12 +268,40 @@ func (m *Bid) GetAmount() types.Coin { return types.Coin{} } -// BidQueue defines a list of bid entries for a single auction +func (m *Bid) GetReciveRate() string { + if m != nil { + return m.ReciveRate + } + return "" +} + +func (m *Bid) GetMaxReceive() types.Coin { + if m != nil { + return m.MaxReceive + } + return types.Coin{} +} + +func (m *Bid) GetIsHandle() bool { + if m != nil { + return m.IsHandle + } + return false +} + +func (m *Bid) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +// BidQueue defines a list of bid entries for a single auction sorted by insertion time type BidQueue struct { // bidder address AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - // map of bid entries with bidder address - Bids map[string]*Bid `protobuf:"bytes,2,rep,name=bids,proto3" json:"bids,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // array of bid entries with bidder address + Bids []*Bid `protobuf:"bytes,2,rep,name=bids,proto3" json:"bids,omitempty"` } func (m *BidQueue) Reset() { *m = BidQueue{} } @@ -287,7 +344,53 @@ func (m *BidQueue) GetAuctionId() uint64 { return 0 } -func (m *BidQueue) GetBids() map[string]*Bid { +func (m *BidQueue) GetBids() []*Bid { + if m != nil { + return m.Bids + } + return nil +} + +// Bids defines a list of bid entries +type Bids struct { + // array of bid entries with bidder address + Bids []*Bid `protobuf:"bytes,1,rep,name=bids,proto3" json:"bids,omitempty"` +} + +func (m *Bids) Reset() { *m = Bids{} } +func (m *Bids) String() string { return proto.CompactTextString(m) } +func (*Bids) ProtoMessage() {} +func (*Bids) Descriptor() ([]byte, []int) { + return fileDescriptor_8758264ed04201a2, []int{3} +} +func (m *Bids) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bids) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bids.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 *Bids) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bids.Merge(m, src) +} +func (m *Bids) XXX_Size() int { + return m.Size() +} +func (m *Bids) XXX_DiscardUnknown() { + xxx_messageInfo_Bids.DiscardUnknown(m) +} + +var xxx_messageInfo_Bids proto.InternalMessageInfo + +func (m *Bids) GetBids() []*Bid { if m != nil { return m.Bids } @@ -299,56 +402,63 @@ func init() { proto.RegisterType((*Auction)(nil), "reserve.auction.v1.Auction") proto.RegisterType((*Bid)(nil), "reserve.auction.v1.Bid") proto.RegisterType((*BidQueue)(nil), "reserve.auction.v1.BidQueue") - proto.RegisterMapType((map[string]*Bid)(nil), "reserve.auction.v1.BidQueue.BidsEntry") + proto.RegisterType((*Bids)(nil), "reserve.auction.v1.Bids") } func init() { proto.RegisterFile("reserve/auction/v1/auction.proto", fileDescriptor_8758264ed04201a2) } var fileDescriptor_8758264ed04201a2 = []byte{ - // 688 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0x8e, 0x93, 0x34, 0x8d, 0xaf, 0x1f, 0x0a, 0xa7, 0x42, 0xdd, 0x20, 0xdc, 0xd0, 0x01, 0x45, - 0x95, 0x6a, 0x37, 0x85, 0x01, 0x2a, 0x96, 0x38, 0x49, 0x55, 0x33, 0x94, 0xe0, 0xa4, 0x80, 0x58, - 0x2c, 0xdb, 0x77, 0x0d, 0x27, 0x62, 0x5f, 0xe4, 0x3b, 0x47, 0x64, 0xe6, 0x0f, 0xf4, 0x67, 0x30, - 0x32, 0x54, 0x62, 0xe1, 0x07, 0x74, 0xac, 0x3a, 0x31, 0x01, 0x6a, 0x07, 0xfe, 0x06, 0xf2, 0xf9, - 0x52, 0x89, 0x40, 0xa5, 0x76, 0xb1, 0x5e, 0xdf, 0xfb, 0x3c, 0xcf, 0xfb, 0x71, 0x8f, 0x0e, 0xd4, - 0x62, 0xcc, 0x70, 0x3c, 0xc6, 0xa6, 0x97, 0x04, 0x9c, 0xd0, 0xc8, 0x1c, 0x37, 0xa6, 0xa1, 0x31, - 0x8a, 0x29, 0xa7, 0x10, 0x4a, 0x84, 0x31, 0x3d, 0x1e, 0x37, 0xaa, 0x77, 0xbc, 0x90, 0x44, 0xd4, - 0x14, 0xdf, 0x0c, 0x56, 0x5d, 0x19, 0xd0, 0x01, 0x15, 0xa1, 0x99, 0x46, 0xf2, 0x74, 0x2d, 0xa0, - 0x2c, 0xa4, 0xcc, 0xcd, 0x12, 0xd9, 0x8f, 0x4c, 0xad, 0x0f, 0x28, 0x1d, 0x0c, 0xb1, 0x29, 0xfe, - 0xfc, 0xe4, 0xc8, 0xe4, 0x24, 0xc4, 0x8c, 0x7b, 0xe1, 0x48, 0x02, 0xf4, 0x0c, 0x6e, 0xfa, 0x1e, - 0xc3, 0xe6, 0xb8, 0xe1, 0x63, 0xee, 0x35, 0xcc, 0x80, 0x12, 0xd9, 0xd8, 0xc6, 0xb7, 0x22, 0x98, - 0x6f, 0x66, 0x3d, 0xc1, 0x7d, 0x00, 0x18, 0xf7, 0x62, 0xee, 0xa6, 0x22, 0x9a, 0x52, 0x53, 0xea, - 0x0b, 0x3b, 0x55, 0x23, 0xab, 0x60, 0x4c, 0x2b, 0x18, 0xfd, 0x69, 0x05, 0x6b, 0xe9, 0xf4, 0xc7, - 0x7a, 0xee, 0xf8, 0xe7, 0xba, 0xf2, 0xf9, 0xf7, 0x97, 0x4d, 0xc5, 0x51, 0x05, 0x39, 0x4d, 0xc3, - 0x36, 0x28, 0xe3, 0x08, 0x65, 0x3a, 0xf9, 0xdb, 0xea, 0xcc, 0xe3, 0x08, 0x09, 0x95, 0x07, 0x00, - 0xc8, 0x75, 0xb9, 0x04, 0x69, 0x85, 0x9a, 0x52, 0x2f, 0x3a, 0xaa, 0x3c, 0xb1, 0x11, 0xb4, 0xc1, - 0x12, 0x89, 0x08, 0x27, 0xde, 0xd0, 0x1d, 0xc5, 0x24, 0xc0, 0x5a, 0x51, 0x54, 0x5a, 0x33, 0xe4, - 0x86, 0xd2, 0x91, 0x0d, 0x39, 0xb2, 0xd1, 0xa2, 0x24, 0xb2, 0xd4, 0xb4, 0x50, 0x56, 0x64, 0x51, - 0x52, 0xbb, 0x29, 0x13, 0xee, 0x82, 0x39, 0xc2, 0x71, 0xc8, 0xb4, 0xb9, 0x5a, 0xe1, 0xc6, 0x12, - 0x19, 0x05, 0x36, 0xc0, 0x62, 0x90, 0xc4, 0x31, 0x8e, 0xb8, 0x1b, 0x7b, 0x1c, 0x6b, 0xa5, 0x9a, - 0x52, 0x57, 0xad, 0xe5, 0xf3, 0x93, 0x2d, 0x20, 0x55, 0xda, 0x38, 0x70, 0x16, 0x24, 0xc6, 0xf1, - 0x38, 0x86, 0x6f, 0x00, 0x1c, 0x7a, 0x8c, 0xbb, 0x88, 0xb0, 0x80, 0x26, 0x91, 0x5c, 0xf8, 0xfc, - 0x6d, 0x17, 0x55, 0x49, 0x45, 0xda, 0x52, 0x43, 0x6c, 0xec, 0x19, 0x28, 0x31, 0xee, 0xf1, 0x84, - 0x69, 0xe5, 0x9a, 0x52, 0x5f, 0xde, 0x79, 0x68, 0xfc, 0xeb, 0x3b, 0x43, 0x5e, 0x77, 0x4f, 0x00, - 0x1d, 0x49, 0x80, 0x4f, 0x80, 0x7a, 0x44, 0x22, 0x6f, 0xe8, 0xfa, 0x04, 0x69, 0xaa, 0x68, 0x65, - 0xf5, 0x7f, 0x6c, 0x8b, 0x20, 0xa7, 0x2c, 0x90, 0x16, 0x41, 0x1b, 0x09, 0x28, 0x58, 0x04, 0xc1, - 0x6d, 0x50, 0xf2, 0x09, 0x42, 0x38, 0x16, 0xae, 0x51, 0x2d, 0xed, 0xfc, 0x64, 0x6b, 0x45, 0x4e, - 0xdf, 0x44, 0x28, 0xc6, 0x8c, 0xf5, 0x78, 0x4c, 0xa2, 0x81, 0x23, 0x71, 0xf0, 0x39, 0x28, 0x79, - 0x61, 0xda, 0xb7, 0xf4, 0xc7, 0xcd, 0x56, 0x2e, 0x39, 0x1b, 0x5f, 0x15, 0x50, 0xb6, 0x08, 0x7a, - 0x95, 0xe0, 0x64, 0xd6, 0x26, 0xca, 0xac, 0x4d, 0x76, 0x41, 0xd1, 0x27, 0x88, 0x69, 0x79, 0x71, - 0xb5, 0x8f, 0xae, 0x99, 0x49, 0x48, 0xa5, 0x01, 0xeb, 0x44, 0x3c, 0x9e, 0x38, 0x82, 0x53, 0xed, - 0x02, 0xf5, 0xea, 0x08, 0x56, 0x40, 0xe1, 0x03, 0x9e, 0x64, 0x13, 0x3a, 0x69, 0x08, 0xb7, 0xc0, - 0xdc, 0xd8, 0x1b, 0x26, 0x53, 0x8f, 0x5f, 0xbb, 0xaf, 0x0c, 0xb5, 0x9b, 0x7f, 0xaa, 0x6c, 0x7e, - 0x52, 0xc0, 0xd2, 0x5f, 0x17, 0x00, 0x75, 0x50, 0x6d, 0x1e, 0xb6, 0xfa, 0xf6, 0xcb, 0x03, 0xb7, - 0xd7, 0x6f, 0xf6, 0x0f, 0x7b, 0xee, 0xe1, 0x41, 0xaf, 0xdb, 0x69, 0xd9, 0x7b, 0x76, 0xa7, 0x5d, - 0xc9, 0xc1, 0x35, 0x70, 0x77, 0x26, 0xdf, 0x6c, 0xf5, 0xed, 0xd7, 0x9d, 0x8a, 0x02, 0xef, 0x83, - 0xd5, 0x99, 0xd4, 0x9e, 0x7d, 0x60, 0xf7, 0xf6, 0x3b, 0xed, 0x4a, 0x1e, 0x56, 0xc1, 0xbd, 0x99, - 0x64, 0xe7, 0x6d, 0xd7, 0x76, 0x3a, 0xed, 0x4a, 0xc1, 0x7a, 0x71, 0x7a, 0xa1, 0x2b, 0x67, 0x17, - 0xba, 0xf2, 0xeb, 0x42, 0x57, 0x8e, 0x2f, 0xf5, 0xdc, 0xd9, 0xa5, 0x9e, 0xfb, 0x7e, 0xa9, 0xe7, - 0xde, 0x6d, 0x0f, 0x08, 0x7f, 0x9f, 0xf8, 0x46, 0x40, 0x43, 0x93, 0x46, 0x34, 0x9c, 0x08, 0x1b, - 0x06, 0x74, 0x68, 0x4e, 0xdf, 0xb8, 0x8f, 0x57, 0xaf, 0x1c, 0x9f, 0x8c, 0x30, 0xf3, 0x4b, 0x02, - 0xf1, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x90, 0x33, 0x5a, 0x05, 0x05, 0x00, 0x00, + // 786 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6f, 0xdb, 0x36, + 0x14, 0xb6, 0x12, 0xc5, 0xb1, 0x9f, 0x93, 0xc2, 0x23, 0xd2, 0x55, 0x71, 0x31, 0xc5, 0x0d, 0x30, + 0xc0, 0xe8, 0x50, 0xa9, 0x4e, 0x2f, 0x1b, 0xb0, 0x8b, 0x65, 0x2b, 0x8d, 0x86, 0x20, 0xc9, 0x64, + 0xa7, 0x1b, 0x76, 0x11, 0x28, 0x91, 0x53, 0x89, 0x59, 0x62, 0x20, 0x52, 0x46, 0xfa, 0x2f, 0x7a, + 0xd8, 0x8f, 0x18, 0x76, 0xda, 0xa1, 0xc0, 0xfe, 0x42, 0x8f, 0x45, 0x4f, 0x3b, 0x6d, 0x43, 0x72, + 0xd8, 0xdf, 0x18, 0x44, 0xd1, 0x05, 0xe6, 0xf5, 0x10, 0x5f, 0x04, 0x92, 0xef, 0xfb, 0xbe, 0xf7, + 0xf8, 0xde, 0x47, 0x41, 0xbf, 0xa0, 0x82, 0x16, 0x0b, 0xea, 0xe2, 0x32, 0x91, 0x8c, 0xe7, 0xee, + 0x62, 0xb8, 0x5c, 0x3a, 0x57, 0x05, 0x97, 0x1c, 0x21, 0x8d, 0x70, 0x96, 0xc7, 0x8b, 0x61, 0xef, + 0x13, 0x9c, 0xb1, 0x9c, 0xbb, 0xea, 0x5b, 0xc3, 0x7a, 0x7b, 0x29, 0x4f, 0xb9, 0x5a, 0xba, 0xd5, + 0x4a, 0x9f, 0xee, 0x27, 0x5c, 0x64, 0x5c, 0x44, 0x75, 0xa0, 0xde, 0xe8, 0xd0, 0x41, 0xca, 0x79, + 0x3a, 0xa7, 0xae, 0xda, 0xc5, 0xe5, 0x8f, 0xae, 0x64, 0x19, 0x15, 0x12, 0x67, 0x57, 0x1a, 0x60, + 0xd7, 0x70, 0x37, 0xc6, 0x82, 0xba, 0x8b, 0x61, 0x4c, 0x25, 0x1e, 0xba, 0x09, 0x67, 0xba, 0xb0, + 0xc3, 0x9f, 0xb7, 0x60, 0x7b, 0x54, 0xd7, 0x84, 0x4e, 0x00, 0x84, 0xc4, 0x85, 0x8c, 0x2a, 0x11, + 0xcb, 0xe8, 0x1b, 0x83, 0xce, 0x51, 0xcf, 0xa9, 0x33, 0x38, 0xcb, 0x0c, 0xce, 0x6c, 0x99, 0xc1, + 0xdb, 0x7d, 0xfb, 0xe7, 0x41, 0xe3, 0xf5, 0x5f, 0x07, 0xc6, 0x2f, 0xff, 0xfc, 0xf6, 0xd8, 0x08, + 0xdb, 0x8a, 0x5c, 0x85, 0xd1, 0x04, 0x5a, 0x34, 0x27, 0xb5, 0xce, 0xc6, 0xba, 0x3a, 0xdb, 0x34, + 0x27, 0x4a, 0xe5, 0x33, 0x00, 0xdd, 0xae, 0x88, 0x11, 0x6b, 0xb3, 0x6f, 0x0c, 0xcc, 0xb0, 0xad, + 0x4f, 0x02, 0x82, 0x02, 0xd8, 0x65, 0x39, 0x93, 0x0c, 0xcf, 0xa3, 0xab, 0x82, 0x25, 0xd4, 0x32, + 0x55, 0xa6, 0x7d, 0x47, 0x77, 0xa8, 0xba, 0xb2, 0xa3, 0xaf, 0xec, 0x8c, 0x39, 0xcb, 0xbd, 0x76, + 0x95, 0xa8, 0x4e, 0xb2, 0xa3, 0xa9, 0x17, 0x15, 0x13, 0x7d, 0x09, 0x26, 0x93, 0x34, 0xb3, 0xb6, + 0xd6, 0x50, 0x50, 0x0c, 0x34, 0x84, 0x9d, 0xa4, 0x2c, 0x0a, 0x9a, 0xcb, 0xa8, 0xc0, 0x92, 0x5a, + 0xcd, 0xbe, 0x31, 0x68, 0x7b, 0xf7, 0xde, 0xbf, 0x79, 0x02, 0x5a, 0x64, 0x42, 0x93, 0xb0, 0xa3, + 0x31, 0x21, 0x96, 0x14, 0x7d, 0x07, 0x68, 0x8e, 0x85, 0x8c, 0x08, 0x13, 0x09, 0x2f, 0x73, 0xdd, + 0xee, 0xed, 0x75, 0xdb, 0xd4, 0xad, 0x44, 0x26, 0x5a, 0x43, 0xf5, 0xeb, 0x39, 0xec, 0x48, 0xfe, + 0x13, 0xcd, 0xa3, 0x02, 0x33, 0x41, 0x89, 0xd5, 0x5a, 0xe3, 0x36, 0x1d, 0xc5, 0x0c, 0x15, 0x11, + 0x7d, 0x05, 0x4d, 0x21, 0xb1, 0x2c, 0x85, 0xd5, 0xee, 0x1b, 0x83, 0x7b, 0x47, 0x8f, 0x9c, 0xff, + 0xdb, 0xd7, 0xd1, 0xae, 0x99, 0x2a, 0x60, 0xa8, 0x09, 0xc8, 0x87, 0x8e, 0xc4, 0x45, 0x4a, 0x65, + 0x94, 0x72, 0x3c, 0xb7, 0x60, 0x8d, 0x12, 0xa0, 0x26, 0x3e, 0xe7, 0x78, 0x7e, 0xf8, 0xfb, 0x06, + 0x6c, 0x7a, 0x8c, 0xa0, 0xfb, 0xd0, 0x8c, 0x19, 0xa9, 0xc6, 0x6f, 0xa8, 0xf1, 0x6f, 0xc5, 0x8c, + 0x04, 0x04, 0x3d, 0x55, 0xc7, 0x84, 0x16, 0xca, 0x5d, 0x6d, 0xcf, 0x7a, 0xff, 0xe6, 0xc9, 0x9e, + 0xce, 0x31, 0x22, 0xa4, 0xa0, 0x42, 0x4c, 0x65, 0xc1, 0xf2, 0x34, 0xd4, 0x38, 0xf4, 0x35, 0x34, + 0x71, 0x56, 0x75, 0x4a, 0xf9, 0xe8, 0xae, 0x25, 0x69, 0x0e, 0x72, 0xa1, 0x53, 0xd0, 0x84, 0x2d, + 0x68, 0x3d, 0x64, 0xf3, 0xa3, 0x43, 0x86, 0x1a, 0xa2, 0x66, 0xec, 0x43, 0x27, 0xc3, 0xd7, 0x51, + 0x41, 0x13, 0xca, 0x16, 0x74, 0x2d, 0x5f, 0x41, 0x86, 0xaf, 0xc3, 0x9a, 0x87, 0x1e, 0x42, 0x9b, + 0x89, 0xe8, 0x25, 0xce, 0xc9, 0xbc, 0xb6, 0x56, 0x2b, 0x6c, 0x31, 0x71, 0xa2, 0xf6, 0x68, 0x0f, + 0xb6, 0x58, 0x4e, 0xe8, 0xb5, 0xb2, 0x8e, 0x19, 0xd6, 0x9b, 0xc3, 0x17, 0xd0, 0xf2, 0x18, 0xf9, + 0xb6, 0xa4, 0xe5, 0xea, 0x03, 0x32, 0x56, 0x1f, 0xd0, 0x17, 0x60, 0xc6, 0x8c, 0x08, 0x6b, 0xa3, + 0xbf, 0x39, 0xe8, 0x1c, 0x3d, 0xf8, 0xd8, 0x90, 0x3d, 0x46, 0x42, 0x05, 0x3a, 0x7c, 0x06, 0xa6, + 0xc7, 0x88, 0xf8, 0x40, 0x32, 0xee, 0x40, 0x7a, 0xfc, 0xab, 0x01, 0xbb, 0xff, 0xf1, 0x09, 0xb2, + 0xa1, 0x37, 0xba, 0x1c, 0xcf, 0x82, 0xf3, 0xb3, 0x68, 0x3a, 0x1b, 0xcd, 0x2e, 0xa7, 0xd1, 0xe5, + 0xd9, 0xf4, 0xc2, 0x1f, 0x07, 0xc7, 0x81, 0x3f, 0xe9, 0x36, 0xd0, 0x3e, 0xdc, 0x5f, 0x89, 0x8f, + 0xc6, 0xb3, 0xe0, 0x85, 0xdf, 0x35, 0xd0, 0x43, 0x78, 0xb0, 0x12, 0x3a, 0x0e, 0xce, 0x82, 0xe9, + 0x89, 0x3f, 0xe9, 0x6e, 0xa0, 0x1e, 0x7c, 0xba, 0x12, 0xf4, 0xbf, 0xbf, 0x08, 0x42, 0x7f, 0xd2, + 0xdd, 0x44, 0x9f, 0xc3, 0xa3, 0x95, 0xd8, 0xf9, 0xe5, 0x2c, 0x3a, 0x3f, 0x8e, 0xc6, 0xe7, 0xa7, + 0xa7, 0xa3, 0xd9, 0x89, 0x1f, 0x8e, 0x4e, 0xbb, 0xa6, 0xf7, 0xcd, 0xdb, 0x1b, 0xdb, 0x78, 0x77, + 0x63, 0x1b, 0x7f, 0xdf, 0xd8, 0xc6, 0xeb, 0x5b, 0xbb, 0xf1, 0xee, 0xd6, 0x6e, 0xfc, 0x71, 0x6b, + 0x37, 0x7e, 0x78, 0x9a, 0x32, 0xf9, 0xb2, 0x8c, 0x9d, 0x84, 0x67, 0x2e, 0xcf, 0x79, 0xf6, 0x4a, + 0xbd, 0xce, 0x84, 0xcf, 0xdd, 0xe5, 0x8f, 0xff, 0xfa, 0xc3, 0xaf, 0x5f, 0xbe, 0xba, 0xa2, 0x22, + 0x6e, 0x2a, 0xc4, 0xb3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x80, 0x30, 0x26, 0xd6, 0x1a, 0x06, + 0x00, 0x00, } func (m *Auction) Marshal() (dAtA []byte, err error) { @@ -371,29 +481,37 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.FinalBid != nil { - { - size, err := m.FinalBid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) + { + size, err := m.TargetGoal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x4a + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x52 if m.Status != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x48 } - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastDiscountTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastDiscountTime):]) - if err2 != nil { - return 0, err2 + { + size, err := m.TokenRaised.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastDiscountTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastDiscountTime):]) + if err3 != nil { + return 0, err3 } - i -= n2 - i = encodeVarintAuction(dAtA, i, uint64(n2)) + i -= n3 + i = encodeVarintAuction(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x3a if len(m.CurrentRate) > 0 { @@ -403,20 +521,16 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a + { + size, err := m.Item.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a { size, err := m.InitialPrice.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -432,20 +546,20 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err4 != nil { - return 0, err4 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) + if err6 != nil { + return 0, err6 } - i -= n4 - i = encodeVarintAuction(dAtA, i, uint64(n4)) + i -= n6 + i = encodeVarintAuction(dAtA, i, uint64(n6)) i-- dAtA[i] = 0x12 - n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) - if err5 != nil { - return 0, err5 + n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err7 != nil { + return 0, err7 } - i -= n5 - i = encodeVarintAuction(dAtA, i, uint64(n5)) + i -= n7 + i = encodeVarintAuction(dAtA, i, uint64(n7)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -471,6 +585,38 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Index != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x38 + } + if m.IsHandle { + i-- + if m.IsHandle { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + { + size, err := m.MaxReceive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.ReciveRate) > 0 { + i -= len(m.ReciveRate) + copy(dAtA[i:], m.ReciveRate) + i = encodeVarintAuction(dAtA, i, uint64(len(m.ReciveRate))) + i-- + dAtA[i] = 0x22 + } { size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -480,13 +626,18 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a if len(m.Bidder) > 0 { i -= len(m.Bidder) copy(dAtA[i:], m.Bidder) i = encodeVarintAuction(dAtA, i, uint64(len(m.Bidder))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if m.BidId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.BidId)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -512,27 +663,15 @@ func (m *BidQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Bids) > 0 { - for k := range m.Bids { - v := m.Bids[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintAuction(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintAuction(dAtA, i, uint64(baseI-i)) + for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } @@ -545,6 +684,43 @@ func (m *BidQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Bids) 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 *Bids) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bids) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bids) > 0 { + for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { offset -= sovAuction(v) base := offset @@ -571,25 +747,21 @@ func (m *Auction) Size() (n int) { } l = m.InitialPrice.Size() n += 1 + l + sovAuction(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovAuction(uint64(l)) - } - } + l = m.Item.Size() + n += 1 + l + sovAuction(uint64(l)) l = len(m.CurrentRate) if l > 0 { n += 1 + l + sovAuction(uint64(l)) } l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastDiscountTime) n += 1 + l + sovAuction(uint64(l)) + l = m.TokenRaised.Size() + n += 1 + l + sovAuction(uint64(l)) if m.Status != 0 { n += 1 + sovAuction(uint64(m.Status)) } - if m.FinalBid != nil { - l = m.FinalBid.Size() - n += 1 + l + sovAuction(uint64(l)) - } + l = m.TargetGoal.Size() + n += 1 + l + sovAuction(uint64(l)) return n } @@ -599,12 +771,27 @@ func (m *Bid) Size() (n int) { } var l int _ = l + if m.BidId != 0 { + n += 1 + sovAuction(uint64(m.BidId)) + } l = len(m.Bidder) if l > 0 { n += 1 + l + sovAuction(uint64(l)) } l = m.Amount.Size() n += 1 + l + sovAuction(uint64(l)) + l = len(m.ReciveRate) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = m.MaxReceive.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.IsHandle { + n += 2 + } + if m.Index != 0 { + n += 1 + sovAuction(uint64(m.Index)) + } return n } @@ -618,16 +805,24 @@ func (m *BidQueue) Size() (n int) { n += 1 + sovAuction(uint64(m.AuctionId)) } if len(m.Bids) > 0 { - for k, v := range m.Bids { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovAuction(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovAuction(uint64(len(k))) + l - n += mapEntrySize + 1 + sovAuction(uint64(mapEntrySize)) + for _, e := range m.Bids { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + return n +} + +func (m *Bids) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Bids) > 0 { + for _, e := range m.Bids { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) } } return n @@ -788,7 +983,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Item", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -815,8 +1010,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, types.Coin{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Item.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -886,6 +1080,39 @@ func (m *Auction) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenRaised", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TokenRaised.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } @@ -904,9 +1131,9 @@ func (m *Auction) Unmarshal(dAtA []byte) error { break } } - case 9: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalBid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetGoal", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -933,10 +1160,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FinalBid == nil { - m.FinalBid = &Bid{} - } - if err := m.FinalBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TargetGoal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -991,6 +1215,25 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + m.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) } @@ -1022,7 +1265,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } m.Bidder = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -1055,6 +1298,110 @@ func (m *Bid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReciveRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReciveRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxReceive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxReceive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsHandle", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsHandle = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) @@ -1153,105 +1500,94 @@ func (m *BidQueue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Bids == nil { - m.Bids = make(map[string]*Bid) - } - var mapkey string - var mapvalue *Bid - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthAuction - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthAuction - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthAuction - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthAuction - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Bid{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Bids[mapkey] = mapvalue + m.Bids = append(m.Bids, &Bid{}) + if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bids) 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 ErrIntOverflowAuction + } + 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: Bids: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bids: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bids = append(m.Bids, &Bid{}) + if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/auction/types/codec.go b/x/auction/types/codec.go index 5fff82e..6b0ae49 100644 --- a/x/auction/types/codec.go +++ b/x/auction/types/codec.go @@ -17,7 +17,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgBid{}, ) registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUpdateBid{}, + &MsgCancelBid{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/auction/types/keys.go b/x/auction/types/keys.go index f55a6ab..cadfead 100644 --- a/x/auction/types/keys.go +++ b/x/auction/types/keys.go @@ -18,9 +18,11 @@ var ( ) var ( - AuctionsPrefix = collections.NewPrefix(1) - BidsPrefix = collections.NewPrefix(2) - BidByAddressPrefix = collections.NewPrefix(3) + AuctionIdSeqPrefix = collections.NewPrefix(1) + BidIdSeqPrefix = collections.NewPrefix(2) + AuctionsPrefix = collections.NewPrefix(3) + BidsPrefix = collections.NewPrefix(4) + BidByAddressPrefix = collections.NewPrefix(5) ) func KeyPrefix(p string) []byte { diff --git a/x/auction/types/params.pb.go b/x/auction/types/params.pb.go index 933c488..7e95927 100644 --- a/x/auction/types/params.pb.go +++ b/x/auction/types/params.pb.go @@ -34,18 +34,16 @@ type Params struct { // defines how long (either in blocktime or blockheight) // between each auction AuctionPeriods time.Duration `protobuf:"bytes,1,opt,name=auction_periods,json=auctionPeriods,proto3,stdduration" json:"auction_periods"` - // defines how long the auction will takes - AuctionDurations time.Duration `protobuf:"bytes,2,opt,name=auction_durations,json=auctionDurations,proto3,stdduration" json:"auction_durations"` // duration between each price reduction - ReduceStep time.Duration `protobuf:"bytes,3,opt,name=reduce_step,json=reduceStep,proto3,stdduration" json:"reduce_step"` + ReduceStep time.Duration `protobuf:"bytes,2,opt,name=reduce_step,json=reduceStep,proto3,stdduration" json:"reduce_step"` // rate compared with the collaterals price from the // oracle at which the auction will start with - StartingRate string `protobuf:"bytes,4,opt,name=starting_rate,json=startingRate,proto3" json:"starting_rate,omitempty"` + StartingRate string `protobuf:"bytes,3,opt,name=starting_rate,json=startingRate,proto3" json:"starting_rate,omitempty"` // rate compared with the initial price that the price // can drop to - LowestRate string `protobuf:"bytes,5,opt,name=lowest_rate,json=lowestRate,proto3" json:"lowest_rate,omitempty"` + LowestRate string `protobuf:"bytes,4,opt,name=lowest_rate,json=lowestRate,proto3" json:"lowest_rate,omitempty"` // rate that are decrease every reduce_step - DiscountRate string `protobuf:"bytes,6,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` + DiscountRate string `protobuf:"bytes,5,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -88,13 +86,6 @@ func (m *Params) GetAuctionPeriods() time.Duration { return 0 } -func (m *Params) GetAuctionDurations() time.Duration { - if m != nil { - return m.AuctionDurations - } - return 0 -} - func (m *Params) GetReduceStep() time.Duration { if m != nil { return m.ReduceStep @@ -130,32 +121,31 @@ func init() { func init() { proto.RegisterFile("reserve/auction/v1/params.proto", fileDescriptor_7e77e58d36f40199) } var fileDescriptor_7e77e58d36f40199 = []byte{ - // 396 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x6f, 0xda, 0x40, - 0x14, 0xc7, 0x7d, 0xa5, 0x45, 0xea, 0x51, 0x68, 0xb1, 0x3a, 0x18, 0x06, 0x9b, 0x76, 0x42, 0x48, - 0xf5, 0x95, 0xb2, 0x75, 0x44, 0x2c, 0xed, 0x44, 0xa9, 0xba, 0x74, 0xb1, 0x0e, 0xfb, 0xea, 0x5a, - 0xc2, 0x7e, 0xd6, 0xdd, 0x99, 0x96, 0xaf, 0x90, 0x29, 0x63, 0xc6, 0x8c, 0x19, 0x19, 0xb2, 0xe5, - 0x0b, 0x30, 0xa2, 0x4c, 0x99, 0x92, 0x08, 0x06, 0xf2, 0x31, 0x22, 0xee, 0xce, 0x59, 0xc2, 0xc2, - 0x62, 0xdd, 0xbd, 0xf7, 0xff, 0xff, 0xfe, 0xd6, 0xbb, 0x87, 0x3d, 0xce, 0x04, 0xe3, 0x73, 0x46, - 0x68, 0x11, 0xca, 0x04, 0x32, 0x32, 0xef, 0x93, 0x9c, 0x72, 0x9a, 0x0a, 0x3f, 0xe7, 0x20, 0xc1, - 0xb6, 0x8d, 0xc0, 0x37, 0x02, 0x7f, 0xde, 0x6f, 0x37, 0x69, 0x9a, 0x64, 0x40, 0xd4, 0x57, 0xcb, - 0xda, 0xef, 0x63, 0x88, 0x41, 0x1d, 0xc9, 0xfe, 0x64, 0xaa, 0xad, 0x10, 0x44, 0x0a, 0x22, 0xd0, - 0x0d, 0x7d, 0x31, 0x2d, 0x37, 0x06, 0x88, 0x67, 0x8c, 0xa8, 0xdb, 0xb4, 0xf8, 0x43, 0xa2, 0x82, - 0x53, 0x15, 0xa0, 0x2a, 0x1f, 0xaf, 0x2a, 0xb8, 0x3a, 0x56, 0x3f, 0x62, 0xff, 0xc0, 0x6f, 0x4d, - 0x78, 0x90, 0x33, 0x9e, 0x40, 0x24, 0x1c, 0xd4, 0x41, 0xdd, 0xda, 0x97, 0x96, 0xaf, 0x21, 0x7e, - 0x09, 0xf1, 0x47, 0x06, 0x32, 0xac, 0xaf, 0x6e, 0x3d, 0xeb, 0xec, 0xce, 0x43, 0x17, 0xbb, 0x65, - 0x0f, 0x4d, 0x1a, 0x06, 0x30, 0xd6, 0x7e, 0xfb, 0x17, 0x6e, 0x96, 0xc8, 0x32, 0x57, 0x38, 0x2f, - 0x8e, 0x84, 0xbe, 0x33, 0x88, 0xb2, 0x2f, 0xec, 0x6f, 0xb8, 0xc6, 0x59, 0x54, 0x84, 0x2c, 0x10, - 0x92, 0xe5, 0x4e, 0xe5, 0x48, 0x20, 0xd6, 0xe6, 0x9f, 0x92, 0xe5, 0xf6, 0x00, 0xd7, 0x85, 0xa4, - 0x5c, 0x26, 0x59, 0x1c, 0x70, 0x2a, 0x99, 0xf3, 0xb2, 0x83, 0xba, 0xaf, 0x87, 0x8d, 0xeb, 0xcb, - 0x4f, 0xd8, 0x0c, 0x72, 0xc4, 0xc2, 0xc9, 0x9b, 0x52, 0x34, 0xa1, 0x92, 0xd9, 0x04, 0xd7, 0x66, - 0xf0, 0x8f, 0x09, 0xa9, 0x2d, 0xaf, 0x0e, 0x5a, 0xb0, 0x96, 0x28, 0xc3, 0x00, 0xd7, 0xa3, 0x44, - 0x84, 0x50, 0x64, 0xc6, 0x52, 0x3d, 0x9c, 0x52, 0x8a, 0xf6, 0xa6, 0xaf, 0x1f, 0x1e, 0xce, 0x3d, - 0x74, 0xb2, 0x5b, 0xf6, 0x9c, 0x72, 0x79, 0xfe, 0x3f, 0xad, 0x8f, 0x7e, 0xb2, 0xe1, 0xf7, 0xd5, - 0xc6, 0x45, 0xeb, 0x8d, 0x8b, 0xee, 0x37, 0x2e, 0x3a, 0xdd, 0xba, 0xd6, 0x7a, 0xeb, 0x5a, 0x37, - 0x5b, 0xd7, 0xfa, 0xfd, 0x39, 0x4e, 0xe4, 0xdf, 0x62, 0xea, 0x87, 0x90, 0x12, 0xc8, 0x20, 0x5d, - 0xa8, 0xa9, 0x84, 0x30, 0x23, 0xcf, 0x61, 0x72, 0x91, 0x33, 0x31, 0xad, 0x2a, 0xc5, 0xe0, 0x31, - 0x00, 0x00, 0xff, 0xff, 0x68, 0x16, 0xbb, 0xfb, 0xab, 0x02, 0x00, 0x00, + // 377 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xbf, 0x6f, 0xda, 0x40, + 0x14, 0xc7, 0x7d, 0xb4, 0x45, 0xea, 0x51, 0xa8, 0x6a, 0x75, 0x30, 0x0c, 0x36, 0xed, 0x84, 0x90, + 0xea, 0x2b, 0x65, 0xeb, 0x88, 0x58, 0xda, 0x89, 0x90, 0x2d, 0x8b, 0x75, 0xd8, 0x17, 0xc7, 0x12, + 0xf6, 0xb3, 0xee, 0xce, 0x24, 0xfc, 0x0b, 0x99, 0x32, 0x66, 0xcc, 0x98, 0x91, 0x21, 0x7f, 0x04, + 0x23, 0xca, 0x94, 0x29, 0x89, 0x20, 0x12, 0xf9, 0x33, 0x22, 0xee, 0xce, 0x59, 0xc2, 0x92, 0xc5, + 0x7a, 0x3f, 0xbe, 0x9f, 0xef, 0xf3, 0xbd, 0x87, 0x3d, 0xce, 0x04, 0xe3, 0x33, 0x46, 0x68, 0x11, + 0xca, 0x04, 0x32, 0x32, 0xeb, 0x91, 0x9c, 0x72, 0x9a, 0x0a, 0x3f, 0xe7, 0x20, 0xc1, 0xb6, 0x8d, + 0xc0, 0x37, 0x02, 0x7f, 0xd6, 0x6b, 0x7d, 0xa3, 0x69, 0x92, 0x01, 0x51, 0x5f, 0x2d, 0x6b, 0x7d, + 0x8f, 0x21, 0x06, 0x15, 0x92, 0x5d, 0x64, 0xaa, 0xcd, 0x10, 0x44, 0x0a, 0x22, 0xd0, 0x0d, 0x9d, + 0x98, 0x96, 0x1b, 0x03, 0xc4, 0x53, 0x46, 0x54, 0x36, 0x29, 0x8e, 0x49, 0x54, 0x70, 0xaa, 0x06, + 0xa8, 0xca, 0xcf, 0xa7, 0x0a, 0xae, 0x8e, 0xd4, 0x8f, 0xd8, 0x07, 0xf8, 0xab, 0x19, 0x1e, 0xe4, + 0x8c, 0x27, 0x10, 0x09, 0x07, 0xb5, 0x51, 0xa7, 0xf6, 0xa7, 0xe9, 0x6b, 0x13, 0xbf, 0x34, 0xf1, + 0x87, 0xc6, 0x64, 0x50, 0x5f, 0xde, 0x7b, 0xd6, 0xe5, 0x83, 0x87, 0xae, 0xb7, 0x8b, 0x2e, 0x1a, + 0x37, 0x8c, 0xc1, 0x48, 0xf3, 0xf6, 0x3f, 0x5c, 0xe3, 0x2c, 0x2a, 0x42, 0x16, 0x08, 0xc9, 0x72, + 0xa7, 0xf2, 0x4e, 0x3b, 0xac, 0xe1, 0x43, 0xc9, 0x72, 0xbb, 0x8f, 0xeb, 0x42, 0x52, 0x2e, 0x93, + 0x2c, 0x0e, 0x38, 0x95, 0xcc, 0xf9, 0xd0, 0x46, 0x9d, 0xcf, 0x83, 0xc6, 0xed, 0xcd, 0x2f, 0x6c, + 0x5e, 0x3c, 0x64, 0xe1, 0xf8, 0x4b, 0x29, 0x1a, 0x53, 0xc9, 0x6c, 0x82, 0x6b, 0x53, 0x38, 0x65, + 0x42, 0x6a, 0xe4, 0xe3, 0x5e, 0x04, 0x6b, 0x89, 0x02, 0xfa, 0xb8, 0x1e, 0x25, 0x22, 0x84, 0x22, + 0x33, 0xc8, 0xa7, 0xfd, 0x53, 0x4a, 0xd1, 0x0e, 0xfa, 0xfb, 0xe3, 0xf9, 0xca, 0x43, 0xe7, 0xdb, + 0x45, 0xd7, 0x29, 0xaf, 0x7c, 0xf6, 0x7a, 0x67, 0xbd, 0xdb, 0xc1, 0xff, 0xe5, 0xda, 0x45, 0xab, + 0xb5, 0x8b, 0x1e, 0xd7, 0x2e, 0xba, 0xd8, 0xb8, 0xd6, 0x6a, 0xe3, 0x5a, 0x77, 0x1b, 0xd7, 0x3a, + 0xfa, 0x1d, 0x27, 0xf2, 0xa4, 0x98, 0xf8, 0x21, 0xa4, 0x04, 0x32, 0x48, 0xe7, 0x6a, 0x2b, 0x21, + 0x4c, 0xc9, 0x5b, 0x33, 0x39, 0xcf, 0x99, 0x98, 0x54, 0x95, 0xa2, 0xff, 0x12, 0x00, 0x00, 0xff, + 0xff, 0x28, 0x94, 0xe8, 0xfc, 0x54, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -180,9 +170,6 @@ func (this *Params) Equal(that interface{}) bool { if this.AuctionPeriods != that1.AuctionPeriods { return false } - if this.AuctionDurations != that1.AuctionDurations { - return false - } if this.ReduceStep != that1.ReduceStep { return false } @@ -222,21 +209,21 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.DiscountRate) i = encodeVarintParams(dAtA, i, uint64(len(m.DiscountRate))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } if len(m.LowestRate) > 0 { i -= len(m.LowestRate) copy(dAtA[i:], m.LowestRate) i = encodeVarintParams(dAtA, i, uint64(len(m.LowestRate))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if len(m.StartingRate) > 0 { i -= len(m.StartingRate) copy(dAtA[i:], m.StartingRate) i = encodeVarintParams(dAtA, i, uint64(len(m.StartingRate))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.ReduceStep, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ReduceStep):]) if err1 != nil { @@ -245,22 +232,14 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintParams(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x1a - n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.AuctionDurations, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionDurations):]) + dAtA[i] = 0x12 + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.AuctionPeriods, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionPeriods):]) if err2 != nil { return 0, err2 } i -= n2 i = encodeVarintParams(dAtA, i, uint64(n2)) i-- - dAtA[i] = 0x12 - n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.AuctionPeriods, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionPeriods):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintParams(dAtA, i, uint64(n3)) - i-- dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -284,8 +263,6 @@ func (m *Params) Size() (n int) { _ = l l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionPeriods) n += 1 + l + sovParams(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.AuctionDurations) - n += 1 + l + sovParams(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ReduceStep) n += 1 + l + sovParams(uint64(l)) l = len(m.StartingRate) @@ -372,39 +349,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.AuctionDurations, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ReduceStep", wireType) } @@ -437,7 +381,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StartingRate", wireType) } @@ -469,7 +413,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.StartingRate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LowestRate", wireType) } @@ -501,7 +445,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.LowestRate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DiscountRate", wireType) } diff --git a/x/auction/types/tx.pb.go b/x/auction/types/tx.pb.go index 9b9de54..b9dd3c8 100644 --- a/x/auction/types/tx.pb.go +++ b/x/auction/types/tx.pb.go @@ -136,6 +136,9 @@ type MsgBid struct { AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` // amount defines the amount that the bidder willing to pay. Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + // recive_rate defines the rate compare to the price at the start of the auction + // that the bid is willing to pay + ReciveRate string `protobuf:"bytes,4,opt,name=recive_rate,json=reciveRate,proto3" json:"recive_rate,omitempty"` } func (m *MsgBid) Reset() { *m = MsgBid{} } @@ -192,9 +195,17 @@ func (m *MsgBid) GetAmount() types.Coin { return types.Coin{} } +func (m *MsgBid) GetReciveRate() string { + if m != nil { + return m.ReciveRate + } + return "" +} + // MsgBidResponse defines the response structure for executing a // MsgBid message. type MsgBidResponse struct { + Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` } func (m *MsgBidResponse) Reset() { *m = MsgBidResponse{} } @@ -230,28 +241,33 @@ func (m *MsgBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgBidResponse proto.InternalMessageInfo -// MsgUpdateBid is the Msg/UpdateBid request type. -type MsgUpdateBid struct { - // bidder is the address that submitting the bid entry. - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` +func (m *MsgBidResponse) GetResponse() string { + if m != nil { + return m.Response + } + return "" +} + +// MsgCancelBid is the Msg/CancelBid request type. +type MsgCancelBid struct { + // bid_id is the unique id. + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` // bidding auction id AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - // amount defines the amount that the bidder willing to pay. - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } -func (m *MsgUpdateBid) Reset() { *m = MsgUpdateBid{} } -func (m *MsgUpdateBid) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateBid) ProtoMessage() {} -func (*MsgUpdateBid) Descriptor() ([]byte, []int) { +func (m *MsgCancelBid) Reset() { *m = MsgCancelBid{} } +func (m *MsgCancelBid) String() string { return proto.CompactTextString(m) } +func (*MsgCancelBid) ProtoMessage() {} +func (*MsgCancelBid) Descriptor() ([]byte, []int) { return fileDescriptor_18d11acb13497546, []int{4} } -func (m *MsgUpdateBid) XXX_Unmarshal(b []byte) error { +func (m *MsgCancelBid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCancelBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateBid.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCancelBid.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -261,56 +277,49 @@ func (m *MsgUpdateBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *MsgUpdateBid) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateBid.Merge(m, src) +func (m *MsgCancelBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelBid.Merge(m, src) } -func (m *MsgUpdateBid) XXX_Size() int { +func (m *MsgCancelBid) XXX_Size() int { return m.Size() } -func (m *MsgUpdateBid) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateBid.DiscardUnknown(m) +func (m *MsgCancelBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelBid.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateBid proto.InternalMessageInfo +var xxx_messageInfo_MsgCancelBid proto.InternalMessageInfo -func (m *MsgUpdateBid) GetBidder() string { +func (m *MsgCancelBid) GetBidId() uint64 { if m != nil { - return m.Bidder + return m.BidId } - return "" + return 0 } -func (m *MsgUpdateBid) GetAuctionId() uint64 { +func (m *MsgCancelBid) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *MsgUpdateBid) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - -// MsgUpdateBidResponse defines the response structure for executing a -// MsgUpdateBid message. -type MsgUpdateBidResponse struct { +// MsgCancelBidResponse defines the response structure for executing a +// MsgCancelBid message. +type MsgCancelBidResponse struct { } -func (m *MsgUpdateBidResponse) Reset() { *m = MsgUpdateBidResponse{} } -func (m *MsgUpdateBidResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateBidResponse) ProtoMessage() {} -func (*MsgUpdateBidResponse) Descriptor() ([]byte, []int) { +func (m *MsgCancelBidResponse) Reset() { *m = MsgCancelBidResponse{} } +func (m *MsgCancelBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelBidResponse) ProtoMessage() {} +func (*MsgCancelBidResponse) Descriptor() ([]byte, []int) { return fileDescriptor_18d11acb13497546, []int{5} } -func (m *MsgUpdateBidResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgCancelBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCancelBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateBidResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCancelBidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -320,65 +329,68 @@ func (m *MsgUpdateBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *MsgUpdateBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateBidResponse.Merge(m, src) +func (m *MsgCancelBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelBidResponse.Merge(m, src) } -func (m *MsgUpdateBidResponse) XXX_Size() int { +func (m *MsgCancelBidResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpdateBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateBidResponse.DiscardUnknown(m) +func (m *MsgCancelBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelBidResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateBidResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgCancelBidResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgUpdateParams)(nil), "reserve.auction.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "reserve.auction.v1.MsgUpdateParamsResponse") proto.RegisterType((*MsgBid)(nil), "reserve.auction.v1.MsgBid") proto.RegisterType((*MsgBidResponse)(nil), "reserve.auction.v1.MsgBidResponse") - proto.RegisterType((*MsgUpdateBid)(nil), "reserve.auction.v1.MsgUpdateBid") - proto.RegisterType((*MsgUpdateBidResponse)(nil), "reserve.auction.v1.MsgUpdateBidResponse") + proto.RegisterType((*MsgCancelBid)(nil), "reserve.auction.v1.MsgCancelBid") + proto.RegisterType((*MsgCancelBidResponse)(nil), "reserve.auction.v1.MsgCancelBidResponse") } func init() { proto.RegisterFile("reserve/auction/v1/tx.proto", fileDescriptor_18d11acb13497546) } var fileDescriptor_18d11acb13497546 = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x93, 0xbf, 0x8b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0x17, 0x0d, 0x64, 0x3c, 0xfc, 0xb1, 0x04, 0x93, 0xac, 0xdc, 0x5e, 0x58, 0x0b, - 0x43, 0xe4, 0x76, 0x2e, 0x77, 0x60, 0x71, 0x68, 0xe1, 0x8a, 0x85, 0x42, 0x40, 0x22, 0x22, 0xd8, - 0x9c, 0xb3, 0x3b, 0xc3, 0xde, 0xc0, 0xed, 0xce, 0x32, 0x33, 0x09, 0x97, 0x4e, 0x2c, 0x2d, 0xc4, - 0x3f, 0xc3, 0x32, 0x85, 0xad, 0x60, 0x79, 0x85, 0xc5, 0x61, 0x65, 0x25, 0x92, 0x14, 0xf9, 0x37, - 0x64, 0x76, 0x67, 0x13, 0x2f, 0x26, 0x9e, 0xa5, 0xcd, 0x32, 0x33, 0xdf, 0x37, 0xdf, 0xf7, 0x3e, - 0xef, 0xcd, 0xc2, 0x5b, 0x82, 0x4a, 0x2a, 0x86, 0x14, 0xe1, 0x41, 0xa8, 0x18, 0x4f, 0xd0, 0xb0, - 0x8b, 0xd4, 0x89, 0x97, 0x0a, 0xae, 0xb8, 0x65, 0x19, 0xd1, 0x33, 0xa2, 0x37, 0xec, 0xda, 0x37, - 0x70, 0xcc, 0x12, 0x8e, 0xb2, 0x6f, 0x1e, 0x66, 0xd7, 0x22, 0x1e, 0xf1, 0x6c, 0x89, 0xf4, 0xca, - 0x9c, 0x36, 0x43, 0x2e, 0x63, 0x2e, 0x0f, 0x73, 0x21, 0xdf, 0x18, 0xa9, 0x9e, 0xef, 0x50, 0x2c, - 0x23, 0x9d, 0x2f, 0x96, 0x91, 0x11, 0x1c, 0x23, 0x04, 0x58, 0x52, 0x34, 0xec, 0x06, 0x54, 0xe1, - 0x2e, 0x0a, 0x39, 0x4b, 0x8c, 0xbe, 0xbd, 0xa2, 0xda, 0x14, 0x0b, 0x1c, 0x1b, 0x67, 0xf7, 0x33, - 0x80, 0xd7, 0x7a, 0x32, 0x7a, 0x91, 0x12, 0xac, 0xe8, 0xb3, 0x4c, 0xb1, 0xee, 0xc1, 0x2a, 0x1e, - 0xa8, 0x23, 0x2e, 0x98, 0x1a, 0x35, 0x40, 0x0b, 0xb4, 0xab, 0x7e, 0xe3, 0xdb, 0xa7, 0x9d, 0x9a, - 0x29, 0xe9, 0x21, 0x21, 0x82, 0x4a, 0xf9, 0x5c, 0x09, 0x96, 0x44, 0xfd, 0x45, 0xa8, 0xf5, 0x00, - 0x56, 0x72, 0xef, 0xc6, 0x46, 0x0b, 0xb4, 0xaf, 0xec, 0xd9, 0xde, 0x9f, 0xed, 0xf0, 0xf2, 0x1c, - 0x7e, 0xf5, 0xf4, 0xc7, 0x76, 0xe9, 0xe3, 0x6c, 0xdc, 0x01, 0x7d, 0x73, 0xe9, 0x60, 0xff, 0xed, - 0x6c, 0xdc, 0x59, 0xd8, 0xbd, 0x9b, 0x8d, 0x3b, 0xad, 0xa2, 0xfc, 0x13, 0xc4, 0x05, 0x0e, 0x8f, - 0x29, 0x5a, 0xaa, 0xd5, 0x6d, 0xc2, 0xfa, 0xd2, 0x51, 0x9f, 0xca, 0x94, 0x27, 0x92, 0xba, 0x5f, - 0x00, 0xac, 0xf4, 0x64, 0xe4, 0x33, 0x62, 0xed, 0xc2, 0x4a, 0xc0, 0x08, 0xa1, 0xe2, 0x42, 0x1c, - 0x13, 0x67, 0x6d, 0x41, 0x68, 0x8a, 0x3e, 0x64, 0x24, 0xe3, 0xb9, 0xa4, 0x51, 0xb3, 0x93, 0x27, - 0xc4, 0xba, 0x0f, 0x2b, 0x38, 0xe6, 0x83, 0x44, 0x35, 0xca, 0x19, 0x6a, 0xd3, 0x33, 0x6e, 0x7a, - 0x10, 0x9e, 0x19, 0x84, 0xf7, 0x88, 0xb3, 0xe4, 0x1c, 0x69, 0x7e, 0xe7, 0xe0, 0x8e, 0x26, 0x35, - 0x99, 0x34, 0x66, 0x7d, 0x15, 0xa6, 0xcf, 0x88, 0x7b, 0x1d, 0x5e, 0xcd, 0x57, 0x73, 0xa8, 0xaf, - 0x00, 0x6e, 0xce, 0x81, 0xff, 0x43, 0xb4, 0x9d, 0x25, 0xb4, 0xad, 0xf5, 0x13, 0xd4, 0x80, 0x37, - 0x61, 0xed, 0xf7, 0x7d, 0x81, 0xb9, 0xf7, 0x7e, 0x03, 0x96, 0x7b, 0x32, 0xb2, 0x5e, 0xc3, 0xcd, - 0x73, 0x4f, 0xf3, 0xf6, 0xaa, 0x27, 0xb5, 0xf4, 0x00, 0xec, 0xbb, 0xff, 0x10, 0x54, 0x64, 0xb2, - 0x1e, 0xc3, 0xb2, 0x6e, 0xa3, 0xbd, 0xe6, 0x8e, 0xcf, 0x88, 0xed, 0xae, 0xd7, 0xe6, 0x36, 0x2f, - 0x61, 0x75, 0x31, 0x93, 0xd6, 0x5f, 0x0b, 0xd0, 0x96, 0xed, 0x8b, 0x22, 0x0a, 0x63, 0xfb, 0xf2, - 0x1b, 0xdd, 0x5f, 0xff, 0xe9, 0xe9, 0xc4, 0x01, 0x67, 0x13, 0x07, 0xfc, 0x9c, 0x38, 0xe0, 0xc3, - 0xd4, 0x29, 0x9d, 0x4d, 0x9d, 0xd2, 0xf7, 0xa9, 0x53, 0x7a, 0xb5, 0x1b, 0x31, 0x75, 0x34, 0x08, - 0xbc, 0x90, 0xc7, 0x88, 0x27, 0x3c, 0x1e, 0x65, 0x3f, 0x76, 0xc8, 0x8f, 0xd1, 0xa2, 0xf5, 0xc5, - 0xdf, 0xaf, 0x46, 0x29, 0x95, 0x41, 0x25, 0x8b, 0xd8, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0x1b, - 0x37, 0xe7, 0x3a, 0xcb, 0x04, 0x00, 0x00, + // 592 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xb1, 0x6f, 0xd3, 0x4e, + 0x18, 0x8d, 0x9b, 0x36, 0xfa, 0xe5, 0x5a, 0xf5, 0x27, 0xac, 0x40, 0x1d, 0x23, 0xdc, 0xc8, 0x2c, + 0x51, 0xa0, 0xbe, 0xa6, 0x95, 0x18, 0x22, 0x18, 0x48, 0x61, 0x28, 0x52, 0x24, 0x64, 0x84, 0x90, + 0x58, 0xc2, 0xd9, 0x3e, 0xb9, 0x27, 0xc5, 0xbe, 0xe8, 0xee, 0x12, 0x35, 0x1b, 0x62, 0x64, 0x40, + 0xfc, 0x19, 0x8c, 0x19, 0xba, 0xb2, 0x77, 0xac, 0x3a, 0x31, 0x21, 0x94, 0x0c, 0xd9, 0xf9, 0x0b, + 0x90, 0xef, 0x2e, 0x09, 0x4d, 0x13, 0x85, 0xc5, 0xba, 0xbb, 0xf7, 0xbe, 0xef, 0xde, 0x7b, 0xdf, + 0x19, 0xdc, 0x67, 0x98, 0x63, 0xd6, 0xc7, 0x10, 0xf5, 0x42, 0x41, 0x68, 0x0a, 0xfb, 0x75, 0x28, + 0xce, 0xbd, 0x2e, 0xa3, 0x82, 0x9a, 0xa6, 0x06, 0x3d, 0x0d, 0x7a, 0xfd, 0xba, 0x7d, 0x07, 0x25, + 0x24, 0xa5, 0x50, 0x7e, 0x15, 0xcd, 0x2e, 0xc5, 0x34, 0xa6, 0x72, 0x09, 0xb3, 0x95, 0x3e, 0x2d, + 0x87, 0x94, 0x27, 0x94, 0xb7, 0x15, 0xa0, 0x36, 0x1a, 0xda, 0x53, 0x3b, 0x98, 0xf0, 0x38, 0xbb, + 0x2f, 0xe1, 0xb1, 0x06, 0x1c, 0x0d, 0x04, 0x88, 0x63, 0xd8, 0xaf, 0x07, 0x58, 0xa0, 0x3a, 0x0c, + 0x29, 0x49, 0x35, 0xbe, 0xbf, 0x44, 0x6d, 0x17, 0x31, 0x94, 0xe8, 0xce, 0xee, 0x77, 0x03, 0xfc, + 0xdf, 0xe2, 0xf1, 0xdb, 0x6e, 0x84, 0x04, 0x7e, 0x2d, 0x11, 0xf3, 0x09, 0x28, 0xa2, 0x9e, 0x38, + 0xa3, 0x8c, 0x88, 0x81, 0x65, 0x54, 0x8c, 0x6a, 0xb1, 0x69, 0x5d, 0x5f, 0x1c, 0x94, 0xb4, 0xa4, + 0xe7, 0x51, 0xc4, 0x30, 0xe7, 0x6f, 0x04, 0x23, 0x69, 0xec, 0xcf, 0xa9, 0xe6, 0x33, 0x50, 0x50, + 0xbd, 0xad, 0x8d, 0x8a, 0x51, 0xdd, 0x3e, 0xb2, 0xbd, 0xdb, 0x71, 0x78, 0xea, 0x8e, 0x66, 0xf1, + 0xf2, 0xe7, 0x7e, 0xee, 0xdb, 0x64, 0x58, 0x33, 0x7c, 0x5d, 0xd4, 0x38, 0xfe, 0x34, 0x19, 0xd6, + 0xe6, 0xed, 0x3e, 0x4f, 0x86, 0xb5, 0xca, 0x54, 0xfe, 0x39, 0xa4, 0x0c, 0x85, 0x1d, 0x0c, 0x17, + 0xb4, 0xba, 0x65, 0xb0, 0xb7, 0x70, 0xe4, 0x63, 0xde, 0xa5, 0x29, 0xc7, 0xee, 0x6f, 0x03, 0x14, + 0x5a, 0x3c, 0x6e, 0x92, 0xc8, 0x3c, 0x04, 0x85, 0x80, 0x44, 0x11, 0x66, 0x6b, 0xed, 0x68, 0x9e, + 0xf9, 0x00, 0x00, 0x2d, 0xba, 0x4d, 0x22, 0xe9, 0x67, 0x33, 0xb3, 0x2a, 0x4f, 0x4e, 0x23, 0xf3, + 0x29, 0x28, 0xa0, 0x84, 0xf6, 0x52, 0x61, 0xe5, 0xa5, 0xd5, 0xb2, 0xa7, 0xbb, 0x65, 0x83, 0xf0, + 0xf4, 0x20, 0xbc, 0x13, 0x4a, 0xd2, 0x1b, 0x4e, 0x55, 0x8d, 0x09, 0xc1, 0x36, 0xc3, 0x21, 0xe9, + 0xe3, 0x36, 0x43, 0x02, 0x5b, 0x9b, 0x52, 0xd3, 0xee, 0xf5, 0xc5, 0x01, 0xd0, 0x5d, 0x5e, 0xe0, + 0xd0, 0x07, 0x8a, 0xe2, 0x23, 0x81, 0x1b, 0xd5, 0x2c, 0x1a, 0x2d, 0x2d, 0xcb, 0xc5, 0x9a, 0xe7, + 0x32, 0x1d, 0xac, 0x72, 0xea, 0x3e, 0x06, 0xbb, 0x6a, 0x35, 0x8d, 0xc1, 0xb4, 0xc1, 0x7f, 0x4c, + 0xaf, 0x95, 0x7b, 0x7f, 0xb6, 0x77, 0x05, 0xd8, 0x69, 0xf1, 0xf8, 0x04, 0xa5, 0x21, 0xee, 0x64, + 0x39, 0xdd, 0x95, 0x39, 0x65, 0x8e, 0x0d, 0xe9, 0x78, 0x2b, 0x20, 0xd1, 0x69, 0xb4, 0x26, 0x8c, + 0x86, 0xb7, 0xa0, 0xce, 0x59, 0xaa, 0x6e, 0x76, 0x8b, 0x7b, 0x0f, 0x94, 0xfe, 0xde, 0x4f, 0x95, + 0x1e, 0x7d, 0xd9, 0x00, 0xf9, 0x16, 0x8f, 0xcd, 0x0f, 0x60, 0xe7, 0xc6, 0x7b, 0x7c, 0xb8, 0xec, + 0x1d, 0x2d, 0x4c, 0xdd, 0x7e, 0xf4, 0x0f, 0xa4, 0x59, 0x26, 0x2f, 0x41, 0x3e, 0xb3, 0x6b, 0xaf, + 0xa8, 0x69, 0x92, 0xc8, 0x76, 0x57, 0x63, 0xb3, 0x36, 0xef, 0x40, 0x71, 0x9e, 0x5d, 0x65, 0x45, + 0xc1, 0x8c, 0x61, 0x57, 0xd7, 0x31, 0xa6, 0x8d, 0xed, 0xad, 0x8f, 0xd9, 0x7b, 0x69, 0xbe, 0xba, + 0x1c, 0x39, 0xc6, 0xd5, 0xc8, 0x31, 0x7e, 0x8d, 0x1c, 0xe3, 0xeb, 0xd8, 0xc9, 0x5d, 0x8d, 0x9d, + 0xdc, 0x8f, 0xb1, 0x93, 0x7b, 0x7f, 0x18, 0x13, 0x71, 0xd6, 0x0b, 0xbc, 0x90, 0x26, 0x90, 0xa6, + 0x34, 0x19, 0xc8, 0xbf, 0x39, 0xa4, 0x1d, 0x78, 0x3b, 0x7b, 0x31, 0xe8, 0x62, 0x1e, 0x14, 0x24, + 0xe3, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0x2d, 0xa3, 0x7b, 0xc0, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -398,8 +410,8 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) // Bid defines an operation for submit a bid entry. Bid(ctx context.Context, in *MsgBid, opts ...grpc.CallOption) (*MsgBidResponse, error) - // UpdateBid defines an operation for update an existing bid entry. - UpdateBid(ctx context.Context, in *MsgUpdateBid, opts ...grpc.CallOption) (*MsgUpdateBidResponse, error) + // CancelBid defines an operation for cancel an existing bid entry. + CancelBid(ctx context.Context, in *MsgCancelBid, opts ...grpc.CallOption) (*MsgCancelBidResponse, error) } type msgClient struct { @@ -428,9 +440,9 @@ func (c *msgClient) Bid(ctx context.Context, in *MsgBid, opts ...grpc.CallOption return out, nil } -func (c *msgClient) UpdateBid(ctx context.Context, in *MsgUpdateBid, opts ...grpc.CallOption) (*MsgUpdateBidResponse, error) { - out := new(MsgUpdateBidResponse) - err := c.cc.Invoke(ctx, "/reserve.auction.v1.Msg/UpdateBid", in, out, opts...) +func (c *msgClient) CancelBid(ctx context.Context, in *MsgCancelBid, opts ...grpc.CallOption) (*MsgCancelBidResponse, error) { + out := new(MsgCancelBidResponse) + err := c.cc.Invoke(ctx, "/reserve.auction.v1.Msg/CancelBid", in, out, opts...) if err != nil { return nil, err } @@ -444,8 +456,8 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) // Bid defines an operation for submit a bid entry. Bid(context.Context, *MsgBid) (*MsgBidResponse, error) - // UpdateBid defines an operation for update an existing bid entry. - UpdateBid(context.Context, *MsgUpdateBid) (*MsgUpdateBidResponse, error) + // CancelBid defines an operation for cancel an existing bid entry. + CancelBid(context.Context, *MsgCancelBid) (*MsgCancelBidResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -458,8 +470,8 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP func (*UnimplementedMsgServer) Bid(ctx context.Context, req *MsgBid) (*MsgBidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Bid not implemented") } -func (*UnimplementedMsgServer) UpdateBid(ctx context.Context, req *MsgUpdateBid) (*MsgUpdateBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateBid not implemented") +func (*UnimplementedMsgServer) CancelBid(ctx context.Context, req *MsgCancelBid) (*MsgCancelBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelBid not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -502,20 +514,20 @@ func _Msg_Bid_Handler(srv interface{}, ctx context.Context, dec func(interface{} return interceptor(ctx, in, info, handler) } -func _Msg_UpdateBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateBid) +func _Msg_CancelBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelBid) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UpdateBid(ctx, in) + return srv.(MsgServer).CancelBid(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/reserve.auction.v1.Msg/UpdateBid", + FullMethod: "/reserve.auction.v1.Msg/CancelBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateBid(ctx, req.(*MsgUpdateBid)) + return srv.(MsgServer).CancelBid(ctx, req.(*MsgCancelBid)) } return interceptor(ctx, in, info, handler) } @@ -533,8 +545,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_Bid_Handler, }, { - MethodName: "UpdateBid", - Handler: _Msg_UpdateBid_Handler, + MethodName: "CancelBid", + Handler: _Msg_CancelBid_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -624,6 +636,13 @@ func (m *MsgBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ReciveRate) > 0 { + i -= len(m.ReciveRate) + copy(dAtA[i:], m.ReciveRate) + i = encodeVarintTx(dAtA, i, uint64(len(m.ReciveRate))) + i-- + dAtA[i] = 0x22 + } { size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -669,10 +688,17 @@ func (m *MsgBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Response) > 0 { + i -= len(m.Response) + copy(dAtA[i:], m.Response) + i = encodeVarintTx(dAtA, i, uint64(len(m.Response))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *MsgUpdateBid) Marshal() (dAtA []byte, err error) { +func (m *MsgCancelBid) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -682,42 +708,30 @@ func (m *MsgUpdateBid) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateBid) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCancelBid) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCancelBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a if m.AuctionId != 0 { i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) i-- dAtA[i] = 0x10 } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + if m.BidId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BidId)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *MsgUpdateBidResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgCancelBidResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -727,12 +741,12 @@ func (m *MsgUpdateBidResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateBidResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCancelBidResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCancelBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -790,6 +804,10 @@ func (m *MsgBid) Size() (n int) { } l = m.Amount.Size() n += 1 + l + sovTx(uint64(l)) + l = len(m.ReciveRate) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -799,28 +817,29 @@ func (m *MsgBidResponse) Size() (n int) { } var l int _ = l + l = len(m.Response) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } -func (m *MsgUpdateBid) Size() (n int) { +func (m *MsgCancelBid) 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)) + if m.BidId != 0 { + n += 1 + sovTx(uint64(m.BidId)) } if m.AuctionId != 0 { n += 1 + sovTx(uint64(m.AuctionId)) } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgUpdateBidResponse) Size() (n int) { +func (m *MsgCancelBidResponse) Size() (n int) { if m == nil { return 0 } @@ -1113,6 +1132,38 @@ func (m *MsgBid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReciveRate", 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.ReciveRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1163,6 +1214,38 @@ func (m *MsgBidResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", 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.Response = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1184,7 +1267,7 @@ func (m *MsgBidResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateBid) Unmarshal(dAtA []byte) error { +func (m *MsgCancelBid) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1207,17 +1290,17 @@ func (m *MsgUpdateBid) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateBid: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCancelBid: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateBid: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCancelBid: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) } - var stringLen uint64 + m.BidId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1227,24 +1310,11 @@ func (m *MsgUpdateBid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.BidId |= 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 != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) @@ -1264,39 +1334,6 @@ func (m *MsgUpdateBid) Unmarshal(dAtA []byte) error { break } } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1318,7 +1355,7 @@ func (m *MsgUpdateBid) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateBidResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCancelBidResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1341,10 +1378,10 @@ func (m *MsgUpdateBidResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateBidResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCancelBidResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCancelBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From b8db01899814dc6a06870285853a827da60a94d4 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 16 Sep 2024 11:26:37 +0700 Subject: [PATCH 3/4] add vault interface --- x/auction/keeper/abci.go | 40 +++++++++++++++++++++++------ x/auction/keeper/auction.go | 25 +++++++++++++++--- x/auction/keeper/keeper.go | 11 ++++++-- x/auction/module/module.go | 10 ++++---- x/auction/types/expected_keepers.go | 13 ++++++++++ 5 files changed, 80 insertions(+), 19 deletions(-) diff --git a/x/auction/keeper/abci.go b/x/auction/keeper/abci.go index 18a214a..ce461d4 100644 --- a/x/auction/keeper/abci.go +++ b/x/auction/keeper/abci.go @@ -18,13 +18,28 @@ func (k *Keeper) BeginBlocker(ctx context.Context) error { } // check if has reached the next auction periods - if lastAuctionPeriods.Add(params.AuctionPeriods).Before(currentTime) { - return nil - } + if lastAuctionPeriods.Add(params.AuctionPeriods).After(currentTime) { + // update latest auction period + k.lastestAuctionPeriod.Set(ctx, lastAuctionPeriods.Add(params.AuctionPeriods)) + + liquidatedVaults, err := k.vaultKeeper.GetLiquidatedVaults(ctx) + if err != nil { + return err + } - k.lastestAuctionPeriod.Set(ctx, lastAuctionPeriods.Add(params.AuctionPeriods)) + // create new auction for this vault + for _, vault := range liquidatedVaults { + auction, err := k.NewAuction(ctx, currentTime, vault.InitialPrice, vault.Collatheral, vault.Collatheral) + if err != nil { + return err + } - // TODO: check vault module for liquidate vault + err = k.Auctions.Set(ctx, auction.AuctionId, *auction) + if err != nil { + return err + } + } + } // loop through all auctions err = k.Auctions.Walk(ctx, nil, func(auctionId uint64, auction types.Auction) (bool, error) { @@ -35,16 +50,25 @@ func (k *Keeper) BeginBlocker(ctx context.Context) error { needCleanup := false if auction.Status == types.AuctionStatus_AUCTION_STATUS_FINISHED { - // TODO: notify vault that the debt goal has been reached + err = k.vaultKeeper.NotifyVault(ctx, auction.TokenRaised, auction.Item, true) + if err != nil { + return true, err + } needCleanup = true // skip other logic } else if auction.Status == types.AuctionStatus_AUCTION_STATUS_OUT_OF_COLLATHERAL { - // TODO: notify vault out of collatheral to auction + err = k.vaultKeeper.NotifyVault(ctx, auction.TokenRaised, auction.Item, false) + if err != nil { + return true, err + } needCleanup = true } else if auction.EndTime.After(currentTime) { - // TODO: notify vault that the auction has ended + err = k.vaultKeeper.NotifyVault(ctx, auction.TokenRaised, auction.Item, false) + if err != nil { + return true, err + } needCleanup = true } diff --git a/x/auction/keeper/auction.go b/x/auction/keeper/auction.go index b3ee8a6..5283170 100644 --- a/x/auction/keeper/auction.go +++ b/x/auction/keeper/auction.go @@ -2,30 +2,47 @@ package keeper import ( "context" + "fmt" "time" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/onomyprotocol/reserve/x/auction/types" ) func (k Keeper) NewAuction(ctx context.Context, - startTime, currentTime time.Time, + startTime time.Time, initialPrice, item, targetGoal sdk.Coin, - startingRate string, ) (*types.Auction, error) { auctionId, err := k.AuctionIdSeq.Next(ctx) if err != nil { return nil, err } + params := k.GetParams(ctx) + + startingRate, err := sdkmath.LegacyNewDecFromStr(params.StartingRate) + if err != nil { + return nil, fmt.Errorf("invalid starting rate params: %v", err) + } + lowestRate, err := sdkmath.LegacyNewDecFromStr(params.LowestRate) + if err != nil { + return nil, fmt.Errorf("invalid lowest rate params: %v", err) + } + discountRate, err := sdkmath.LegacyNewDecFromStr(params.DiscountRate) + if err != nil { + return nil, fmt.Errorf("invalid discount rate params: %v", err) + } + endTime := startTime.Add(time.Duration(startingRate.Sub(lowestRate).Quo(discountRate).Ceil().RoundInt64() * int64(params.ReduceStep))) return &types.Auction{ StartTime: startTime, + EndTime: endTime, AuctionId: auctionId, InitialPrice: initialPrice, Item: item, - CurrentRate: startingRate, - LastDiscountTime: currentTime, + CurrentRate: params.StartingRate, + LastDiscountTime: startTime, Status: types.AuctionStatus_AUCTION_STATUS_ACTIVE, TargetGoal: targetGoal, }, nil diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 7cca3d9..fa6bc35 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -22,8 +22,9 @@ type ( logger log.Logger // keepers - authKeeper types.AccountKeeper - bankKeeper types.BankKeeper + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper + vaultKeeper types.VaultKeeper // the address capable of executing a MsgUpdateParams message. Typically, this // should be the x/gov module account. @@ -51,6 +52,9 @@ type ( func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, + ak types.AccountKeeper, + bk types.BankKeeper, + vk types.VaultKeeper, logger log.Logger, authority string, @@ -65,6 +69,9 @@ func NewKeeper( storeService: storeService, authority: authority, logger: logger, + authKeeper: ak, + bankKeeper: bk, + vaultKeeper: vk, AuctionIdSeq: collections.NewSequence(sb, types.AuctionIdSeqPrefix, "auction_id_sequence"), BidIdSeq: collections.NewMap(sb, types.BidIdSeqPrefix, "bid_id_sequence", collections.Uint64Key, collections.Uint64Value), Auctions: collections.NewMap(sb, types.AuctionsPrefix, "auctions", collections.Uint64Key, codec.CollValue[types.Auction](cdc)), diff --git a/x/auction/module/module.go b/x/auction/module/module.go index 382dc89..e31ec66 100644 --- a/x/auction/module/module.go +++ b/x/auction/module/module.go @@ -99,9 +99,7 @@ func (a AppModuleBasic) GetTxCmd() *cobra.Command { type AppModule struct { AppModuleBasic - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper + keeper keeper.Keeper } func NewAppModule( @@ -113,8 +111,6 @@ func NewAppModule( return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, } } @@ -182,6 +178,7 @@ type ModuleInputs struct { AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper + VaultKeeper types.VaultKeeper } type ModuleOutputs struct { @@ -200,6 +197,9 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { k := keeper.NewKeeper( in.Cdc, in.StoreService, + in.AccountKeeper, + in.BankKeeper, + in.VaultKeeper, in.Logger, authority.String(), ) diff --git a/x/auction/types/expected_keepers.go b/x/auction/types/expected_keepers.go index c930b13..2953a3e 100644 --- a/x/auction/types/expected_keepers.go +++ b/x/auction/types/expected_keepers.go @@ -7,6 +7,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +type LiquidateVaults struct { + VaultId uint64 + TargetGoal sdk.Coin + Collatheral sdk.Coin + InitialPrice sdk.Coin +} + // AccountKeeper defines the expected interface for the Account module. type AccountKeeper interface { AddressCodec() addresscodec.Codec @@ -30,3 +37,9 @@ type ParamSubspace interface { Get(context.Context, []byte, interface{}) Set(context.Context, []byte, interface{}) } + +type VaultKeeper interface { + GetLiquidatedVaults(ctx context.Context) ([]LiquidateVaults, error) + + NotifyVault(ctx context.Context, tokenRaised, collatheralUnsold sdk.Coin, isReachedGoal bool) error +} From 5cf915fd75e6a407d98f7515715dcb50c8c95658 Mon Sep 17 00:00:00 2001 From: vuong177 Date: Tue, 17 Sep 2024 10:27:15 +0700 Subject: [PATCH 4/4] proto fix --- api/reserve/auction/module/module.pulsar.go | 579 +++ api/reserve/auction/v1/auction.pulsar.go | 3509 +++++++++++++++++++ api/reserve/auction/v1/genesis.pulsar.go | 905 +++++ api/reserve/auction/v1/params.pulsar.go | 928 +++++ api/reserve/auction/v1/tx.pulsar.go | 3206 +++++++++++++++++ api/reserve/auction/v1/tx_grpc.pb.go | 209 ++ api/reserve/oracle/genesis.pulsar.go | 9 +- api/reserve/oracle/module/module.pulsar.go | 46 +- api/reserve/oracle/packet.pulsar.go | 7 +- api/reserve/oracle/params.pulsar.go | 9 +- api/reserve/oracle/query.pulsar.go | 65 +- api/reserve/oracle/query_grpc.pb.go | 33 +- api/reserve/oracle/tx.pulsar.go | 12 +- api/reserve/oracle/tx_grpc.pb.go | 33 +- go.mod | 4 +- proto/buf.lock | 33 +- 16 files changed, 9476 insertions(+), 111 deletions(-) create mode 100644 api/reserve/auction/module/module.pulsar.go create mode 100644 api/reserve/auction/v1/auction.pulsar.go create mode 100644 api/reserve/auction/v1/genesis.pulsar.go create mode 100644 api/reserve/auction/v1/params.pulsar.go create mode 100644 api/reserve/auction/v1/tx.pulsar.go create mode 100644 api/reserve/auction/v1/tx_grpc.pb.go diff --git a/api/reserve/auction/module/module.pulsar.go b/api/reserve/auction/module/module.pulsar.go new file mode 100644 index 0000000..e798837 --- /dev/null +++ b/api/reserve/auction/module/module.pulsar.go @@ -0,0 +1,579 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package module + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_module_module_proto_init() + md_Module = File_reserve_auction_module_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_module_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.module.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.module.Module")) + } + panic(fmt.Errorf("message reserve.auction.module.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.module.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.module.Module")) + } + panic(fmt.Errorf("message reserve.auction.module.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.module.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.module.Module")) + } + panic(fmt.Errorf("message reserve.auction.module.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.module.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.module.Module")) + } + panic(fmt.Errorf("message reserve.auction.module.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.module.Module.authority": + panic(fmt.Errorf("field authority of message reserve.auction.module.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.module.Module")) + } + panic(fmt.Errorf("message reserve.auction.module.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.module.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.module.Module")) + } + panic(fmt.Errorf("message reserve.auction.module.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.module.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: reserve/auction/module/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object for the module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the + // governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_module_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_reserve_auction_module_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_reserve_auction_module_module_proto protoreflect.FileDescriptor + +var file_reserve_auction_module_module_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x1a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5a, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x32, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2c, 0x0a, + 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x6f, 0x6d, + 0x79, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x2f, 0x78, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xcc, 0x01, 0x0a, 0x1a, + 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x52, 0x41, 0x4d, 0xaa, 0x02, 0x16, 0x52, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0xca, 0x02, 0x16, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, 0x22, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x18, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_reserve_auction_module_module_proto_rawDescOnce sync.Once + file_reserve_auction_module_module_proto_rawDescData = file_reserve_auction_module_module_proto_rawDesc +) + +func file_reserve_auction_module_module_proto_rawDescGZIP() []byte { + file_reserve_auction_module_module_proto_rawDescOnce.Do(func() { + file_reserve_auction_module_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_reserve_auction_module_module_proto_rawDescData) + }) + return file_reserve_auction_module_module_proto_rawDescData +} + +var file_reserve_auction_module_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_reserve_auction_module_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: reserve.auction.module.Module +} +var file_reserve_auction_module_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_reserve_auction_module_module_proto_init() } +func file_reserve_auction_module_module_proto_init() { + if File_reserve_auction_module_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_reserve_auction_module_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reserve_auction_module_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_reserve_auction_module_module_proto_goTypes, + DependencyIndexes: file_reserve_auction_module_module_proto_depIdxs, + MessageInfos: file_reserve_auction_module_module_proto_msgTypes, + }.Build() + File_reserve_auction_module_module_proto = out.File + file_reserve_auction_module_module_proto_rawDesc = nil + file_reserve_auction_module_module_proto_goTypes = nil + file_reserve_auction_module_module_proto_depIdxs = nil +} diff --git a/api/reserve/auction/v1/auction.pulsar.go b/api/reserve/auction/v1/auction.pulsar.go new file mode 100644 index 0000000..34bf845 --- /dev/null +++ b/api/reserve/auction/v1/auction.pulsar.go @@ -0,0 +1,3509 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package auctionv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Auction protoreflect.MessageDescriptor + fd_Auction_start_time protoreflect.FieldDescriptor + fd_Auction_end_time protoreflect.FieldDescriptor + fd_Auction_auction_id protoreflect.FieldDescriptor + fd_Auction_initial_price protoreflect.FieldDescriptor + fd_Auction_item protoreflect.FieldDescriptor + fd_Auction_current_rate protoreflect.FieldDescriptor + fd_Auction_last_discount_time protoreflect.FieldDescriptor + fd_Auction_token_raised protoreflect.FieldDescriptor + fd_Auction_status protoreflect.FieldDescriptor + fd_Auction_target_goal protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_auction_proto_init() + md_Auction = File_reserve_auction_v1_auction_proto.Messages().ByName("Auction") + fd_Auction_start_time = md_Auction.Fields().ByName("start_time") + fd_Auction_end_time = md_Auction.Fields().ByName("end_time") + fd_Auction_auction_id = md_Auction.Fields().ByName("auction_id") + fd_Auction_initial_price = md_Auction.Fields().ByName("initial_price") + fd_Auction_item = md_Auction.Fields().ByName("item") + fd_Auction_current_rate = md_Auction.Fields().ByName("current_rate") + fd_Auction_last_discount_time = md_Auction.Fields().ByName("last_discount_time") + fd_Auction_token_raised = md_Auction.Fields().ByName("token_raised") + fd_Auction_status = md_Auction.Fields().ByName("status") + fd_Auction_target_goal = md_Auction.Fields().ByName("target_goal") +} + +var _ protoreflect.Message = (*fastReflection_Auction)(nil) + +type fastReflection_Auction Auction + +func (x *Auction) ProtoReflect() protoreflect.Message { + return (*fastReflection_Auction)(x) +} + +func (x *Auction) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Auction_messageType fastReflection_Auction_messageType +var _ protoreflect.MessageType = fastReflection_Auction_messageType{} + +type fastReflection_Auction_messageType struct{} + +func (x fastReflection_Auction_messageType) Zero() protoreflect.Message { + return (*fastReflection_Auction)(nil) +} +func (x fastReflection_Auction_messageType) New() protoreflect.Message { + return new(fastReflection_Auction) +} +func (x fastReflection_Auction_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Auction +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Auction) Descriptor() protoreflect.MessageDescriptor { + return md_Auction +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Auction) Type() protoreflect.MessageType { + return _fastReflection_Auction_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Auction) New() protoreflect.Message { + return new(fastReflection_Auction) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Auction) Interface() protoreflect.ProtoMessage { + return (*Auction)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.StartTime != nil { + value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + if !f(fd_Auction_start_time, value) { + return + } + } + if x.EndTime != nil { + value := protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) + if !f(fd_Auction_end_time, value) { + return + } + } + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_Auction_auction_id, value) { + return + } + } + if x.InitialPrice != nil { + value := protoreflect.ValueOfMessage(x.InitialPrice.ProtoReflect()) + if !f(fd_Auction_initial_price, value) { + return + } + } + if x.Item != nil { + value := protoreflect.ValueOfMessage(x.Item.ProtoReflect()) + if !f(fd_Auction_item, value) { + return + } + } + if x.CurrentRate != "" { + value := protoreflect.ValueOfString(x.CurrentRate) + if !f(fd_Auction_current_rate, value) { + return + } + } + if x.LastDiscountTime != nil { + value := protoreflect.ValueOfMessage(x.LastDiscountTime.ProtoReflect()) + if !f(fd_Auction_last_discount_time, value) { + return + } + } + if x.TokenRaised != nil { + value := protoreflect.ValueOfMessage(x.TokenRaised.ProtoReflect()) + if !f(fd_Auction_token_raised, value) { + return + } + } + if x.Status != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Status)) + if !f(fd_Auction_status, value) { + return + } + } + if x.TargetGoal != nil { + value := protoreflect.ValueOfMessage(x.TargetGoal.ProtoReflect()) + if !f(fd_Auction_target_goal, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Auction) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.Auction.start_time": + return x.StartTime != nil + case "reserve.auction.v1.Auction.end_time": + return x.EndTime != nil + case "reserve.auction.v1.Auction.auction_id": + return x.AuctionId != uint64(0) + case "reserve.auction.v1.Auction.initial_price": + return x.InitialPrice != nil + case "reserve.auction.v1.Auction.item": + return x.Item != nil + case "reserve.auction.v1.Auction.current_rate": + return x.CurrentRate != "" + case "reserve.auction.v1.Auction.last_discount_time": + return x.LastDiscountTime != nil + case "reserve.auction.v1.Auction.token_raised": + return x.TokenRaised != nil + case "reserve.auction.v1.Auction.status": + return x.Status != 0 + case "reserve.auction.v1.Auction.target_goal": + return x.TargetGoal != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Auction")) + } + panic(fmt.Errorf("message reserve.auction.v1.Auction does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Auction) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.Auction.start_time": + x.StartTime = nil + case "reserve.auction.v1.Auction.end_time": + x.EndTime = nil + case "reserve.auction.v1.Auction.auction_id": + x.AuctionId = uint64(0) + case "reserve.auction.v1.Auction.initial_price": + x.InitialPrice = nil + case "reserve.auction.v1.Auction.item": + x.Item = nil + case "reserve.auction.v1.Auction.current_rate": + x.CurrentRate = "" + case "reserve.auction.v1.Auction.last_discount_time": + x.LastDiscountTime = nil + case "reserve.auction.v1.Auction.token_raised": + x.TokenRaised = nil + case "reserve.auction.v1.Auction.status": + x.Status = 0 + case "reserve.auction.v1.Auction.target_goal": + x.TargetGoal = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Auction")) + } + panic(fmt.Errorf("message reserve.auction.v1.Auction does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Auction) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.Auction.start_time": + value := x.StartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Auction.end_time": + value := x.EndTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Auction.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "reserve.auction.v1.Auction.initial_price": + value := x.InitialPrice + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Auction.item": + value := x.Item + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Auction.current_rate": + value := x.CurrentRate + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.Auction.last_discount_time": + value := x.LastDiscountTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Auction.token_raised": + value := x.TokenRaised + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Auction.status": + value := x.Status + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "reserve.auction.v1.Auction.target_goal": + value := x.TargetGoal + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Auction")) + } + panic(fmt.Errorf("message reserve.auction.v1.Auction does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Auction) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.Auction.start_time": + x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "reserve.auction.v1.Auction.end_time": + x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) + case "reserve.auction.v1.Auction.auction_id": + x.AuctionId = value.Uint() + case "reserve.auction.v1.Auction.initial_price": + x.InitialPrice = value.Message().Interface().(*v1beta1.Coin) + case "reserve.auction.v1.Auction.item": + x.Item = value.Message().Interface().(*v1beta1.Coin) + case "reserve.auction.v1.Auction.current_rate": + x.CurrentRate = value.Interface().(string) + case "reserve.auction.v1.Auction.last_discount_time": + x.LastDiscountTime = value.Message().Interface().(*timestamppb.Timestamp) + case "reserve.auction.v1.Auction.token_raised": + x.TokenRaised = value.Message().Interface().(*v1beta1.Coin) + case "reserve.auction.v1.Auction.status": + x.Status = (AuctionStatus)(value.Enum()) + case "reserve.auction.v1.Auction.target_goal": + x.TargetGoal = value.Message().Interface().(*v1beta1.Coin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Auction")) + } + panic(fmt.Errorf("message reserve.auction.v1.Auction does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Auction) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Auction.start_time": + if x.StartTime == nil { + x.StartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + case "reserve.auction.v1.Auction.end_time": + if x.EndTime == nil { + x.EndTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) + case "reserve.auction.v1.Auction.initial_price": + if x.InitialPrice == nil { + x.InitialPrice = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.InitialPrice.ProtoReflect()) + case "reserve.auction.v1.Auction.item": + if x.Item == nil { + x.Item = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Item.ProtoReflect()) + case "reserve.auction.v1.Auction.last_discount_time": + if x.LastDiscountTime == nil { + x.LastDiscountTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.LastDiscountTime.ProtoReflect()) + case "reserve.auction.v1.Auction.token_raised": + if x.TokenRaised == nil { + x.TokenRaised = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.TokenRaised.ProtoReflect()) + case "reserve.auction.v1.Auction.target_goal": + if x.TargetGoal == nil { + x.TargetGoal = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.TargetGoal.ProtoReflect()) + case "reserve.auction.v1.Auction.auction_id": + panic(fmt.Errorf("field auction_id of message reserve.auction.v1.Auction is not mutable")) + case "reserve.auction.v1.Auction.current_rate": + panic(fmt.Errorf("field current_rate of message reserve.auction.v1.Auction is not mutable")) + case "reserve.auction.v1.Auction.status": + panic(fmt.Errorf("field status of message reserve.auction.v1.Auction is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Auction")) + } + panic(fmt.Errorf("message reserve.auction.v1.Auction does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Auction) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Auction.start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Auction.end_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Auction.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "reserve.auction.v1.Auction.initial_price": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Auction.item": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Auction.current_rate": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.Auction.last_discount_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Auction.token_raised": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Auction.status": + return protoreflect.ValueOfEnum(0) + case "reserve.auction.v1.Auction.target_goal": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Auction")) + } + panic(fmt.Errorf("message reserve.auction.v1.Auction does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Auction) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.Auction", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Auction) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Auction) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Auction) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Auction) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.StartTime != nil { + l = options.Size(x.StartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.EndTime != nil { + l = options.Size(x.EndTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + if x.InitialPrice != nil { + l = options.Size(x.InitialPrice) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Item != nil { + l = options.Size(x.Item) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CurrentRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.LastDiscountTime != nil { + l = options.Size(x.LastDiscountTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TokenRaised != nil { + l = options.Size(x.TokenRaised) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + if x.TargetGoal != nil { + l = options.Size(x.TargetGoal) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Auction) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.TargetGoal != nil { + encoded, err := options.Marshal(x.TargetGoal) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x52 + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x48 + } + if x.TokenRaised != nil { + encoded, err := options.Marshal(x.TokenRaised) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x42 + } + if x.LastDiscountTime != nil { + encoded, err := options.Marshal(x.LastDiscountTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if len(x.CurrentRate) > 0 { + i -= len(x.CurrentRate) + copy(dAtA[i:], x.CurrentRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentRate))) + i-- + dAtA[i] = 0x32 + } + if x.Item != nil { + encoded, err := options.Marshal(x.Item) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if x.InitialPrice != nil { + encoded, err := options.Marshal(x.InitialPrice) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + i-- + dAtA[i] = 0x18 + } + if x.EndTime != nil { + encoded, err := options.Marshal(x.EndTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.StartTime != nil { + encoded, err := options.Marshal(x.StartTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Auction) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Auction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Auction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.StartTime == nil { + x.StartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.EndTime == nil { + x.EndTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.EndTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + x.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.InitialPrice == nil { + x.InitialPrice = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitialPrice); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Item", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Item == nil { + x.Item = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Item); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CurrentRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastDiscountTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.LastDiscountTime == nil { + x.LastDiscountTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LastDiscountTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TokenRaised", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TokenRaised == nil { + x.TokenRaised = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TokenRaised); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= AuctionStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TargetGoal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TargetGoal == nil { + x.TargetGoal = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TargetGoal); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Bid protoreflect.MessageDescriptor + fd_Bid_bid_id protoreflect.FieldDescriptor + fd_Bid_bidder protoreflect.FieldDescriptor + fd_Bid_amount protoreflect.FieldDescriptor + fd_Bid_recive_rate protoreflect.FieldDescriptor + fd_Bid_max_receive protoreflect.FieldDescriptor + fd_Bid_is_handle protoreflect.FieldDescriptor + fd_Bid_index protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_auction_proto_init() + md_Bid = File_reserve_auction_v1_auction_proto.Messages().ByName("Bid") + fd_Bid_bid_id = md_Bid.Fields().ByName("bid_id") + fd_Bid_bidder = md_Bid.Fields().ByName("bidder") + fd_Bid_amount = md_Bid.Fields().ByName("amount") + fd_Bid_recive_rate = md_Bid.Fields().ByName("recive_rate") + fd_Bid_max_receive = md_Bid.Fields().ByName("max_receive") + fd_Bid_is_handle = md_Bid.Fields().ByName("is_handle") + fd_Bid_index = md_Bid.Fields().ByName("index") +} + +var _ protoreflect.Message = (*fastReflection_Bid)(nil) + +type fastReflection_Bid Bid + +func (x *Bid) ProtoReflect() protoreflect.Message { + return (*fastReflection_Bid)(x) +} + +func (x *Bid) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Bid_messageType fastReflection_Bid_messageType +var _ protoreflect.MessageType = fastReflection_Bid_messageType{} + +type fastReflection_Bid_messageType struct{} + +func (x fastReflection_Bid_messageType) Zero() protoreflect.Message { + return (*fastReflection_Bid)(nil) +} +func (x fastReflection_Bid_messageType) New() protoreflect.Message { + return new(fastReflection_Bid) +} +func (x fastReflection_Bid_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Bid +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Bid) Descriptor() protoreflect.MessageDescriptor { + return md_Bid +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Bid) Type() protoreflect.MessageType { + return _fastReflection_Bid_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Bid) New() protoreflect.Message { + return new(fastReflection_Bid) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Bid) Interface() protoreflect.ProtoMessage { + return (*Bid)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Bid) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BidId != uint64(0) { + value := protoreflect.ValueOfUint64(x.BidId) + if !f(fd_Bid_bid_id, value) { + return + } + } + if x.Bidder != "" { + value := protoreflect.ValueOfString(x.Bidder) + if !f(fd_Bid_bidder, value) { + return + } + } + if x.Amount != nil { + value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + if !f(fd_Bid_amount, value) { + return + } + } + if x.ReciveRate != "" { + value := protoreflect.ValueOfString(x.ReciveRate) + if !f(fd_Bid_recive_rate, value) { + return + } + } + if x.MaxReceive != nil { + value := protoreflect.ValueOfMessage(x.MaxReceive.ProtoReflect()) + if !f(fd_Bid_max_receive, value) { + return + } + } + if x.IsHandle != false { + value := protoreflect.ValueOfBool(x.IsHandle) + if !f(fd_Bid_is_handle, value) { + return + } + } + if x.Index != uint64(0) { + value := protoreflect.ValueOfUint64(x.Index) + if !f(fd_Bid_index, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Bid) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.Bid.bid_id": + return x.BidId != uint64(0) + case "reserve.auction.v1.Bid.bidder": + return x.Bidder != "" + case "reserve.auction.v1.Bid.amount": + return x.Amount != nil + case "reserve.auction.v1.Bid.recive_rate": + return x.ReciveRate != "" + case "reserve.auction.v1.Bid.max_receive": + return x.MaxReceive != nil + case "reserve.auction.v1.Bid.is_handle": + return x.IsHandle != false + case "reserve.auction.v1.Bid.index": + return x.Index != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bid")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bid does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bid) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.Bid.bid_id": + x.BidId = uint64(0) + case "reserve.auction.v1.Bid.bidder": + x.Bidder = "" + case "reserve.auction.v1.Bid.amount": + x.Amount = nil + case "reserve.auction.v1.Bid.recive_rate": + x.ReciveRate = "" + case "reserve.auction.v1.Bid.max_receive": + x.MaxReceive = nil + case "reserve.auction.v1.Bid.is_handle": + x.IsHandle = false + case "reserve.auction.v1.Bid.index": + x.Index = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bid")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bid does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Bid) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.Bid.bid_id": + value := x.BidId + return protoreflect.ValueOfUint64(value) + case "reserve.auction.v1.Bid.bidder": + value := x.Bidder + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.Bid.amount": + value := x.Amount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Bid.recive_rate": + value := x.ReciveRate + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.Bid.max_receive": + value := x.MaxReceive + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Bid.is_handle": + value := x.IsHandle + return protoreflect.ValueOfBool(value) + case "reserve.auction.v1.Bid.index": + value := x.Index + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bid")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bid does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bid) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.Bid.bid_id": + x.BidId = value.Uint() + case "reserve.auction.v1.Bid.bidder": + x.Bidder = value.Interface().(string) + case "reserve.auction.v1.Bid.amount": + x.Amount = value.Message().Interface().(*v1beta1.Coin) + case "reserve.auction.v1.Bid.recive_rate": + x.ReciveRate = value.Interface().(string) + case "reserve.auction.v1.Bid.max_receive": + x.MaxReceive = value.Message().Interface().(*v1beta1.Coin) + case "reserve.auction.v1.Bid.is_handle": + x.IsHandle = value.Bool() + case "reserve.auction.v1.Bid.index": + x.Index = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bid")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bid does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bid) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Bid.amount": + if x.Amount == nil { + x.Amount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + case "reserve.auction.v1.Bid.max_receive": + if x.MaxReceive == nil { + x.MaxReceive = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.MaxReceive.ProtoReflect()) + case "reserve.auction.v1.Bid.bid_id": + panic(fmt.Errorf("field bid_id of message reserve.auction.v1.Bid is not mutable")) + case "reserve.auction.v1.Bid.bidder": + panic(fmt.Errorf("field bidder of message reserve.auction.v1.Bid is not mutable")) + case "reserve.auction.v1.Bid.recive_rate": + panic(fmt.Errorf("field recive_rate of message reserve.auction.v1.Bid is not mutable")) + case "reserve.auction.v1.Bid.is_handle": + panic(fmt.Errorf("field is_handle of message reserve.auction.v1.Bid is not mutable")) + case "reserve.auction.v1.Bid.index": + panic(fmt.Errorf("field index of message reserve.auction.v1.Bid is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bid")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bid does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Bid) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Bid.bid_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "reserve.auction.v1.Bid.bidder": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.Bid.amount": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Bid.recive_rate": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.Bid.max_receive": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Bid.is_handle": + return protoreflect.ValueOfBool(false) + case "reserve.auction.v1.Bid.index": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bid")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bid does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Bid) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.Bid", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Bid) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bid) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Bid) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Bid) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Bid) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.BidId != 0 { + n += 1 + runtime.Sov(uint64(x.BidId)) + } + l = len(x.Bidder) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Amount != nil { + l = options.Size(x.Amount) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ReciveRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.MaxReceive != nil { + l = options.Size(x.MaxReceive) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.IsHandle { + n += 2 + } + if x.Index != 0 { + n += 1 + runtime.Sov(uint64(x.Index)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Bid) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Index != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Index)) + i-- + dAtA[i] = 0x38 + } + if x.IsHandle { + i-- + if x.IsHandle { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.MaxReceive != nil { + encoded, err := options.Marshal(x.MaxReceive) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if len(x.ReciveRate) > 0 { + i -= len(x.ReciveRate) + copy(dAtA[i:], x.ReciveRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ReciveRate))) + i-- + dAtA[i] = 0x22 + } + if x.Amount != nil { + encoded, err := options.Marshal(x.Amount) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.Bidder) > 0 { + i -= len(x.Bidder) + copy(dAtA[i:], x.Bidder) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bidder))) + i-- + dAtA[i] = 0x12 + } + if x.BidId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BidId)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Bid) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + x.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Amount == nil { + x.Amount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ReciveRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ReciveRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxReceive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.MaxReceive == nil { + x.MaxReceive = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxReceive); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsHandle", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IsHandle = bool(v != 0) + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + x.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_BidQueue_2_list)(nil) + +type _BidQueue_2_list struct { + list *[]*Bid +} + +func (x *_BidQueue_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_BidQueue_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_BidQueue_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + (*x.list)[i] = concreteValue +} + +func (x *_BidQueue_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + *x.list = append(*x.list, concreteValue) +} + +func (x *_BidQueue_2_list) AppendMutable() protoreflect.Value { + v := new(Bid) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BidQueue_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_BidQueue_2_list) NewElement() protoreflect.Value { + v := new(Bid) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BidQueue_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_BidQueue protoreflect.MessageDescriptor + fd_BidQueue_auction_id protoreflect.FieldDescriptor + fd_BidQueue_bids protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_auction_proto_init() + md_BidQueue = File_reserve_auction_v1_auction_proto.Messages().ByName("BidQueue") + fd_BidQueue_auction_id = md_BidQueue.Fields().ByName("auction_id") + fd_BidQueue_bids = md_BidQueue.Fields().ByName("bids") +} + +var _ protoreflect.Message = (*fastReflection_BidQueue)(nil) + +type fastReflection_BidQueue BidQueue + +func (x *BidQueue) ProtoReflect() protoreflect.Message { + return (*fastReflection_BidQueue)(x) +} + +func (x *BidQueue) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_BidQueue_messageType fastReflection_BidQueue_messageType +var _ protoreflect.MessageType = fastReflection_BidQueue_messageType{} + +type fastReflection_BidQueue_messageType struct{} + +func (x fastReflection_BidQueue_messageType) Zero() protoreflect.Message { + return (*fastReflection_BidQueue)(nil) +} +func (x fastReflection_BidQueue_messageType) New() protoreflect.Message { + return new(fastReflection_BidQueue) +} +func (x fastReflection_BidQueue_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BidQueue +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BidQueue) Descriptor() protoreflect.MessageDescriptor { + return md_BidQueue +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_BidQueue) Type() protoreflect.MessageType { + return _fastReflection_BidQueue_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BidQueue) New() protoreflect.Message { + return new(fastReflection_BidQueue) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BidQueue) Interface() protoreflect.ProtoMessage { + return (*BidQueue)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_BidQueue) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_BidQueue_auction_id, value) { + return + } + } + if len(x.Bids) != 0 { + value := protoreflect.ValueOfList(&_BidQueue_2_list{list: &x.Bids}) + if !f(fd_BidQueue_bids, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_BidQueue) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.BidQueue.auction_id": + return x.AuctionId != uint64(0) + case "reserve.auction.v1.BidQueue.bids": + return len(x.Bids) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.BidQueue")) + } + panic(fmt.Errorf("message reserve.auction.v1.BidQueue does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BidQueue) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.BidQueue.auction_id": + x.AuctionId = uint64(0) + case "reserve.auction.v1.BidQueue.bids": + x.Bids = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.BidQueue")) + } + panic(fmt.Errorf("message reserve.auction.v1.BidQueue does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_BidQueue) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.BidQueue.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "reserve.auction.v1.BidQueue.bids": + if len(x.Bids) == 0 { + return protoreflect.ValueOfList(&_BidQueue_2_list{}) + } + listValue := &_BidQueue_2_list{list: &x.Bids} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.BidQueue")) + } + panic(fmt.Errorf("message reserve.auction.v1.BidQueue does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BidQueue) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.BidQueue.auction_id": + x.AuctionId = value.Uint() + case "reserve.auction.v1.BidQueue.bids": + lv := value.List() + clv := lv.(*_BidQueue_2_list) + x.Bids = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.BidQueue")) + } + panic(fmt.Errorf("message reserve.auction.v1.BidQueue does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BidQueue) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.BidQueue.bids": + if x.Bids == nil { + x.Bids = []*Bid{} + } + value := &_BidQueue_2_list{list: &x.Bids} + return protoreflect.ValueOfList(value) + case "reserve.auction.v1.BidQueue.auction_id": + panic(fmt.Errorf("field auction_id of message reserve.auction.v1.BidQueue is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.BidQueue")) + } + panic(fmt.Errorf("message reserve.auction.v1.BidQueue does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_BidQueue) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.BidQueue.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "reserve.auction.v1.BidQueue.bids": + list := []*Bid{} + return protoreflect.ValueOfList(&_BidQueue_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.BidQueue")) + } + panic(fmt.Errorf("message reserve.auction.v1.BidQueue does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_BidQueue) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.BidQueue", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_BidQueue) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BidQueue) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_BidQueue) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_BidQueue) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BidQueue) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + if len(x.Bids) > 0 { + for _, e := range x.Bids { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*BidQueue) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Bids) > 0 { + for iNdEx := len(x.Bids) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Bids[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*BidQueue) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BidQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BidQueue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + x.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Bids = append(x.Bids, &Bid{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Bids[len(x.Bids)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_Bids_1_list)(nil) + +type _Bids_1_list struct { + list *[]*Bid +} + +func (x *_Bids_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Bids_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Bids_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + (*x.list)[i] = concreteValue +} + +func (x *_Bids_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Bids_1_list) AppendMutable() protoreflect.Value { + v := new(Bid) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Bids_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Bids_1_list) NewElement() protoreflect.Value { + v := new(Bid) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Bids_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Bids protoreflect.MessageDescriptor + fd_Bids_bids protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_auction_proto_init() + md_Bids = File_reserve_auction_v1_auction_proto.Messages().ByName("Bids") + fd_Bids_bids = md_Bids.Fields().ByName("bids") +} + +var _ protoreflect.Message = (*fastReflection_Bids)(nil) + +type fastReflection_Bids Bids + +func (x *Bids) ProtoReflect() protoreflect.Message { + return (*fastReflection_Bids)(x) +} + +func (x *Bids) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Bids_messageType fastReflection_Bids_messageType +var _ protoreflect.MessageType = fastReflection_Bids_messageType{} + +type fastReflection_Bids_messageType struct{} + +func (x fastReflection_Bids_messageType) Zero() protoreflect.Message { + return (*fastReflection_Bids)(nil) +} +func (x fastReflection_Bids_messageType) New() protoreflect.Message { + return new(fastReflection_Bids) +} +func (x fastReflection_Bids_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Bids +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Bids) Descriptor() protoreflect.MessageDescriptor { + return md_Bids +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Bids) Type() protoreflect.MessageType { + return _fastReflection_Bids_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Bids) New() protoreflect.Message { + return new(fastReflection_Bids) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Bids) Interface() protoreflect.ProtoMessage { + return (*Bids)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Bids) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Bids) != 0 { + value := protoreflect.ValueOfList(&_Bids_1_list{list: &x.Bids}) + if !f(fd_Bids_bids, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Bids) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.Bids.bids": + return len(x.Bids) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bids")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bids does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bids) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.Bids.bids": + x.Bids = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bids")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bids does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Bids) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.Bids.bids": + if len(x.Bids) == 0 { + return protoreflect.ValueOfList(&_Bids_1_list{}) + } + listValue := &_Bids_1_list{list: &x.Bids} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bids")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bids does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bids) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.Bids.bids": + lv := value.List() + clv := lv.(*_Bids_1_list) + x.Bids = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bids")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bids does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bids) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Bids.bids": + if x.Bids == nil { + x.Bids = []*Bid{} + } + value := &_Bids_1_list{list: &x.Bids} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bids")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bids does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Bids) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Bids.bids": + list := []*Bid{} + return protoreflect.ValueOfList(&_Bids_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Bids")) + } + panic(fmt.Errorf("message reserve.auction.v1.Bids does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Bids) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.Bids", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Bids) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Bids) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Bids) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Bids) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Bids) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Bids) > 0 { + for _, e := range x.Bids { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Bids) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Bids) > 0 { + for iNdEx := len(x.Bids) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Bids[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Bids) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bids: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Bids: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Bids = append(x.Bids, &Bid{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Bids[len(x.Bids)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: reserve/auction/v1/auction.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// AuctionStatus enumerates the valid auction status. +type AuctionStatus int32 + +const ( + // AUCTION_STATUS_UNSPECIFIED defines unknow auction status default is active. + AuctionStatus_AUCTION_STATUS_UNSPECIFIED AuctionStatus = 0 + // AUCTION_STATUS_ACTIVE defines auction active status. + AuctionStatus_AUCTION_STATUS_ACTIVE AuctionStatus = 1 + // AUCTION_STATUS_FINISHED defines auction finished reaching target goal. + AuctionStatus_AUCTION_STATUS_FINISHED AuctionStatus = 2 + // AUCTION_STATUS_EXPIRED defines auction reach end time without reaching target goal. + AuctionStatus_AUCTION_STATUS_EXPIRED AuctionStatus = 3 + // AUCTION_STATUS_OUT_OF_COLLATHERAL defines auction out of collatheral. + AuctionStatus_AUCTION_STATUS_OUT_OF_COLLATHERAL AuctionStatus = 4 +) + +// Enum value maps for AuctionStatus. +var ( + AuctionStatus_name = map[int32]string{ + 0: "AUCTION_STATUS_UNSPECIFIED", + 1: "AUCTION_STATUS_ACTIVE", + 2: "AUCTION_STATUS_FINISHED", + 3: "AUCTION_STATUS_EXPIRED", + 4: "AUCTION_STATUS_OUT_OF_COLLATHERAL", + } + AuctionStatus_value = map[string]int32{ + "AUCTION_STATUS_UNSPECIFIED": 0, + "AUCTION_STATUS_ACTIVE": 1, + "AUCTION_STATUS_FINISHED": 2, + "AUCTION_STATUS_EXPIRED": 3, + "AUCTION_STATUS_OUT_OF_COLLATHERAL": 4, + } +) + +func (x AuctionStatus) Enum() *AuctionStatus { + p := new(AuctionStatus) + *p = x + return p +} + +func (x AuctionStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AuctionStatus) Descriptor() protoreflect.EnumDescriptor { + return file_reserve_auction_v1_auction_proto_enumTypes[0].Descriptor() +} + +func (AuctionStatus) Type() protoreflect.EnumType { + return &file_reserve_auction_v1_auction_proto_enumTypes[0] +} + +func (x AuctionStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AuctionStatus.Descriptor instead. +func (AuctionStatus) EnumDescriptor() ([]byte, []int) { + return file_reserve_auction_v1_auction_proto_rawDescGZIP(), []int{0} +} + +// Auction struct +type Auction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // start_time defines auction's start time + StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // end_time defines where the auction ended when there are no winning bid + EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + // for simplicity, will use vault id that start the auction as auction id + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // starting price (currently only support usd stable token) + InitialPrice *v1beta1.Coin `protobuf:"bytes,4,opt,name=initial_price,json=initialPrice,proto3" json:"initial_price,omitempty"` + // items defines liquidate assets + Item *v1beta1.Coin `protobuf:"bytes,5,opt,name=item,proto3" json:"item,omitempty"` + // current_rate defines the rate compare with the initial price + CurrentRate string `protobuf:"bytes,6,opt,name=current_rate,json=currentRate,proto3" json:"current_rate,omitempty"` + // last_discount_time defines the last time a discount has been apply + LastDiscountTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=last_discount_time,json=lastDiscountTime,proto3" json:"last_discount_time,omitempty"` + TokenRaised *v1beta1.Coin `protobuf:"bytes,8,opt,name=token_raised,json=tokenRaised,proto3" json:"token_raised,omitempty"` + // status defines auction current status + Status AuctionStatus `protobuf:"varint,9,opt,name=status,proto3,enum=reserve.auction.v1.AuctionStatus" json:"status,omitempty"` + // target_goal defines the debt the auction is trying to recover + TargetGoal *v1beta1.Coin `protobuf:"bytes,10,opt,name=target_goal,json=targetGoal,proto3" json:"target_goal,omitempty"` +} + +func (x *Auction) Reset() { + *x = Auction{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Auction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Auction) ProtoMessage() {} + +// Deprecated: Use Auction.ProtoReflect.Descriptor instead. +func (*Auction) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_auction_proto_rawDescGZIP(), []int{0} +} + +func (x *Auction) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *Auction) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *Auction) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *Auction) GetInitialPrice() *v1beta1.Coin { + if x != nil { + return x.InitialPrice + } + return nil +} + +func (x *Auction) GetItem() *v1beta1.Coin { + if x != nil { + return x.Item + } + return nil +} + +func (x *Auction) GetCurrentRate() string { + if x != nil { + return x.CurrentRate + } + return "" +} + +func (x *Auction) GetLastDiscountTime() *timestamppb.Timestamp { + if x != nil { + return x.LastDiscountTime + } + return nil +} + +func (x *Auction) GetTokenRaised() *v1beta1.Coin { + if x != nil { + return x.TokenRaised + } + return nil +} + +func (x *Auction) GetStatus() AuctionStatus { + if x != nil { + return x.Status + } + return AuctionStatus_AUCTION_STATUS_UNSPECIFIED +} + +func (x *Auction) GetTargetGoal() *v1beta1.Coin { + if x != nil { + return x.TargetGoal + } + return nil +} + +// Bid defines bid entry +type Bid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id of bid + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` + // bidder address + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bidding amount + Amount *v1beta1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // recive_rate defines the rate compare to the price at the start of the auction + // that the bid is willing to pay + ReciveRate string `protobuf:"bytes,4,opt,name=recive_rate,json=reciveRate,proto3" json:"recive_rate,omitempty"` + // maxReceive maximum receive-able amount + MaxReceive *v1beta1.Coin `protobuf:"bytes,5,opt,name=max_receive,json=maxReceive,proto3" json:"max_receive,omitempty"` + IsHandle bool `protobuf:"varint,6,opt,name=is_handle,json=isHandle,proto3" json:"is_handle,omitempty"` + // index in auction bid_queue + Index uint64 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *Bid) Reset() { + *x = Bid{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bid) ProtoMessage() {} + +// Deprecated: Use Bid.ProtoReflect.Descriptor instead. +func (*Bid) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_auction_proto_rawDescGZIP(), []int{1} +} + +func (x *Bid) GetBidId() uint64 { + if x != nil { + return x.BidId + } + return 0 +} + +func (x *Bid) GetBidder() string { + if x != nil { + return x.Bidder + } + return "" +} + +func (x *Bid) GetAmount() *v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +func (x *Bid) GetReciveRate() string { + if x != nil { + return x.ReciveRate + } + return "" +} + +func (x *Bid) GetMaxReceive() *v1beta1.Coin { + if x != nil { + return x.MaxReceive + } + return nil +} + +func (x *Bid) GetIsHandle() bool { + if x != nil { + return x.IsHandle + } + return false +} + +func (x *Bid) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + +// BidQueue defines a list of bid entries for a single auction sorted by insertion time +type BidQueue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bidder address + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // array of bid entries with bidder address + Bids []*Bid `protobuf:"bytes,2,rep,name=bids,proto3" json:"bids,omitempty"` +} + +func (x *BidQueue) Reset() { + *x = BidQueue{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BidQueue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BidQueue) ProtoMessage() {} + +// Deprecated: Use BidQueue.ProtoReflect.Descriptor instead. +func (*BidQueue) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_auction_proto_rawDescGZIP(), []int{2} +} + +func (x *BidQueue) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *BidQueue) GetBids() []*Bid { + if x != nil { + return x.Bids + } + return nil +} + +// Bids defines a list of bid entries +type Bids struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // array of bid entries with bidder address + Bids []*Bid `protobuf:"bytes,1,rep,name=bids,proto3" json:"bids,omitempty"` +} + +func (x *Bids) Reset() { + *x = Bids{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_auction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bids) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bids) ProtoMessage() {} + +// Deprecated: Use Bids.ProtoReflect.Descriptor instead. +func (*Bids) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_auction_proto_rawDescGZIP(), []int{3} +} + +func (x *Bids) GetBids() []*Bid { + if x != nil { + return x.Bids + } + return nil +} + +var File_reserve_auction_v1_auction_proto protoreflect.FileDescriptor + +var file_reserve_auction_v1_auction_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x05, 0x0a, 0x07, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, + 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, + 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x31, 0x0a, 0x0c, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x57, + 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0c, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x5f, 0x72, 0x61, 0x69, 0x73, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x61, 0x69, 0x73, 0x65, 0x64, + 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x21, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x67, 0x6f, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x47, 0x6f, + 0x61, 0x6c, 0x22, 0xb7, 0x02, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x69, 0x64, 0x49, + 0x64, 0x12, 0x30, 0x0a, 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x62, 0x69, 0x64, + 0x64, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x2f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x69, 0x76, 0x65, 0x52, 0x61, + 0x74, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, + 0x61, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x56, 0x0a, 0x08, + 0x42, 0x69, 0x64, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x62, 0x69, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x04, + 0x62, 0x69, 0x64, 0x73, 0x22, 0x33, 0x0a, 0x04, 0x42, 0x69, 0x64, 0x73, 0x12, 0x2b, 0x0a, 0x04, + 0x62, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x69, 0x64, 0x52, 0x04, 0x62, 0x69, 0x64, 0x73, 0x2a, 0xaa, 0x01, 0x0a, 0x0d, 0x41, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x1a, 0x41, + 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x41, + 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, + 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, + 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x12, + 0x25, 0x0a, 0x21, 0x41, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x4c, 0x4c, 0x41, 0x54, 0x48, + 0x45, 0x52, 0x41, 0x4c, 0x10, 0x04, 0x42, 0xbf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x41, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_reserve_auction_v1_auction_proto_rawDescOnce sync.Once + file_reserve_auction_v1_auction_proto_rawDescData = file_reserve_auction_v1_auction_proto_rawDesc +) + +func file_reserve_auction_v1_auction_proto_rawDescGZIP() []byte { + file_reserve_auction_v1_auction_proto_rawDescOnce.Do(func() { + file_reserve_auction_v1_auction_proto_rawDescData = protoimpl.X.CompressGZIP(file_reserve_auction_v1_auction_proto_rawDescData) + }) + return file_reserve_auction_v1_auction_proto_rawDescData +} + +var file_reserve_auction_v1_auction_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_reserve_auction_v1_auction_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_reserve_auction_v1_auction_proto_goTypes = []interface{}{ + (AuctionStatus)(0), // 0: reserve.auction.v1.AuctionStatus + (*Auction)(nil), // 1: reserve.auction.v1.Auction + (*Bid)(nil), // 2: reserve.auction.v1.Bid + (*BidQueue)(nil), // 3: reserve.auction.v1.BidQueue + (*Bids)(nil), // 4: reserve.auction.v1.Bids + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin +} +var file_reserve_auction_v1_auction_proto_depIdxs = []int32{ + 5, // 0: reserve.auction.v1.Auction.start_time:type_name -> google.protobuf.Timestamp + 5, // 1: reserve.auction.v1.Auction.end_time:type_name -> google.protobuf.Timestamp + 6, // 2: reserve.auction.v1.Auction.initial_price:type_name -> cosmos.base.v1beta1.Coin + 6, // 3: reserve.auction.v1.Auction.item:type_name -> cosmos.base.v1beta1.Coin + 5, // 4: reserve.auction.v1.Auction.last_discount_time:type_name -> google.protobuf.Timestamp + 6, // 5: reserve.auction.v1.Auction.token_raised:type_name -> cosmos.base.v1beta1.Coin + 0, // 6: reserve.auction.v1.Auction.status:type_name -> reserve.auction.v1.AuctionStatus + 6, // 7: reserve.auction.v1.Auction.target_goal:type_name -> cosmos.base.v1beta1.Coin + 6, // 8: reserve.auction.v1.Bid.amount:type_name -> cosmos.base.v1beta1.Coin + 6, // 9: reserve.auction.v1.Bid.max_receive:type_name -> cosmos.base.v1beta1.Coin + 2, // 10: reserve.auction.v1.BidQueue.bids:type_name -> reserve.auction.v1.Bid + 2, // 11: reserve.auction.v1.Bids.bids:type_name -> reserve.auction.v1.Bid + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_reserve_auction_v1_auction_proto_init() } +func file_reserve_auction_v1_auction_proto_init() { + if File_reserve_auction_v1_auction_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_reserve_auction_v1_auction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Auction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_auction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_auction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BidQueue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_auction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bids); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reserve_auction_v1_auction_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_reserve_auction_v1_auction_proto_goTypes, + DependencyIndexes: file_reserve_auction_v1_auction_proto_depIdxs, + EnumInfos: file_reserve_auction_v1_auction_proto_enumTypes, + MessageInfos: file_reserve_auction_v1_auction_proto_msgTypes, + }.Build() + File_reserve_auction_v1_auction_proto = out.File + file_reserve_auction_v1_auction_proto_rawDesc = nil + file_reserve_auction_v1_auction_proto_goTypes = nil + file_reserve_auction_v1_auction_proto_depIdxs = nil +} diff --git a/api/reserve/auction/v1/genesis.pulsar.go b/api/reserve/auction/v1/genesis.pulsar.go new file mode 100644 index 0000000..23c673b --- /dev/null +++ b/api/reserve/auction/v1/genesis.pulsar.go @@ -0,0 +1,905 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package auctionv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*Auction +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Auction) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Auction) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(Auction) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(Auction) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*Bid +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Bid) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(Bid) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(Bid) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_auctions protoreflect.FieldDescriptor + fd_GenesisState_bid_entries protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_genesis_proto_init() + md_GenesisState = File_reserve_auction_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_auctions = md_GenesisState.Fields().ByName("auctions") + fd_GenesisState_bid_entries = md_GenesisState.Fields().ByName("bid_entries") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if len(x.Auctions) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Auctions}) + if !f(fd_GenesisState_auctions, value) { + return + } + } + if len(x.BidEntries) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.BidEntries}) + if !f(fd_GenesisState_bid_entries, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.GenesisState.params": + return x.Params != nil + case "reserve.auction.v1.GenesisState.auctions": + return len(x.Auctions) != 0 + case "reserve.auction.v1.GenesisState.bid_entries": + return len(x.BidEntries) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.GenesisState")) + } + panic(fmt.Errorf("message reserve.auction.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.GenesisState.params": + x.Params = nil + case "reserve.auction.v1.GenesisState.auctions": + x.Auctions = nil + case "reserve.auction.v1.GenesisState.bid_entries": + x.BidEntries = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.GenesisState")) + } + panic(fmt.Errorf("message reserve.auction.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.GenesisState.auctions": + if len(x.Auctions) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.Auctions} + return protoreflect.ValueOfList(listValue) + case "reserve.auction.v1.GenesisState.bid_entries": + if len(x.BidEntries) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.BidEntries} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.GenesisState")) + } + panic(fmt.Errorf("message reserve.auction.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "reserve.auction.v1.GenesisState.auctions": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.Auctions = *clv.list + case "reserve.auction.v1.GenesisState.bid_entries": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.BidEntries = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.GenesisState")) + } + panic(fmt.Errorf("message reserve.auction.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "reserve.auction.v1.GenesisState.auctions": + if x.Auctions == nil { + x.Auctions = []*Auction{} + } + value := &_GenesisState_2_list{list: &x.Auctions} + return protoreflect.ValueOfList(value) + case "reserve.auction.v1.GenesisState.bid_entries": + if x.BidEntries == nil { + x.BidEntries = []*Bid{} + } + value := &_GenesisState_3_list{list: &x.BidEntries} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.GenesisState")) + } + panic(fmt.Errorf("message reserve.auction.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.GenesisState.auctions": + list := []*Auction{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "reserve.auction.v1.GenesisState.bid_entries": + list := []*Bid{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.GenesisState")) + } + panic(fmt.Errorf("message reserve.auction.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Auctions) > 0 { + for _, e := range x.Auctions { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.BidEntries) > 0 { + for _, e := range x.BidEntries { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.BidEntries) > 0 { + for iNdEx := len(x.BidEntries) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.BidEntries[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Auctions) > 0 { + for iNdEx := len(x.Auctions) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Auctions[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Auctions = append(x.Auctions, &Auction{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auctions[len(x.Auctions)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BidEntries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BidEntries = append(x.BidEntries, &Bid{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BidEntries[len(x.BidEntries)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: reserve/auction/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the auction module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // list of auctions + Auctions []*Auction `protobuf:"bytes,2,rep,name=auctions,proto3" json:"auctions,omitempty"` + // list of all bid entries + BidEntries []*Bid `protobuf:"bytes,3,rep,name=bid_entries,json=bidEntries,proto3" json:"bid_entries,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetAuctions() []*Auction { + if x != nil { + return x.Auctions + } + return nil +} + +func (x *GenesisState) GetBidEntries() []*Bid { + if x != nil { + return x.BidEntries + } + return nil +} + +var File_reserve_auction_v1_genesis_proto protoreflect.FileDescriptor + +var file_reserve_auction_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xc0, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x0a, 0x0b, 0x62, + 0x69, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x52, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0xbf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x2d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x14, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_reserve_auction_v1_genesis_proto_rawDescOnce sync.Once + file_reserve_auction_v1_genesis_proto_rawDescData = file_reserve_auction_v1_genesis_proto_rawDesc +) + +func file_reserve_auction_v1_genesis_proto_rawDescGZIP() []byte { + file_reserve_auction_v1_genesis_proto_rawDescOnce.Do(func() { + file_reserve_auction_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_reserve_auction_v1_genesis_proto_rawDescData) + }) + return file_reserve_auction_v1_genesis_proto_rawDescData +} + +var file_reserve_auction_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_reserve_auction_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: reserve.auction.v1.GenesisState + (*Params)(nil), // 1: reserve.auction.v1.Params + (*Auction)(nil), // 2: reserve.auction.v1.Auction + (*Bid)(nil), // 3: reserve.auction.v1.Bid +} +var file_reserve_auction_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: reserve.auction.v1.GenesisState.params:type_name -> reserve.auction.v1.Params + 2, // 1: reserve.auction.v1.GenesisState.auctions:type_name -> reserve.auction.v1.Auction + 3, // 2: reserve.auction.v1.GenesisState.bid_entries:type_name -> reserve.auction.v1.Bid + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_reserve_auction_v1_genesis_proto_init() } +func file_reserve_auction_v1_genesis_proto_init() { + if File_reserve_auction_v1_genesis_proto != nil { + return + } + file_reserve_auction_v1_params_proto_init() + file_reserve_auction_v1_auction_proto_init() + if !protoimpl.UnsafeEnabled { + file_reserve_auction_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reserve_auction_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_reserve_auction_v1_genesis_proto_goTypes, + DependencyIndexes: file_reserve_auction_v1_genesis_proto_depIdxs, + MessageInfos: file_reserve_auction_v1_genesis_proto_msgTypes, + }.Build() + File_reserve_auction_v1_genesis_proto = out.File + file_reserve_auction_v1_genesis_proto_rawDesc = nil + file_reserve_auction_v1_genesis_proto_goTypes = nil + file_reserve_auction_v1_genesis_proto_depIdxs = nil +} diff --git a/api/reserve/auction/v1/params.pulsar.go b/api/reserve/auction/v1/params.pulsar.go new file mode 100644 index 0000000..e63b7e6 --- /dev/null +++ b/api/reserve/auction/v1/params.pulsar.go @@ -0,0 +1,928 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package auctionv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_auction_periods protoreflect.FieldDescriptor + fd_Params_reduce_step protoreflect.FieldDescriptor + fd_Params_starting_rate protoreflect.FieldDescriptor + fd_Params_lowest_rate protoreflect.FieldDescriptor + fd_Params_discount_rate protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_params_proto_init() + md_Params = File_reserve_auction_v1_params_proto.Messages().ByName("Params") + fd_Params_auction_periods = md_Params.Fields().ByName("auction_periods") + fd_Params_reduce_step = md_Params.Fields().ByName("reduce_step") + fd_Params_starting_rate = md_Params.Fields().ByName("starting_rate") + fd_Params_lowest_rate = md_Params.Fields().ByName("lowest_rate") + fd_Params_discount_rate = md_Params.Fields().ByName("discount_rate") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionPeriods != nil { + value := protoreflect.ValueOfMessage(x.AuctionPeriods.ProtoReflect()) + if !f(fd_Params_auction_periods, value) { + return + } + } + if x.ReduceStep != nil { + value := protoreflect.ValueOfMessage(x.ReduceStep.ProtoReflect()) + if !f(fd_Params_reduce_step, value) { + return + } + } + if x.StartingRate != "" { + value := protoreflect.ValueOfString(x.StartingRate) + if !f(fd_Params_starting_rate, value) { + return + } + } + if x.LowestRate != "" { + value := protoreflect.ValueOfString(x.LowestRate) + if !f(fd_Params_lowest_rate, value) { + return + } + } + if x.DiscountRate != "" { + value := protoreflect.ValueOfString(x.DiscountRate) + if !f(fd_Params_discount_rate, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.Params.auction_periods": + return x.AuctionPeriods != nil + case "reserve.auction.v1.Params.reduce_step": + return x.ReduceStep != nil + case "reserve.auction.v1.Params.starting_rate": + return x.StartingRate != "" + case "reserve.auction.v1.Params.lowest_rate": + return x.LowestRate != "" + case "reserve.auction.v1.Params.discount_rate": + return x.DiscountRate != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Params")) + } + panic(fmt.Errorf("message reserve.auction.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.Params.auction_periods": + x.AuctionPeriods = nil + case "reserve.auction.v1.Params.reduce_step": + x.ReduceStep = nil + case "reserve.auction.v1.Params.starting_rate": + x.StartingRate = "" + case "reserve.auction.v1.Params.lowest_rate": + x.LowestRate = "" + case "reserve.auction.v1.Params.discount_rate": + x.DiscountRate = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Params")) + } + panic(fmt.Errorf("message reserve.auction.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.Params.auction_periods": + value := x.AuctionPeriods + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Params.reduce_step": + value := x.ReduceStep + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.Params.starting_rate": + value := x.StartingRate + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.Params.lowest_rate": + value := x.LowestRate + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.Params.discount_rate": + value := x.DiscountRate + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Params")) + } + panic(fmt.Errorf("message reserve.auction.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.Params.auction_periods": + x.AuctionPeriods = value.Message().Interface().(*durationpb.Duration) + case "reserve.auction.v1.Params.reduce_step": + x.ReduceStep = value.Message().Interface().(*durationpb.Duration) + case "reserve.auction.v1.Params.starting_rate": + x.StartingRate = value.Interface().(string) + case "reserve.auction.v1.Params.lowest_rate": + x.LowestRate = value.Interface().(string) + case "reserve.auction.v1.Params.discount_rate": + x.DiscountRate = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Params")) + } + panic(fmt.Errorf("message reserve.auction.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Params.auction_periods": + if x.AuctionPeriods == nil { + x.AuctionPeriods = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.AuctionPeriods.ProtoReflect()) + case "reserve.auction.v1.Params.reduce_step": + if x.ReduceStep == nil { + x.ReduceStep = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.ReduceStep.ProtoReflect()) + case "reserve.auction.v1.Params.starting_rate": + panic(fmt.Errorf("field starting_rate of message reserve.auction.v1.Params is not mutable")) + case "reserve.auction.v1.Params.lowest_rate": + panic(fmt.Errorf("field lowest_rate of message reserve.auction.v1.Params is not mutable")) + case "reserve.auction.v1.Params.discount_rate": + panic(fmt.Errorf("field discount_rate of message reserve.auction.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Params")) + } + panic(fmt.Errorf("message reserve.auction.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.Params.auction_periods": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Params.reduce_step": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.Params.starting_rate": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.Params.lowest_rate": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.Params.discount_rate": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.Params")) + } + panic(fmt.Errorf("message reserve.auction.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.AuctionPeriods != nil { + l = options.Size(x.AuctionPeriods) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ReduceStep != nil { + l = options.Size(x.ReduceStep) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.StartingRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.LowestRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DiscountRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.DiscountRate) > 0 { + i -= len(x.DiscountRate) + copy(dAtA[i:], x.DiscountRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DiscountRate))) + i-- + dAtA[i] = 0x2a + } + if len(x.LowestRate) > 0 { + i -= len(x.LowestRate) + copy(dAtA[i:], x.LowestRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LowestRate))) + i-- + dAtA[i] = 0x22 + } + if len(x.StartingRate) > 0 { + i -= len(x.StartingRate) + copy(dAtA[i:], x.StartingRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StartingRate))) + i-- + dAtA[i] = 0x1a + } + if x.ReduceStep != nil { + encoded, err := options.Marshal(x.ReduceStep) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.AuctionPeriods != nil { + encoded, err := options.Marshal(x.AuctionPeriods) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AuctionPeriods == nil { + x.AuctionPeriods = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AuctionPeriods); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ReduceStep", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ReduceStep == nil { + x.ReduceStep = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ReduceStep); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartingRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.StartingRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LowestRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.LowestRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DiscountRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DiscountRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: reserve/auction/v1/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // defines how long (either in blocktime or blockheight) + // between each auction + AuctionPeriods *durationpb.Duration `protobuf:"bytes,1,opt,name=auction_periods,json=auctionPeriods,proto3" json:"auction_periods,omitempty"` + // duration between each price reduction + ReduceStep *durationpb.Duration `protobuf:"bytes,2,opt,name=reduce_step,json=reduceStep,proto3" json:"reduce_step,omitempty"` + // rate compared with the collaterals price from the + // oracle at which the auction will start with + StartingRate string `protobuf:"bytes,3,opt,name=starting_rate,json=startingRate,proto3" json:"starting_rate,omitempty"` + // rate compared with the initial price that the price + // can drop to + LowestRate string `protobuf:"bytes,4,opt,name=lowest_rate,json=lowestRate,proto3" json:"lowest_rate,omitempty"` + // rate that are decrease every reduce_step + DiscountRate string `protobuf:"bytes,5,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_params_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetAuctionPeriods() *durationpb.Duration { + if x != nil { + return x.AuctionPeriods + } + return nil +} + +func (x *Params) GetReduceStep() *durationpb.Duration { + if x != nil { + return x.ReduceStep + } + return nil +} + +func (x *Params) GetStartingRate() string { + if x != nil { + return x.StartingRate + } + return "" +} + +func (x *Params) GetLowestRate() string { + if x != nil { + return x.LowestRate + } + return "" +} + +func (x *Params) GetDiscountRate() string { + if x != nil { + return x.DiscountRate + } + return "" +} + +var File_reserve_auction_v1_params_proto protoreflect.FileDescriptor + +var file_reserve_auction_v1_params_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x02, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x0f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, + 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x12, 0x49, 0x0a, 0x0b, 0x72, 0x65, 0x64, 0x75, 0x63, + 0x65, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, + 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x53, 0x74, + 0x65, 0x70, 0x12, 0x33, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, + 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0b, 0x6c, 0x6f, 0x77, 0x65, 0x73, + 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x6c, 0x6f, + 0x77, 0x65, 0x73, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x33, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x0c, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x21, 0xe8, + 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, + 0x78, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0xbe, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, + 0x02, 0x12, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_reserve_auction_v1_params_proto_rawDescOnce sync.Once + file_reserve_auction_v1_params_proto_rawDescData = file_reserve_auction_v1_params_proto_rawDesc +) + +func file_reserve_auction_v1_params_proto_rawDescGZIP() []byte { + file_reserve_auction_v1_params_proto_rawDescOnce.Do(func() { + file_reserve_auction_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_reserve_auction_v1_params_proto_rawDescData) + }) + return file_reserve_auction_v1_params_proto_rawDescData +} + +var file_reserve_auction_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_reserve_auction_v1_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: reserve.auction.v1.Params + (*durationpb.Duration)(nil), // 1: google.protobuf.Duration +} +var file_reserve_auction_v1_params_proto_depIdxs = []int32{ + 1, // 0: reserve.auction.v1.Params.auction_periods:type_name -> google.protobuf.Duration + 1, // 1: reserve.auction.v1.Params.reduce_step:type_name -> google.protobuf.Duration + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_reserve_auction_v1_params_proto_init() } +func file_reserve_auction_v1_params_proto_init() { + if File_reserve_auction_v1_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_reserve_auction_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reserve_auction_v1_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_reserve_auction_v1_params_proto_goTypes, + DependencyIndexes: file_reserve_auction_v1_params_proto_depIdxs, + MessageInfos: file_reserve_auction_v1_params_proto_msgTypes, + }.Build() + File_reserve_auction_v1_params_proto = out.File + file_reserve_auction_v1_params_proto_rawDesc = nil + file_reserve_auction_v1_params_proto_goTypes = nil + file_reserve_auction_v1_params_proto_depIdxs = nil +} diff --git a/api/reserve/auction/v1/tx.pulsar.go b/api/reserve/auction/v1/tx.pulsar.go new file mode 100644 index 0000000..81b0e36 --- /dev/null +++ b/api/reserve/auction/v1/tx.pulsar.go @@ -0,0 +1,3206 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package auctionv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_tx_proto_init() + md_MsgUpdateParams = File_reserve_auction_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "reserve.auction.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.MsgUpdateParams.authority": + x.Authority = "" + case "reserve.auction.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "reserve.auction.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "reserve.auction.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message reserve.auction.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_reserve_auction_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_reserve_auction_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgBid protoreflect.MessageDescriptor + fd_MsgBid_bidder protoreflect.FieldDescriptor + fd_MsgBid_auction_id protoreflect.FieldDescriptor + fd_MsgBid_amount protoreflect.FieldDescriptor + fd_MsgBid_recive_rate protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_tx_proto_init() + md_MsgBid = File_reserve_auction_v1_tx_proto.Messages().ByName("MsgBid") + fd_MsgBid_bidder = md_MsgBid.Fields().ByName("bidder") + fd_MsgBid_auction_id = md_MsgBid.Fields().ByName("auction_id") + fd_MsgBid_amount = md_MsgBid.Fields().ByName("amount") + fd_MsgBid_recive_rate = md_MsgBid.Fields().ByName("recive_rate") +} + +var _ protoreflect.Message = (*fastReflection_MsgBid)(nil) + +type fastReflection_MsgBid MsgBid + +func (x *MsgBid) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgBid)(x) +} + +func (x *MsgBid) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgBid_messageType fastReflection_MsgBid_messageType +var _ protoreflect.MessageType = fastReflection_MsgBid_messageType{} + +type fastReflection_MsgBid_messageType struct{} + +func (x fastReflection_MsgBid_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgBid)(nil) +} +func (x fastReflection_MsgBid_messageType) New() protoreflect.Message { + return new(fastReflection_MsgBid) +} +func (x fastReflection_MsgBid_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBid +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgBid) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBid +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgBid) Type() protoreflect.MessageType { + return _fastReflection_MsgBid_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgBid) New() protoreflect.Message { + return new(fastReflection_MsgBid) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgBid) Interface() protoreflect.ProtoMessage { + return (*MsgBid)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgBid) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bidder != "" { + value := protoreflect.ValueOfString(x.Bidder) + if !f(fd_MsgBid_bidder, value) { + return + } + } + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_MsgBid_auction_id, value) { + return + } + } + if x.Amount != nil { + value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + if !f(fd_MsgBid_amount, value) { + return + } + } + if x.ReciveRate != "" { + value := protoreflect.ValueOfString(x.ReciveRate) + if !f(fd_MsgBid_recive_rate, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgBid) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.MsgBid.bidder": + return x.Bidder != "" + case "reserve.auction.v1.MsgBid.auction_id": + return x.AuctionId != uint64(0) + case "reserve.auction.v1.MsgBid.amount": + return x.Amount != nil + case "reserve.auction.v1.MsgBid.recive_rate": + return x.ReciveRate != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBid does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBid) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.MsgBid.bidder": + x.Bidder = "" + case "reserve.auction.v1.MsgBid.auction_id": + x.AuctionId = uint64(0) + case "reserve.auction.v1.MsgBid.amount": + x.Amount = nil + case "reserve.auction.v1.MsgBid.recive_rate": + x.ReciveRate = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBid does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgBid) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.MsgBid.bidder": + value := x.Bidder + return protoreflect.ValueOfString(value) + case "reserve.auction.v1.MsgBid.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + case "reserve.auction.v1.MsgBid.amount": + value := x.Amount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "reserve.auction.v1.MsgBid.recive_rate": + value := x.ReciveRate + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBid does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBid) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.MsgBid.bidder": + x.Bidder = value.Interface().(string) + case "reserve.auction.v1.MsgBid.auction_id": + x.AuctionId = value.Uint() + case "reserve.auction.v1.MsgBid.amount": + x.Amount = value.Message().Interface().(*v1beta1.Coin) + case "reserve.auction.v1.MsgBid.recive_rate": + x.ReciveRate = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBid does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBid) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgBid.amount": + if x.Amount == nil { + x.Amount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + case "reserve.auction.v1.MsgBid.bidder": + panic(fmt.Errorf("field bidder of message reserve.auction.v1.MsgBid is not mutable")) + case "reserve.auction.v1.MsgBid.auction_id": + panic(fmt.Errorf("field auction_id of message reserve.auction.v1.MsgBid is not mutable")) + case "reserve.auction.v1.MsgBid.recive_rate": + panic(fmt.Errorf("field recive_rate of message reserve.auction.v1.MsgBid is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBid does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgBid) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgBid.bidder": + return protoreflect.ValueOfString("") + case "reserve.auction.v1.MsgBid.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "reserve.auction.v1.MsgBid.amount": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "reserve.auction.v1.MsgBid.recive_rate": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBid does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgBid) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.MsgBid", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgBid) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBid) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgBid) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgBid) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgBid) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Bidder) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + if x.Amount != nil { + l = options.Size(x.Amount) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ReciveRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgBid) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ReciveRate) > 0 { + i -= len(x.ReciveRate) + copy(dAtA[i:], x.ReciveRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ReciveRate))) + i-- + dAtA[i] = 0x22 + } + if x.Amount != nil { + encoded, err := options.Marshal(x.Amount) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + i-- + dAtA[i] = 0x10 + } + if len(x.Bidder) > 0 { + i -= len(x.Bidder) + copy(dAtA[i:], x.Bidder) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bidder))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgBid) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + x.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Amount == nil { + x.Amount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ReciveRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ReciveRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgBidResponse protoreflect.MessageDescriptor + fd_MsgBidResponse_response protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_tx_proto_init() + md_MsgBidResponse = File_reserve_auction_v1_tx_proto.Messages().ByName("MsgBidResponse") + fd_MsgBidResponse_response = md_MsgBidResponse.Fields().ByName("response") +} + +var _ protoreflect.Message = (*fastReflection_MsgBidResponse)(nil) + +type fastReflection_MsgBidResponse MsgBidResponse + +func (x *MsgBidResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgBidResponse)(x) +} + +func (x *MsgBidResponse) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgBidResponse_messageType fastReflection_MsgBidResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgBidResponse_messageType{} + +type fastReflection_MsgBidResponse_messageType struct{} + +func (x fastReflection_MsgBidResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgBidResponse)(nil) +} +func (x fastReflection_MsgBidResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgBidResponse) +} +func (x fastReflection_MsgBidResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBidResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgBidResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBidResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgBidResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgBidResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgBidResponse) New() protoreflect.Message { + return new(fastReflection_MsgBidResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgBidResponse) Interface() protoreflect.ProtoMessage { + return (*MsgBidResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgBidResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Response != "" { + value := protoreflect.ValueOfString(x.Response) + if !f(fd_MsgBidResponse_response, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgBidResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.MsgBidResponse.response": + return x.Response != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBidResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBidResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.MsgBidResponse.response": + x.Response = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBidResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgBidResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.MsgBidResponse.response": + value := x.Response + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBidResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBidResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.MsgBidResponse.response": + x.Response = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBidResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBidResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgBidResponse.response": + panic(fmt.Errorf("field response of message reserve.auction.v1.MsgBidResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBidResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgBidResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgBidResponse.response": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgBidResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgBidResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.MsgBidResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgBidResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgBidResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgBidResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgBidResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgBidResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Response) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgBidResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Response) > 0 { + i -= len(x.Response) + copy(dAtA[i:], x.Response) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Response))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgBidResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Response = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgCancelBid protoreflect.MessageDescriptor + fd_MsgCancelBid_bid_id protoreflect.FieldDescriptor + fd_MsgCancelBid_auction_id protoreflect.FieldDescriptor +) + +func init() { + file_reserve_auction_v1_tx_proto_init() + md_MsgCancelBid = File_reserve_auction_v1_tx_proto.Messages().ByName("MsgCancelBid") + fd_MsgCancelBid_bid_id = md_MsgCancelBid.Fields().ByName("bid_id") + fd_MsgCancelBid_auction_id = md_MsgCancelBid.Fields().ByName("auction_id") +} + +var _ protoreflect.Message = (*fastReflection_MsgCancelBid)(nil) + +type fastReflection_MsgCancelBid MsgCancelBid + +func (x *MsgCancelBid) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCancelBid)(x) +} + +func (x *MsgCancelBid) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgCancelBid_messageType fastReflection_MsgCancelBid_messageType +var _ protoreflect.MessageType = fastReflection_MsgCancelBid_messageType{} + +type fastReflection_MsgCancelBid_messageType struct{} + +func (x fastReflection_MsgCancelBid_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCancelBid)(nil) +} +func (x fastReflection_MsgCancelBid_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCancelBid) +} +func (x fastReflection_MsgCancelBid_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelBid +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCancelBid) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelBid +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgCancelBid) Type() protoreflect.MessageType { + return _fastReflection_MsgCancelBid_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCancelBid) New() protoreflect.Message { + return new(fastReflection_MsgCancelBid) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCancelBid) Interface() protoreflect.ProtoMessage { + return (*MsgCancelBid)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgCancelBid) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BidId != uint64(0) { + value := protoreflect.ValueOfUint64(x.BidId) + if !f(fd_MsgCancelBid_bid_id, value) { + return + } + } + if x.AuctionId != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuctionId) + if !f(fd_MsgCancelBid_auction_id, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgCancelBid) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "reserve.auction.v1.MsgCancelBid.bid_id": + return x.BidId != uint64(0) + case "reserve.auction.v1.MsgCancelBid.auction_id": + return x.AuctionId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBid does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBid) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "reserve.auction.v1.MsgCancelBid.bid_id": + x.BidId = uint64(0) + case "reserve.auction.v1.MsgCancelBid.auction_id": + x.AuctionId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBid does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgCancelBid) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "reserve.auction.v1.MsgCancelBid.bid_id": + value := x.BidId + return protoreflect.ValueOfUint64(value) + case "reserve.auction.v1.MsgCancelBid.auction_id": + value := x.AuctionId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBid does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBid) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "reserve.auction.v1.MsgCancelBid.bid_id": + x.BidId = value.Uint() + case "reserve.auction.v1.MsgCancelBid.auction_id": + x.AuctionId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBid does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBid) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgCancelBid.bid_id": + panic(fmt.Errorf("field bid_id of message reserve.auction.v1.MsgCancelBid is not mutable")) + case "reserve.auction.v1.MsgCancelBid.auction_id": + panic(fmt.Errorf("field auction_id of message reserve.auction.v1.MsgCancelBid is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBid does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgCancelBid) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "reserve.auction.v1.MsgCancelBid.bid_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "reserve.auction.v1.MsgCancelBid.auction_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBid")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBid does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgCancelBid) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.MsgCancelBid", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgCancelBid) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBid) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgCancelBid) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgCancelBid) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCancelBid) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.BidId != 0 { + n += 1 + runtime.Sov(uint64(x.BidId)) + } + if x.AuctionId != 0 { + n += 1 + runtime.Sov(uint64(x.AuctionId)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelBid) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AuctionId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuctionId)) + i-- + dAtA[i] = 0x10 + } + if x.BidId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BidId)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelBid) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + x.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + x.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgCancelBidResponse protoreflect.MessageDescriptor +) + +func init() { + file_reserve_auction_v1_tx_proto_init() + md_MsgCancelBidResponse = File_reserve_auction_v1_tx_proto.Messages().ByName("MsgCancelBidResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCancelBidResponse)(nil) + +type fastReflection_MsgCancelBidResponse MsgCancelBidResponse + +func (x *MsgCancelBidResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCancelBidResponse)(x) +} + +func (x *MsgCancelBidResponse) slowProtoReflect() protoreflect.Message { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgCancelBidResponse_messageType fastReflection_MsgCancelBidResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCancelBidResponse_messageType{} + +type fastReflection_MsgCancelBidResponse_messageType struct{} + +func (x fastReflection_MsgCancelBidResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCancelBidResponse)(nil) +} +func (x fastReflection_MsgCancelBidResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCancelBidResponse) +} +func (x fastReflection_MsgCancelBidResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelBidResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCancelBidResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelBidResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgCancelBidResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCancelBidResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCancelBidResponse) New() protoreflect.Message { + return new(fastReflection_MsgCancelBidResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCancelBidResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCancelBidResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgCancelBidResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgCancelBidResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBidResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBidResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBidResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgCancelBidResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBidResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBidResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBidResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBidResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBidResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgCancelBidResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: reserve.auction.v1.MsgCancelBidResponse")) + } + panic(fmt.Errorf("message reserve.auction.v1.MsgCancelBidResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgCancelBidResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in reserve.auction.v1.MsgCancelBidResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgCancelBidResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelBidResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgCancelBidResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgCancelBidResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCancelBidResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelBidResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelBidResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: reserve/auction/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgBid is the Msg/Bid request type. +type MsgBid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bidder is the address that submitting the bid entry. + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bidding auction id + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // amount defines the amount that the bidder willing to pay. + Amount *v1beta1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // recive_rate defines the rate compare to the price at the start of the auction + // that the bid is willing to pay + ReciveRate string `protobuf:"bytes,4,opt,name=recive_rate,json=reciveRate,proto3" json:"recive_rate,omitempty"` +} + +func (x *MsgBid) Reset() { + *x = MsgBid{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgBid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgBid) ProtoMessage() {} + +// Deprecated: Use MsgBid.ProtoReflect.Descriptor instead. +func (*MsgBid) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgBid) GetBidder() string { + if x != nil { + return x.Bidder + } + return "" +} + +func (x *MsgBid) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +func (x *MsgBid) GetAmount() *v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +func (x *MsgBid) GetReciveRate() string { + if x != nil { + return x.ReciveRate + } + return "" +} + +// MsgBidResponse defines the response structure for executing a +// MsgBid message. +type MsgBidResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *MsgBidResponse) Reset() { + *x = MsgBidResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgBidResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgBidResponse) ProtoMessage() {} + +// Deprecated: Use MsgBidResponse.ProtoReflect.Descriptor instead. +func (*MsgBidResponse) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgBidResponse) GetResponse() string { + if x != nil { + return x.Response + } + return "" +} + +// MsgCancelBid is the Msg/CancelBid request type. +type MsgCancelBid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bid_id is the unique id. + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` + // bidding auction id + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` +} + +func (x *MsgCancelBid) Reset() { + *x = MsgCancelBid{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelBid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCancelBid) ProtoMessage() {} + +// Deprecated: Use MsgCancelBid.ProtoReflect.Descriptor instead. +func (*MsgCancelBid) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgCancelBid) GetBidId() uint64 { + if x != nil { + return x.BidId + } + return 0 +} + +func (x *MsgCancelBid) GetAuctionId() uint64 { + if x != nil { + return x.AuctionId + } + return 0 +} + +// MsgCancelBidResponse defines the response structure for executing a +// MsgCancelBid message. +type MsgCancelBidResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCancelBidResponse) Reset() { + *x = MsgCancelBidResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_reserve_auction_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelBidResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCancelBidResponse) ProtoMessage() {} + +// Deprecated: Use MsgCancelBidResponse.ProtoReflect.Descriptor instead. +func (*MsgCancelBidResponse) Descriptor() ([]byte, []int) { + return file_reserve_auction_v1_tx_proto_rawDescGZIP(), []int{5} +} + +var File_reserve_auction_v1_tx_proto protoreflect.FileDescriptor + +var file_reserve_auction_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xbd, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x33, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x20, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x78, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x06, 0x4d, + 0x73, 0x67, 0x42, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x69, 0x76, 0x65, 0x5f, 0x72, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x69, 0x76, + 0x65, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x28, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x78, + 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x4d, 0x73, 0x67, 0x42, 0x69, 0x64, 0x22, + 0x2c, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x0a, + 0x0c, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, + 0x69, 0x64, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x3a, 0x2e, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, + 0x8a, 0xe7, 0xb0, 0x2a, 0x1e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x78, 0x2f, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x42, 0x69, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8e, 0x02, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1a, 0x2e, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x69, 0x64, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x69, 0x64, 0x1a, 0x28, 0x2e, 0x72, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xba, 0x01, 0x0a, + 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x2d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x41, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_reserve_auction_v1_tx_proto_rawDescOnce sync.Once + file_reserve_auction_v1_tx_proto_rawDescData = file_reserve_auction_v1_tx_proto_rawDesc +) + +func file_reserve_auction_v1_tx_proto_rawDescGZIP() []byte { + file_reserve_auction_v1_tx_proto_rawDescOnce.Do(func() { + file_reserve_auction_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_reserve_auction_v1_tx_proto_rawDescData) + }) + return file_reserve_auction_v1_tx_proto_rawDescData +} + +var file_reserve_auction_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_reserve_auction_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: reserve.auction.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: reserve.auction.v1.MsgUpdateParamsResponse + (*MsgBid)(nil), // 2: reserve.auction.v1.MsgBid + (*MsgBidResponse)(nil), // 3: reserve.auction.v1.MsgBidResponse + (*MsgCancelBid)(nil), // 4: reserve.auction.v1.MsgCancelBid + (*MsgCancelBidResponse)(nil), // 5: reserve.auction.v1.MsgCancelBidResponse + (*Params)(nil), // 6: reserve.auction.v1.Params + (*v1beta1.Coin)(nil), // 7: cosmos.base.v1beta1.Coin +} +var file_reserve_auction_v1_tx_proto_depIdxs = []int32{ + 6, // 0: reserve.auction.v1.MsgUpdateParams.params:type_name -> reserve.auction.v1.Params + 7, // 1: reserve.auction.v1.MsgBid.amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 2: reserve.auction.v1.Msg.UpdateParams:input_type -> reserve.auction.v1.MsgUpdateParams + 2, // 3: reserve.auction.v1.Msg.Bid:input_type -> reserve.auction.v1.MsgBid + 4, // 4: reserve.auction.v1.Msg.CancelBid:input_type -> reserve.auction.v1.MsgCancelBid + 1, // 5: reserve.auction.v1.Msg.UpdateParams:output_type -> reserve.auction.v1.MsgUpdateParamsResponse + 3, // 6: reserve.auction.v1.Msg.Bid:output_type -> reserve.auction.v1.MsgBidResponse + 5, // 7: reserve.auction.v1.Msg.CancelBid:output_type -> reserve.auction.v1.MsgCancelBidResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_reserve_auction_v1_tx_proto_init() } +func file_reserve_auction_v1_tx_proto_init() { + if File_reserve_auction_v1_tx_proto != nil { + return + } + file_reserve_auction_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_reserve_auction_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgBid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgBidResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCancelBid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_reserve_auction_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCancelBidResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_reserve_auction_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_reserve_auction_v1_tx_proto_goTypes, + DependencyIndexes: file_reserve_auction_v1_tx_proto_depIdxs, + MessageInfos: file_reserve_auction_v1_tx_proto_msgTypes, + }.Build() + File_reserve_auction_v1_tx_proto = out.File + file_reserve_auction_v1_tx_proto_rawDesc = nil + file_reserve_auction_v1_tx_proto_goTypes = nil + file_reserve_auction_v1_tx_proto_depIdxs = nil +} diff --git a/api/reserve/auction/v1/tx_grpc.pb.go b/api/reserve/auction/v1/tx_grpc.pb.go new file mode 100644 index 0000000..253cf73 --- /dev/null +++ b/api/reserve/auction/v1/tx_grpc.pb.go @@ -0,0 +1,209 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: reserve/auction/v1/tx.proto + +package auctionv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Msg_UpdateParams_FullMethodName = "/reserve.auction.v1.Msg/UpdateParams" + Msg_Bid_FullMethodName = "/reserve.auction.v1.Msg/Bid" + Msg_CancelBid_FullMethodName = "/reserve.auction.v1.Msg/CancelBid" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // Bid defines an operation for submit a bid entry. + Bid(ctx context.Context, in *MsgBid, opts ...grpc.CallOption) (*MsgBidResponse, error) + // CancelBid defines an operation for cancel an existing bid entry. + CancelBid(ctx context.Context, in *MsgCancelBid, opts ...grpc.CallOption) (*MsgCancelBidResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Bid(ctx context.Context, in *MsgBid, opts ...grpc.CallOption) (*MsgBidResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgBidResponse) + err := c.cc.Invoke(ctx, Msg_Bid_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelBid(ctx context.Context, in *MsgCancelBid, opts ...grpc.CallOption) (*MsgCancelBidResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCancelBidResponse) + err := c.cc.Invoke(ctx, Msg_CancelBid_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility. +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // Bid defines an operation for submit a bid entry. + Bid(context.Context, *MsgBid) (*MsgBidResponse, error) + // CancelBid defines an operation for cancel an existing bid entry. + CancelBid(context.Context, *MsgCancelBid) (*MsgCancelBidResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) Bid(context.Context, *MsgBid) (*MsgBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Bid not implemented") +} +func (UnimplementedMsgServer) CancelBid(context.Context, *MsgCancelBid) (*MsgCancelBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelBid not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Msg_ServiceDesc, srv) +} + +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: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Bid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Bid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Bid_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Bid(ctx, req.(*MsgBid)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CancelBid_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelBid(ctx, req.(*MsgCancelBid)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "reserve.auction.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Bid", + Handler: _Msg_Bid_Handler, + }, + { + MethodName: "CancelBid", + Handler: _Msg_CancelBid_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "reserve/auction/v1/tx.proto", +} diff --git a/api/reserve/oracle/genesis.pulsar.go b/api/reserve/oracle/genesis.pulsar.go index 3bf2c41..94db678 100644 --- a/api/reserve/oracle/genesis.pulsar.go +++ b/api/reserve/oracle/genesis.pulsar.go @@ -2,17 +2,16 @@ package oracle import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/reserve/oracle/module/module.pulsar.go b/api/reserve/oracle/module/module.pulsar.go index 62ea9a4..7d43893 100644 --- a/api/reserve/oracle/module/module.pulsar.go +++ b/api/reserve/oracle/module/module.pulsar.go @@ -2,16 +2,15 @@ package module import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( @@ -453,7 +452,8 @@ type Module struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // authority defines the custom module authority. If not set, defaults to the governance module. + // authority defines the custom module authority. If not set, defaults to the + // governance module. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` } @@ -492,24 +492,26 @@ var file_reserve_oracle_module_module_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x18, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x12, 0x0a, 0x10, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x78, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x42, - 0xc6, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0b, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x52, 0x4f, 0x4d, 0xaa, 0x02, 0x15, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0xca, 0x02, 0x15, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, - 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, 0x21, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x17, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, - 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x31, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2b, 0x0a, 0x29, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x6f, 0x6d, 0x79, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, + 0x78, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x42, 0xc6, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, + 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xa2, 0x02, 0x03, + 0x52, 0x4f, 0x4d, 0xaa, 0x02, 0x15, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xca, 0x02, 0x15, 0x52, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0xe2, 0x02, 0x21, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/reserve/oracle/packet.pulsar.go b/api/reserve/oracle/packet.pulsar.go index 0f31fc9..d58e4ce 100644 --- a/api/reserve/oracle/packet.pulsar.go +++ b/api/reserve/oracle/packet.pulsar.go @@ -3,14 +3,13 @@ package oracle import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/reserve/oracle/params.pulsar.go b/api/reserve/oracle/params.pulsar.go index 3af87e1..5df20a8 100644 --- a/api/reserve/oracle/params.pulsar.go +++ b/api/reserve/oracle/params.pulsar.go @@ -2,17 +2,16 @@ package oracle import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/reserve/oracle/query.pulsar.go b/api/reserve/oracle/query.pulsar.go index 26fbe89..8853fd2 100644 --- a/api/reserve/oracle/query.pulsar.go +++ b/api/reserve/oracle/query.pulsar.go @@ -2,19 +2,17 @@ package oracle import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" - _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( @@ -895,36 +893,33 @@ var file_reserve_oracle_query_proto_rawDesc = []byte{ 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, - 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x32, 0x7a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x71, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x72, 0x65, + 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x7a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x71, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x42, 0x9a, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x52, 0x4f, 0x58, 0xaa, 0x02, 0x0e, 0x52, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0xca, 0x02, 0x0e, - 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0xe2, 0x02, - 0x1a, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x52, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9a, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x42, 0x0a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x52, 0x4f, 0x58, + 0xaa, 0x02, 0x0e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0xca, 0x02, 0x0e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0xe2, 0x02, 0x1a, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5c, 0x4f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0f, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/reserve/oracle/query_grpc.pb.go b/api/reserve/oracle/query_grpc.pb.go index b70263e..b5b8780 100644 --- a/api/reserve/oracle/query_grpc.pb.go +++ b/api/reserve/oracle/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: reserve/oracle/query.proto @@ -8,7 +8,6 @@ package oracle import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -16,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/reserve.oracle.Query/Params" @@ -26,6 +25,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) @@ -40,8 +41,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -50,21 +52,27 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -74,6 +82,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/reserve/oracle/tx.pulsar.go b/api/reserve/oracle/tx.pulsar.go index 151986d..f2fa449 100644 --- a/api/reserve/oracle/tx.pulsar.go +++ b/api/reserve/oracle/tx.pulsar.go @@ -2,19 +2,18 @@ package oracle import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( @@ -891,7 +890,8 @@ type MsgUpdateParams struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // authority is the address that controls the module (defaults to x/gov unless overwritten). + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // params defines the module parameters to update. // diff --git a/api/reserve/oracle/tx_grpc.pb.go b/api/reserve/oracle/tx_grpc.pb.go index 89c21dc..c1e65e4 100644 --- a/api/reserve/oracle/tx_grpc.pb.go +++ b/api/reserve/oracle/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: reserve/oracle/tx.proto @@ -8,7 +8,6 @@ package oracle import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -16,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_UpdateParams_FullMethodName = "/reserve.oracle.Msg/UpdateParams" @@ -26,6 +25,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. type MsgClient interface { // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. @@ -41,8 +42,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -51,7 +53,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. @@ -59,14 +63,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -76,6 +84,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/go.mod b/go.mod index 7c73d6b..c7d528c 100644 --- a/go.mod +++ b/go.mod @@ -12,10 +12,12 @@ replace ( require ( cosmossdk.io/api v0.7.3 cosmossdk.io/client/v2 v2.0.0-beta.1 + cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 + cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 cosmossdk.io/tools/confix v0.1.1 cosmossdk.io/x/circuit v0.1.0 @@ -54,8 +56,6 @@ require ( cloud.google.com/go/storage v1.38.0 // indirect connectrpc.com/connect v1.15.0 // indirect connectrpc.com/otelconnect v0.7.0 // indirect - cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/proto/buf.lock b/proto/buf.lock index f001cdd..c13911b 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -4,35 +4,40 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 - digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: aa25660f4ff746388669ce36b3778442 - digest: shake256:a20eb29eb7284d9d0b76e94324a6e24e3665d13682bed0d5beac647d7109b7b2f22080301276779a91f394c97dab334da36dfc01d4252d9f869b090bfc8248aa + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 - digest: shake256:3d3bee5229ba579e7d19ffe6e140986a228b48a8c7fe74348f308537ab95e9135210e81812489d42cd8941d33ff71f11583174ccc5972e86e6112924b6ce9f04 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: cosmos repository: ibc - commit: c159402ffeef4c21a7f9f0643817ae0d - digest: shake256:694e3f5a1d469798bb6cb3510f6f489e10d9309d1f2e8f7a369a776947602195f13ab65972d2d586a1134978b6a6fa28a43e5d7710ef5032ba0c7fbbe6038f08 + commit: 41fbc441e4d645119d275150719c5441 + digest: shake256:a61d3e152909abddc91dcc1aec8ac997007bebd48a7921bc243681c708e6c9068f6484aa7ed4e6ff60101d3422c98744a4a5294bbda6aacdba07f1dfa4291020 - remote: buf.build owner: cosmos repository: ics23 - commit: 3c44d8daa8b44059ac744cd17d4a49d7 - digest: shake256:fed75bde09a652f2cbe6085d5e1afa8292f166a0f6314369fb60b71c189d34e893ee1bffde527373abd371c110bdc80e8ed1d534eaaf5da6bc62634903a6ec44 + commit: d2ad30d1af0e4e978fa1f5c143acf63b + digest: shake256:000ea62514f7d507c96905d70ef11d16b8f8f32fda5a75def40d4130058af0174142ed3cd6c4a89c5fdb3cbf138277d771d86eeb6992f054d13a82556a2ff079 - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 - digest: shake256:d865f55b8ceb838c90c28b09894ab43d07f42551108c23760004a6a4e28fe24d3a1f7380a3c9278edb329a338a9cc5db8ad9f394de548e70d534e98504972d67 + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 - remote: buf.build owner: protocolbuffers repository: wellknowntypes - commit: 44e83bc050a4497fa7b36b34d95ca156 - digest: shake256:bcdc007a8baabe27bdc06f3c8973bed7bea9faca4b486903a8f65c0492985864143888eb570a956ce4127d6afdaea346cf0393405a8144a1c5d026318c4c254c + commit: d59b7d45e69d4e129a1b797e2766f067 + digest: shake256:e4bb315f5a90aace88fe39709c831eda8eb0ce66b4cf947065888100b9867c2eb9a0f61f6b8d73c51b1fcccdfe8611090f55ce5db1aee6901ec9b4e6d8fa8e52 + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d