From 22834abc847a5f16f1cff461d08cd04e98aa5c59 Mon Sep 17 00:00:00 2001 From: ThanhNhann Date: Thu, 26 Sep 2024 23:36:49 +0700 Subject: [PATCH] add AddNewSymbolToBandOracleRequest to support vault --- proto/reserve/oracle/genesis.proto | 39 +- proto/reserve/oracle/proposal.proto | 12 - x/oracle/client/cli/tx.go | 135 ------ x/oracle/keeper/band_oracle.go | 58 +++ x/oracle/module/genesis.go | 17 +- x/oracle/proposal_handler.go | 16 - x/oracle/types/codec.go | 2 - x/oracle/types/genesis.go | 1 + x/oracle/types/genesis.pb.go | 649 +++++++++++++++++++++++----- x/oracle/types/keys.go | 15 +- x/oracle/types/params.go | 27 +- x/oracle/types/proposal.go | 70 --- x/oracle/types/proposal.pb.go | 333 ++------------ 13 files changed, 710 insertions(+), 664 deletions(-) diff --git a/proto/reserve/oracle/genesis.proto b/proto/reserve/oracle/genesis.proto index 468920b..48a5241 100644 --- a/proto/reserve/oracle/genesis.proto +++ b/proto/reserve/oracle/genesis.proto @@ -15,12 +15,13 @@ message GenesisState { // params defines all the parameters of the module. Params params = 1 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - BandParams band_params = 8 [ (gogoproto.nullable) = false ]; - repeated BandPriceState band_price_states = 2; - repeated BandOracleRequest band_oracle_requests = 3; - uint64 band_latest_client_id = 4; - repeated CalldataRecord calldata_records = 5; - uint64 band_latest_request_id = 11; + BandParams band_params = 2 [ (gogoproto.nullable) = false ]; + repeated BandPriceState band_price_states = 3; + repeated BandOracleRequest band_oracle_requests = 4; + uint64 band_latest_client_id = 5; + repeated CalldataRecord calldata_records = 6; + uint64 band_latest_request_id = 7; + BandOracleRequestParams band_oracle_request_params = 8 [ (gogoproto.nullable) = false ]; } message BandOracleRequest { @@ -59,6 +60,32 @@ message BandOracleRequest { uint64 min_source_count = 9; } +message BandOracleRequestParams { + // AskCount is the number of validators that are requested to respond to this + // oracle request. Higher value means more security, at a higher gas cost. + uint64 ask_count = 1; + + // MinCount is the minimum number of validators necessary for the request to + // proceed to the execution phase. Higher value means more security, at the + // cost of liveness. + uint64 min_count = 2; + + // FeeLimit is the maximum tokens that will be paid to all data source + // providers. + repeated cosmos.base.v1beta1.Coin fee_limit = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // PrepareGas is amount of gas to pay to prepare raw requests + uint64 prepare_gas = 4; + // ExecuteGas is amount of gas to reserve for executing + uint64 execute_gas = 5; + // MinSourceCount is the minimum number of data sources that must be used by + // each validator + uint64 min_source_count = 6; +} + message BandParams { // block request interval to send Band IBC prices int64 ibc_request_interval = 2; diff --git a/proto/reserve/oracle/proposal.proto b/proto/reserve/oracle/proposal.proto index 4ce9e15..34aab32 100644 --- a/proto/reserve/oracle/proposal.proto +++ b/proto/reserve/oracle/proposal.proto @@ -21,18 +21,6 @@ message UpdateBandParamsProposal { BandParams band_params = 3 [ (gogoproto.nullable) = false ]; } -message AuthorizeBandOracleRequestProposal { - option (amino.name) = "oracle/AuthorizeBandOracleRequestProposal"; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - string title = 1; - string description = 2; - BandOracleRequest request = 3 [ (gogoproto.nullable) = false ]; -} - message UpdateBandOracleRequestProposal { option (amino.name) = "oracle/UpdateBandOracleRequestProposal"; option (gogoproto.equal) = false; diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go index 2244a9a..eea8042 100644 --- a/x/oracle/client/cli/tx.go +++ b/x/oracle/client/cli/tx.go @@ -39,7 +39,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( NewRequestBandRatesTxCmd(), - NewAuthorizeBandOracleRequestProposalTxCmd(), NewUpdateBandOracleRequestProposalTxCmd(), NewDeleteBandOracleRequestProposalTxCmd(), ) @@ -87,61 +86,6 @@ func NewRequestBandRatesTxCmd() *cobra.Command { return cmd } -func NewAuthorizeBandOracleRequestProposalTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "authorize-band-oracle-request-proposal [flags]", - Args: cobra.ExactArgs(1), - Short: "Submit a proposal to authorize a Band Oracle IBC Request.", - Long: `Submit a proposal to authorize a Band Oracle IBC Request. - Example: - $ %s tx oracle authorize-band-oracle-request-proposal 23 --symbols "BTC,ETH,USDT,USDC" --requested-validator-count 4 --sufficient-validator-count 3 --min-source-count 3 --prepare-gas 20000 --fee-limit "1000uband" --execute-gas 400000 --from mykey - `, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - content, err := authorizeBandOracleRequestProposalArgsToContent(cmd, args) - if err != nil { - return err - } - - from := clientCtx.GetFromAddress() - - depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) - if err != nil { - return err - } - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().StringSlice(flagSymbols, []string{}, "Symbols used in calling the oracle script") - cmd.Flags().Uint64(flagPrepareGas, 50000, "Prepare gas used in fee counting for prepare request") - cmd.Flags().Uint64(flagExecuteGas, 300000, "Execute gas used in fee counting for execute request") - cmd.Flags().String(flagFeeLimit, "", "the maximum tokens that will be paid to all data source providers") - cmd.Flags().Uint64(flagRequestedValidatorCount, 4, "Requested Validator Count") - cmd.Flags().Uint64(flagSufficientValidatorCount, 10, "Sufficient Validator Count") - cmd.Flags().Uint64(flagMinSourceCount, 3, "Min Source Count") - cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") - cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") - cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") - - flags.AddTxFlagsToCmd(cmd) - return cmd -} - func NewUpdateBandOracleRequestProposalTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: "update-band-oracle-request-proposal 1 37 [flags]", @@ -245,85 +189,6 @@ func NewDeleteBandOracleRequestProposalTxCmd() *cobra.Command { return cmd } -func authorizeBandOracleRequestProposalArgsToContent( - cmd *cobra.Command, - args []string, -) (govtypes.Content, error) { - title, err := cmd.Flags().GetString(govcli.FlagTitle) - if err != nil { - return nil, err - } - - description, err := cmd.Flags().GetString(govcli.FlagDescription) - if err != nil { - return nil, err - } - - int64OracleScriptID, err := strconv.ParseInt(args[0], 10, 64) - if err != nil { - return nil, err - } - - askCount, err := cmd.Flags().GetUint64(flagRequestedValidatorCount) - if err != nil { - return nil, err - } - - minCount, err := cmd.Flags().GetUint64(flagSufficientValidatorCount) - if err != nil { - return nil, err - } - - minSourceCount, err := cmd.Flags().GetUint64(flagMinSourceCount) - if err != nil { - return nil, err - } - - symbols, err := cmd.Flags().GetStringSlice(flagSymbols) - if err != nil { - return nil, err - } - - prepareGas, err := cmd.Flags().GetUint64(flagPrepareGas) - if err != nil { - return nil, err - } - - executeGas, err := cmd.Flags().GetUint64(flagExecuteGas) - if err != nil { - return nil, err - } - - coinStr, err := cmd.Flags().GetString(flagFeeLimit) - if err != nil { - return nil, err - } - - feeLimit, err := sdk.ParseCoinsNormalized(coinStr) - if err != nil { - return nil, err - } - - content := &types.AuthorizeBandOracleRequestProposal{ - Title: title, - Description: description, - Request: types.BandOracleRequest{ - OracleScriptId: int64OracleScriptID, - Symbols: symbols, - AskCount: askCount, - MinCount: minCount, - FeeLimit: feeLimit, - PrepareGas: prepareGas, - ExecuteGas: executeGas, - MinSourceCount: minSourceCount, - }, - } - if err := content.ValidateBasic(); err != nil { - return nil, err - } - return content, nil -} - func updateBandOracleRequestProposalArgsToContent( cmd *cobra.Command, args []string, diff --git a/x/oracle/keeper/band_oracle.go b/x/oracle/keeper/band_oracle.go index b6fcbc7..278647e 100644 --- a/x/oracle/keeper/band_oracle.go +++ b/x/oracle/keeper/band_oracle.go @@ -41,6 +41,31 @@ func (k Keeper) GetBandParams(ctx sdk.Context) types.BandParams { return bandParams } +// SetBandOracleRequestParams sets the Band Oracle request params in the state +func (k Keeper) SetBandOracleRequestParams(ctx sdk.Context, bandOracleRequestParams types.BandOracleRequestParams) error{ + bz := k.cdc.MustMarshal(&bandOracleRequestParams) + store := k.storeService.OpenKVStore(ctx) + return store.Set(types.BandOracleRequestParamsKey, bz) +} + +// GetBandParams gets the Band params stored in the state +func (k Keeper) GetBandOracleRequestParams(ctx sdk.Context) types.BandOracleRequestParams { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.BandParamsKey) + + if err != nil { + return types.DefaultGenesis().BandOracleRequestParams + } + + if bz == nil { + return types.DefaultGenesis().BandOracleRequestParams + } + + var bandOracleRequestParams types.BandOracleRequestParams + k.cdc.MustUnmarshal(bz, &bandOracleRequestParams) + return bandOracleRequestParams +} + // SetBandCallData sets the Band IBC oracle request call data func (k Keeper) SetBandCallDataRecord(ctx sdk.Context, record *types.CalldataRecord) error { bz := k.cdc.MustMarshal(record) @@ -112,6 +137,7 @@ func (k Keeper) GetBandLatestRequestID(ctx sdk.Context) uint64 { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(types.LatestRequestIDKey) if err != nil { + // TODO: should we return 0 here? return 0 } if bz == nil { @@ -215,6 +241,38 @@ func (k *Keeper) GetAllBandPriceStates(ctx sdk.Context) []*types.BandPriceState return priceStates } +// AddNewSymbolToBandOracleRequest adds a new symbol to the bandOracle request +func (k Keeper) AddNewSymbolToBandOracleRequest(ctx sdk.Context, symbol string, oracleScriptId int64) error{ + allBandOracleRequests := k.GetAllBandOracleRequests(ctx) + // check if new symbol's oracle script id is existing + for _, req := range allBandOracleRequests { + if req.OracleScriptId == oracleScriptId { + req.Symbols = append(req.Symbols, symbol) + k.SetBandOracleRequest(ctx, *req) + return nil + } + } + + bandOracleRequestParams := k.GetBandOracleRequestParams(ctx) + requestID := k.GetBandLatestRequestID(ctx) + 1 + newBandOracleRequest := types.BandOracleRequest{ + RequestId: requestID, + OracleScriptId: oracleScriptId, + Symbols: []string{symbol}, + AskCount: bandOracleRequestParams.AskCount, + MinCount: bandOracleRequestParams.MinCount, + FeeLimit: bandOracleRequestParams.FeeLimit, + PrepareGas: bandOracleRequestParams.PrepareGas, + ExecuteGas: bandOracleRequestParams.ExecuteGas, + MinSourceCount: bandOracleRequestParams.MinSourceCount, + } + + k.SetBandOracleRequest(ctx, newBandOracleRequest) + + k.SetBandLatestRequestID(ctx, requestID) + return nil +} + // GetPrice fetches band ibc prices for a given pair in math.LegacyDec func (k *Keeper) GetPrice(ctx sdk.Context, base, quote string) *math.LegacyDec { // query ref by using GetBandPriceState diff --git a/x/oracle/module/genesis.go b/x/oracle/module/genesis.go index 46320e8..41ac3c6 100644 --- a/x/oracle/module/genesis.go +++ b/x/oracle/module/genesis.go @@ -48,17 +48,20 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if genState.BandLatestRequestId != 0 { k.SetBandLatestRequestID(ctx, genState.BandLatestRequestId) } + + k.SetBandOracleRequestParams(ctx, genState.BandOracleRequestParams) } // ExportGenesis returns the module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { return &types.GenesisState{ - Params: k.GetParams(ctx), - BandParams: k.GetBandParams(ctx), - BandPriceStates: k.GetAllBandPriceStates(ctx), - BandOracleRequests: k.GetAllBandOracleRequests(ctx), - BandLatestClientId: k.GetBandLatestClientID(ctx), - CalldataRecords: k.GetAllBandCalldataRecords(ctx), - BandLatestRequestId: k.GetBandLatestRequestID(ctx), + Params: k.GetParams(ctx), + BandParams: k.GetBandParams(ctx), + BandPriceStates: k.GetAllBandPriceStates(ctx), + BandOracleRequests: k.GetAllBandOracleRequests(ctx), + BandLatestClientId: k.GetBandLatestClientID(ctx), + CalldataRecords: k.GetAllBandCalldataRecords(ctx), + BandLatestRequestId: k.GetBandLatestRequestID(ctx), + BandOracleRequestParams: k.GetBandOracleRequestParams(ctx), } } diff --git a/x/oracle/proposal_handler.go b/x/oracle/proposal_handler.go index 2939df9..a936970 100644 --- a/x/oracle/proposal_handler.go +++ b/x/oracle/proposal_handler.go @@ -16,8 +16,6 @@ func NewOracleProposalHandler(k keeper.Keeper) govtypes.Handler { switch c := content.(type) { case *types.UpdateBandParamsProposal: return handleUpdateBandParamsProposal(ctx, k, c) - case *types.AuthorizeBandOracleRequestProposal: - return handleAuthorizeBandOracleRequestProposal(ctx, k, c) case *types.UpdateBandOracleRequestProposal: return handleUpdateBandOracleRequestProposal(ctx, k, c) @@ -49,20 +47,6 @@ func handleUpdateBandParamsProposal(ctx sdk.Context, k keeper.Keeper, p *types.U return nil } -func handleAuthorizeBandOracleRequestProposal(ctx sdk.Context, k keeper.Keeper, p *types.AuthorizeBandOracleRequestProposal) error { - if err := p.ValidateBasic(); err != nil { - return err - } - - requestID := k.GetBandLatestRequestID(ctx) + 1 - p.Request.RequestId = requestID - - k.SetBandOracleRequest(ctx, p.Request) - - k.SetBandLatestRequestID(ctx, requestID) - return nil -} - func handleUpdateBandOracleRequestProposal(ctx sdk.Context, k keeper.Keeper, p *types.UpdateBandOracleRequestProposal) error { if err := p.ValidateBasic(); err != nil { return err diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go index a6e7df4..137cfbe 100644 --- a/x/oracle/types/codec.go +++ b/x/oracle/types/codec.go @@ -16,7 +16,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgRequestBandRates{}, "oracle/MsgRequestBandRates", nil) cdc.RegisterConcrete(&UpdateBandParamsProposal{}, "oracle/UpdateBandParamsProposal", nil) - cdc.RegisterConcrete(&AuthorizeBandOracleRequestProposal{}, "oracle/AuthorizeBandOracleRequestProposal", nil) cdc.RegisterConcrete(&UpdateBandOracleRequestProposal{}, "oracle/UpdateBandOracleRequestProposal", nil) cdc.RegisterConcrete(&DeleteBandOracleRequestProposal{}, "oracle/DeleteBandOracleRequestProposal", nil) } @@ -29,7 +28,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*govtypes.Content)(nil), &UpdateBandParamsProposal{}, - &AuthorizeBandOracleRequestProposal{}, &UpdateBandOracleRequestProposal{}, &DeleteBandOracleRequestProposal{}, ) diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 172e3de..075389a 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -10,6 +10,7 @@ func DefaultGenesis() *GenesisState { // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), BandParams: DefaultBandParams(), + BandOracleRequestParams: DefaultBandOracelRequestParams(), } } diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 09e2f42..1789542 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -30,13 +30,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the oracle 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"` - BandParams BandParams `protobuf:"bytes,8,opt,name=band_params,json=bandParams,proto3" json:"band_params"` - BandPriceStates []*BandPriceState `protobuf:"bytes,2,rep,name=band_price_states,json=bandPriceStates,proto3" json:"band_price_states,omitempty"` - BandOracleRequests []*BandOracleRequest `protobuf:"bytes,3,rep,name=band_oracle_requests,json=bandOracleRequests,proto3" json:"band_oracle_requests,omitempty"` - BandLatestClientId uint64 `protobuf:"varint,4,opt,name=band_latest_client_id,json=bandLatestClientId,proto3" json:"band_latest_client_id,omitempty"` - CalldataRecords []*CalldataRecord `protobuf:"bytes,5,rep,name=calldata_records,json=calldataRecords,proto3" json:"calldata_records,omitempty"` - BandLatestRequestId uint64 `protobuf:"varint,11,opt,name=band_latest_request_id,json=bandLatestRequestId,proto3" json:"band_latest_request_id,omitempty"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + BandParams BandParams `protobuf:"bytes,2,opt,name=band_params,json=bandParams,proto3" json:"band_params"` + BandPriceStates []*BandPriceState `protobuf:"bytes,3,rep,name=band_price_states,json=bandPriceStates,proto3" json:"band_price_states,omitempty"` + BandOracleRequests []*BandOracleRequest `protobuf:"bytes,4,rep,name=band_oracle_requests,json=bandOracleRequests,proto3" json:"band_oracle_requests,omitempty"` + BandLatestClientId uint64 `protobuf:"varint,5,opt,name=band_latest_client_id,json=bandLatestClientId,proto3" json:"band_latest_client_id,omitempty"` + CalldataRecords []*CalldataRecord `protobuf:"bytes,6,rep,name=calldata_records,json=calldataRecords,proto3" json:"calldata_records,omitempty"` + BandLatestRequestId uint64 `protobuf:"varint,7,opt,name=band_latest_request_id,json=bandLatestRequestId,proto3" json:"band_latest_request_id,omitempty"` + BandOracleRequestParams BandOracleRequestParams `protobuf:"bytes,8,opt,name=band_oracle_request_params,json=bandOracleRequestParams,proto3" json:"band_oracle_request_params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -121,6 +122,13 @@ func (m *GenesisState) GetBandLatestRequestId() uint64 { return 0 } +func (m *GenesisState) GetBandOracleRequestParams() BandOracleRequestParams { + if m != nil { + return m.BandOracleRequestParams + } + return BandOracleRequestParams{} +} + type BandOracleRequest struct { // Unique Identifier for band ibc oracle request RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` @@ -244,6 +252,101 @@ func (m *BandOracleRequest) GetMinSourceCount() uint64 { return 0 } +type BandOracleRequestParams struct { + // AskCount is the number of validators that are requested to respond to this + // oracle request. Higher value means more security, at a higher gas cost. + AskCount uint64 `protobuf:"varint,1,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"` + // MinCount is the minimum number of validators necessary for the request to + // proceed to the execution phase. Higher value means more security, at the + // cost of liveness. + MinCount uint64 `protobuf:"varint,2,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` + // FeeLimit is the maximum tokens that will be paid to all data source + // providers. + FeeLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=fee_limit,json=feeLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee_limit"` + // PrepareGas is amount of gas to pay to prepare raw requests + PrepareGas uint64 `protobuf:"varint,4,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty"` + // ExecuteGas is amount of gas to reserve for executing + ExecuteGas uint64 `protobuf:"varint,5,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"` + // MinSourceCount is the minimum number of data sources that must be used by + // each validator + MinSourceCount uint64 `protobuf:"varint,6,opt,name=min_source_count,json=minSourceCount,proto3" json:"min_source_count,omitempty"` +} + +func (m *BandOracleRequestParams) Reset() { *m = BandOracleRequestParams{} } +func (m *BandOracleRequestParams) String() string { return proto.CompactTextString(m) } +func (*BandOracleRequestParams) ProtoMessage() {} +func (*BandOracleRequestParams) Descriptor() ([]byte, []int) { + return fileDescriptor_78a657bc7a2646c9, []int{2} +} +func (m *BandOracleRequestParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BandOracleRequestParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BandOracleRequestParams.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 *BandOracleRequestParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_BandOracleRequestParams.Merge(m, src) +} +func (m *BandOracleRequestParams) XXX_Size() int { + return m.Size() +} +func (m *BandOracleRequestParams) XXX_DiscardUnknown() { + xxx_messageInfo_BandOracleRequestParams.DiscardUnknown(m) +} + +var xxx_messageInfo_BandOracleRequestParams proto.InternalMessageInfo + +func (m *BandOracleRequestParams) GetAskCount() uint64 { + if m != nil { + return m.AskCount + } + return 0 +} + +func (m *BandOracleRequestParams) GetMinCount() uint64 { + if m != nil { + return m.MinCount + } + return 0 +} + +func (m *BandOracleRequestParams) GetFeeLimit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.FeeLimit + } + return nil +} + +func (m *BandOracleRequestParams) GetPrepareGas() uint64 { + if m != nil { + return m.PrepareGas + } + return 0 +} + +func (m *BandOracleRequestParams) GetExecuteGas() uint64 { + if m != nil { + return m.ExecuteGas + } + return 0 +} + +func (m *BandOracleRequestParams) GetMinSourceCount() uint64 { + if m != nil { + return m.MinSourceCount + } + return 0 +} + type BandParams struct { // block request interval to send Band IBC prices IbcRequestInterval int64 `protobuf:"varint,2,opt,name=ibc_request_interval,json=ibcRequestInterval,proto3" json:"ibc_request_interval,omitempty"` @@ -261,7 +364,7 @@ func (m *BandParams) Reset() { *m = BandParams{} } func (m *BandParams) String() string { return proto.CompactTextString(m) } func (*BandParams) ProtoMessage() {} func (*BandParams) Descriptor() ([]byte, []int) { - return fileDescriptor_78a657bc7a2646c9, []int{2} + return fileDescriptor_78a657bc7a2646c9, []int{3} } func (m *BandParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -337,7 +440,7 @@ func (m *BandPriceState) Reset() { *m = BandPriceState{} } func (m *BandPriceState) String() string { return proto.CompactTextString(m) } func (*BandPriceState) ProtoMessage() {} func (*BandPriceState) Descriptor() ([]byte, []int) { - return fileDescriptor_78a657bc7a2646c9, []int{3} + return fileDescriptor_78a657bc7a2646c9, []int{4} } func (m *BandPriceState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -403,7 +506,7 @@ func (m *PriceState) Reset() { *m = PriceState{} } func (m *PriceState) String() string { return proto.CompactTextString(m) } func (*PriceState) ProtoMessage() {} func (*PriceState) Descriptor() ([]byte, []int) { - return fileDescriptor_78a657bc7a2646c9, []int{4} + return fileDescriptor_78a657bc7a2646c9, []int{5} } func (m *PriceState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -448,7 +551,7 @@ func (m *CalldataRecord) Reset() { *m = CalldataRecord{} } func (m *CalldataRecord) String() string { return proto.CompactTextString(m) } func (*CalldataRecord) ProtoMessage() {} func (*CalldataRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_78a657bc7a2646c9, []int{5} + return fileDescriptor_78a657bc7a2646c9, []int{6} } func (m *CalldataRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -494,6 +597,7 @@ func (m *CalldataRecord) GetCalldata() []byte { func init() { proto.RegisterType((*GenesisState)(nil), "reserve.oracle.GenesisState") proto.RegisterType((*BandOracleRequest)(nil), "reserve.oracle.BandOracleRequest") + proto.RegisterType((*BandOracleRequestParams)(nil), "reserve.oracle.BandOracleRequestParams") proto.RegisterType((*BandParams)(nil), "reserve.oracle.BandParams") proto.RegisterType((*BandPriceState)(nil), "reserve.oracle.BandPriceState") proto.RegisterType((*PriceState)(nil), "reserve.oracle.PriceState") @@ -503,63 +607,66 @@ func init() { func init() { proto.RegisterFile("reserve/oracle/genesis.proto", fileDescriptor_78a657bc7a2646c9) } var fileDescriptor_78a657bc7a2646c9 = []byte{ - // 890 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x55, 0xcd, 0x6e, 0x1b, 0x37, - 0x10, 0xf6, 0x46, 0xb2, 0xa3, 0x1d, 0x19, 0xb2, 0xcd, 0x3a, 0x86, 0x2a, 0x27, 0xb2, 0xa2, 0x5e, - 0x84, 0xa0, 0xdd, 0x8d, 0x93, 0x53, 0x8e, 0x95, 0x0d, 0x04, 0x2a, 0x0c, 0x34, 0x58, 0x17, 0x3d, - 0xf4, 0xb2, 0xe0, 0x72, 0x19, 0x99, 0xf0, 0xee, 0x52, 0x25, 0x29, 0x21, 0x7e, 0x81, 0x9e, 0xfb, - 0x18, 0x45, 0x4f, 0x7d, 0x8c, 0x1c, 0x73, 0x6c, 0x7b, 0x48, 0x0d, 0xfb, 0xd0, 0xd7, 0x08, 0x38, - 0xa4, 0xfe, 0x6c, 0x5f, 0xa4, 0xe5, 0x37, 0xdf, 0x0c, 0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, 0x94, 0xc0, 0x58, 0xdb, 0xc9, 0x62, 0x3d, 0x1c, 0x7d, 0xbc, 0xe9, 0x06, 0x9f, 0x6e, - 0xba, 0xc1, 0xf5, 0x4d, 0x37, 0xf8, 0xfd, 0xb6, 0xbb, 0xf1, 0xe9, 0xb6, 0xbb, 0xf1, 0xf7, 0x6d, - 0x77, 0xe3, 0x97, 0x78, 0xe5, 0xaa, 0xc8, 0x4a, 0x96, 0x57, 0xf8, 0x1a, 0x30, 0x59, 0xc4, 0xf3, - 0xc7, 0xe4, 0xc3, 0xfc, 0x39, 0xc1, 0x7b, 0x93, 0x6d, 0x21, 0xe1, 0xf5, 0x97, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xb9, 0x27, 0xf3, 0x22, 0xc4, 0x06, 0x00, 0x00, + // 941 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x8e, 0xeb, 0x7d, 0x8e, 0x9c, 0x64, 0x48, 0x53, 0xe3, 0xb4, 0x4e, 0x6a, 0x0e, + 0x58, 0x15, 0xec, 0x36, 0xed, 0xa9, 0x47, 0x9c, 0x48, 0x95, 0x51, 0x24, 0xaa, 0x09, 0xe2, 0xc0, + 0x65, 0x35, 0x3b, 0x3b, 0x75, 0x86, 0xec, 0xee, 0x98, 0x99, 0xb1, 0xd5, 0x7c, 0x01, 0xce, 0x7c, + 0x0c, 0xe0, 0xc4, 0xc7, 0xe8, 0x81, 0x43, 0x8f, 0xc0, 0xa1, 0x54, 0xc9, 0x81, 0xaf, 0x81, 0xe6, + 0x8f, 0xff, 0xa5, 0xa6, 0xe1, 0xc4, 0xc5, 0xde, 0x79, 0xef, 0xf7, 0xfe, 0xcf, 0xef, 0x0d, 0xdc, + 0x97, 0x4c, 0x31, 0x39, 0x61, 0xb1, 0x90, 0x84, 0xe6, 0x2c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, 0xc2, 0x28, 0x76, 0x16, 0xe8, 0x3e, 0x84, 0xa6, 0x0a, 0xa5, 0x49, 0x31, 0xf2, 0xd3, + 0x9e, 0x0b, 0xba, 0x03, 0x68, 0x2e, 0xaf, 0x67, 0x43, 0x95, 0xf9, 0xfe, 0xf7, 0x3c, 0xa2, 0xd3, + 0xad, 0xdf, 0x86, 0xfa, 0x74, 0x7b, 0x5b, 0x5f, 0x9b, 0x78, 0x76, 0xee, 0x0f, 0x5e, 0x5f, 0x75, + 0x82, 0x37, 0x57, 0x9d, 0xe0, 0xdd, 0x55, 0x27, 0xf8, 0xf1, 0xba, 0xb3, 0xf6, 0xe6, 0xba, 0xb3, + 0xf6, 0xfb, 0x75, 0x67, 0xed, 0xdb, 0x78, 0x81, 0x2a, 0xa2, 0x14, 0xc5, 0xa5, 0x7d, 0xa5, 0xa9, + 0xc8, 0xe3, 0xe9, 0x23, 0xff, 0x6a, 0xfa, 0xcc, 0x5b, 0xde, 0xa4, 0x35, 0x0b, 0x78, 0xfa, 0x4f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0xd4, 0x41, 0xd7, 0x5c, 0x08, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -582,13 +689,8 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.BandLatestRequestId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.BandLatestRequestId)) - i-- - dAtA[i] = 0x58 - } { - size, err := m.BandParams.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.BandOracleRequestParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -597,6 +699,11 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x42 + if m.BandLatestRequestId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.BandLatestRequestId)) + i-- + dAtA[i] = 0x38 + } if len(m.CalldataRecords) > 0 { for iNdEx := len(m.CalldataRecords) - 1; iNdEx >= 0; iNdEx-- { { @@ -608,13 +715,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } } if m.BandLatestClientId != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.BandLatestClientId)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if len(m.BandOracleRequests) > 0 { for iNdEx := len(m.BandOracleRequests) - 1; iNdEx >= 0; iNdEx-- { @@ -627,7 +734,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } if len(m.BandPriceStates) > 0 { @@ -641,9 +748,19 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + } + } + { + size, err := m.BandParams.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 { @@ -738,6 +855,68 @@ func (m *BandOracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BandOracleRequestParams) 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 *BandOracleRequestParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BandOracleRequestParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MinSourceCount != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.MinSourceCount)) + i-- + dAtA[i] = 0x30 + } + if m.ExecuteGas != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.ExecuteGas)) + i-- + dAtA[i] = 0x28 + } + if m.PrepareGas != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.PrepareGas)) + i-- + dAtA[i] = 0x20 + } + if len(m.FeeLimit) > 0 { + for iNdEx := len(m.FeeLimit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.MinCount != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.MinCount)) + i-- + dAtA[i] = 0x10 + } + if m.AskCount != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.AskCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *BandParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -759,21 +938,21 @@ func (m *BandParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.LegacyOracleIds) > 0 { - dAtA4 := make([]byte, len(m.LegacyOracleIds)*10) - var j3 int + dAtA5 := make([]byte, len(m.LegacyOracleIds)*10) + var j4 int for _, num1 := range m.LegacyOracleIds { num := uint64(num1) for num >= 1<<7 { - dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j3++ + j4++ } - dAtA4[j3] = uint8(num) - j3++ + dAtA5[j4] = uint8(num) + j4++ } - i -= j3 - copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintGenesis(dAtA, i, uint64(j3)) + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintGenesis(dAtA, i, uint64(j4)) i-- dAtA[i] = 0x32 } @@ -958,6 +1137,8 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + l = m.BandParams.Size() + n += 1 + l + sovGenesis(uint64(l)) if len(m.BandPriceStates) > 0 { for _, e := range m.BandPriceStates { l = e.Size() @@ -979,11 +1160,11 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = m.BandParams.Size() - n += 1 + l + sovGenesis(uint64(l)) if m.BandLatestRequestId != 0 { n += 1 + sovGenesis(uint64(m.BandLatestRequestId)) } + l = m.BandOracleRequestParams.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -1029,6 +1210,36 @@ func (m *BandOracleRequest) Size() (n int) { return n } +func (m *BandOracleRequestParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AskCount != 0 { + n += 1 + sovGenesis(uint64(m.AskCount)) + } + if m.MinCount != 0 { + n += 1 + sovGenesis(uint64(m.MinCount)) + } + if len(m.FeeLimit) > 0 { + for _, e := range m.FeeLimit { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.PrepareGas != 0 { + n += 1 + sovGenesis(uint64(m.PrepareGas)) + } + if m.ExecuteGas != 0 { + n += 1 + sovGenesis(uint64(m.ExecuteGas)) + } + if m.MinSourceCount != 0 { + n += 1 + sovGenesis(uint64(m.MinSourceCount)) + } + return n +} + func (m *BandParams) Size() (n int) { if m == nil { return 0 @@ -1182,6 +1393,39 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BandParams", 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.BandParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BandPriceStates", wireType) } @@ -1215,7 +1459,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BandOracleRequests", wireType) } @@ -1249,7 +1493,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BandLatestClientId", wireType) } @@ -1268,7 +1512,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { break } } - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CalldataRecords", wireType) } @@ -1302,9 +1546,28 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BandLatestRequestId", wireType) + } + m.BandLatestRequestId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BandLatestRequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BandParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BandOracleRequestParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1331,29 +1594,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.BandParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.BandOracleRequestParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BandLatestRequestId", wireType) - } - m.BandLatestRequestId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BandLatestRequestId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -1624,6 +1868,185 @@ func (m *BandOracleRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *BandOracleRequestParams) 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: BandOracleRequestParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BandOracleRequestParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + m.AskCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + m.MinCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeLimit", 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.FeeLimit = append(m.FeeLimit, types.Coin{}) + if err := m.FeeLimit[len(m.FeeLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrepareGas", wireType) + } + m.PrepareGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrepareGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + m.ExecuteGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinSourceCount", wireType) + } + m.MinSourceCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinSourceCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *BandParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go index 2ce7144..8401bfb 100644 --- a/x/oracle/types/keys.go +++ b/x/oracle/types/keys.go @@ -22,13 +22,14 @@ const ( ) var ( - ParamsKey = []byte("p_oracle") - BandParamsKey = []byte{0x01} - BandCallDataRecordKey = []byte{0x02} - LatestClientIDKey = []byte{0x03} - BandOracleRequestIDKey = []byte{0x04} - BandPriceKey = []byte{0x05} - LatestRequestIDKey = []byte{0x06} + ParamsKey = []byte("p_oracle") + BandParamsKey = []byte{0x01} + BandCallDataRecordKey = []byte{0x02} + LatestClientIDKey = []byte{0x03} + BandOracleRequestIDKey = []byte{0x04} + BandPriceKey = []byte{0x05} + LatestRequestIDKey = []byte{0x06} + BandOracleRequestParamsKey = []byte{0x07} ) var ( diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index 743dece..c361c55 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -1,18 +1,29 @@ package types import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) -const ( +var ( // Each value below is the default value for each parameter when generating the default // genesis file. DefaultBandRequestInterval = int64(1) // every 1 block DefaultBandSourceChannel = "channel-0" DefaultBandVersion = "bandchain-1" DefaultBandPortID = "oracle" + + // DefaultBandOracleRequestParams + // TODO: Check these params + DefaultAskCount = uint64(16) + DefaultMinCount = uint64(10) + DefaultFeeLimit = sdk.Coins{sdk.NewCoin("uband", sdkmath.NewInt(100))} + DefaultPrepareGas = uint64(20000) + DefaultExecuteGas = uint64(100000) + DefaultMinSourceCount = uint64(3) ) // ParamKeyTable the param key table for launch module @@ -45,6 +56,18 @@ func DefaultBandParams() BandParams { } } +// DefaultBandOracelRequestParams return the default BandOracelRequestParams +func DefaultBandOracelRequestParams() BandOracleRequestParams { + return BandOracleRequestParams{ + AskCount: DefaultAskCount, + MinCount: DefaultMinCount, + FeeLimit: DefaultFeeLimit, + PrepareGas: DefaultPrepareGas, + ExecuteGas: DefaultExecuteGas, + MinSourceCount: DefaultMinSourceCount, + } +} + // Validate validates the set of params func (p Params) Validate() error { return nil @@ -61,4 +84,4 @@ func DefaultTestBandIbcParams() *BandParams { // band IBC portID IbcPortId: "oracle", } -} \ No newline at end of file +} diff --git a/x/oracle/types/proposal.go b/x/oracle/types/proposal.go index 178b4b7..a78f0cc 100644 --- a/x/oracle/types/proposal.go +++ b/x/oracle/types/proposal.go @@ -10,21 +10,18 @@ import ( // constants const ( ProposalUpdateBandParams string = "ProposalUpdateBandParams" - ProposalAuthorizeBandOracleRequest string = "ProposalTypeAuthorizeBandOracleRequest" ProposalUpdateBandOracleRequest string = "ProposalUpdateBandOracleRequest" ProposalDeleteBandOracleRequest string = "ProposalDeleteBandOracleRequest" ) func init() { govtypes.RegisterProposalType(ProposalUpdateBandParams) - govtypes.RegisterProposalType(ProposalAuthorizeBandOracleRequest) govtypes.RegisterProposalType(ProposalUpdateBandOracleRequest) govtypes.RegisterProposalType(ProposalDeleteBandOracleRequest) } // Implements Proposal Interface var _ govtypes.Content = &UpdateBandParamsProposal{} -var _ govtypes.Content = &AuthorizeBandOracleRequestProposal{} var _ govtypes.Content = &UpdateBandOracleRequestProposal{} var _ govtypes.Content = &DeleteBandOracleRequestProposal{} @@ -63,73 +60,6 @@ func (p *UpdateBandParamsProposal) ValidateBasic() error { return govtypes.ValidateAbstract(p) } -// GetTitle returns the title of this proposal. -func (p *AuthorizeBandOracleRequestProposal) GetTitle() string { - return p.Title -} - -// GetDescription returns the description of this proposal. -func (p *AuthorizeBandOracleRequestProposal) GetDescription() string { - return p.Description -} - -// ProposalRoute returns router key of this proposal. -func (p *AuthorizeBandOracleRequestProposal) ProposalRoute() string { return RouterKey } - -// ProposalType returns proposal type of this proposal. -func (p *AuthorizeBandOracleRequestProposal) ProposalType() string { - return ProposalAuthorizeBandOracleRequest -} - -// ValidateBasic returns ValidateBasic result of this proposal. -func (p *AuthorizeBandOracleRequestProposal) ValidateBasic() error { - if p.Request.OracleScriptId <= 0 { - return errorsmod.Wrapf(ErrInvalidBandRequest, "AuthorizeBandOracleRequestProposal: Oracle script id (%d) must be positive.", p.Request.OracleScriptId) - } - - if len(p.Request.Symbols) == 0 { - return errorsmod.Wrap(ErrBadSymbolsCount, "AuthorizeBandOracleRequestProposal") - } - - callData, err := utils.Encode(SymbolInput{ - Symbols: p.Request.Symbols, - MinimumSourceCount: uint8(p.Request.MinCount), - }) - if err != nil { - return err - } - - if len(callData) > MaxDataSize { - return errorsmod.Wrapf(ErrTooLargeCalldata, "got: %d, maximum: %d", len(callData), MaxDataSize) - } - - if p.Request.MinCount <= 0 { - return errorsmod.Wrapf(ErrInvalidMinCount, "AuthorizeBandOracleRequestProposal: Minimum validator count (%d) must be positive.", p.Request.MinCount) - } - - if p.Request.AskCount <= 0 { - return errorsmod.Wrapf(ErrInvalidAskCount, "AuthorizeBandOracleRequestProposal: Request validator count (%d) must be positive.", p.Request.AskCount) - } - - if p.Request.AskCount < p.Request.MinCount { - return errorsmod.Wrapf(ErrInvalidAskCount, "AuthorizeBandOracleRequestProposal: Request validator count (%d) must not be less than sufficient validator count (%d).", p.Request.AskCount, p.Request.MinCount) - } - - if !p.Request.FeeLimit.IsValid() { - return errorsmod.Wrapf(sdkerrors.ErrInvalidCoins, "AuthorizeBandOracleRequestProposal: Invalid Fee Limit (%s)", p.Request.GetFeeLimit().String()) - } - - if p.Request.PrepareGas <= 0 { - return errorsmod.Wrapf(ErrInvalidOwasmGas, "AuthorizeBandOracleRequestProposal: Invalid Prepare Gas (%d)", p.Request.GetPrepareGas()) - } - - if p.Request.ExecuteGas <= 0 { - return errorsmod.Wrapf(ErrInvalidOwasmGas, "AuthorizeBandOracleRequestProposal: Invalid Execute Gas (%d)", p.Request.ExecuteGas) - } - - return govtypes.ValidateAbstract(p) -} - // GetTitle returns the title of this proposal. func (p *UpdateBandOracleRequestProposal) GetTitle() string { return p.Title diff --git a/x/oracle/types/proposal.pb.go b/x/oracle/types/proposal.pb.go index bea6565..54128fb 100644 --- a/x/oracle/types/proposal.pb.go +++ b/x/oracle/types/proposal.pb.go @@ -64,45 +64,6 @@ func (m *UpdateBandParamsProposal) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateBandParamsProposal proto.InternalMessageInfo -type AuthorizeBandOracleRequestProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Request BandOracleRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request"` -} - -func (m *AuthorizeBandOracleRequestProposal) Reset() { *m = AuthorizeBandOracleRequestProposal{} } -func (m *AuthorizeBandOracleRequestProposal) String() string { return proto.CompactTextString(m) } -func (*AuthorizeBandOracleRequestProposal) ProtoMessage() {} -func (*AuthorizeBandOracleRequestProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_b7efcb1ff26f229a, []int{1} -} -func (m *AuthorizeBandOracleRequestProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthorizeBandOracleRequestProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthorizeBandOracleRequestProposal.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 *AuthorizeBandOracleRequestProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthorizeBandOracleRequestProposal.Merge(m, src) -} -func (m *AuthorizeBandOracleRequestProposal) XXX_Size() int { - return m.Size() -} -func (m *AuthorizeBandOracleRequestProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AuthorizeBandOracleRequestProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthorizeBandOracleRequestProposal proto.InternalMessageInfo - type UpdateBandOracleRequestProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` @@ -113,7 +74,7 @@ func (m *UpdateBandOracleRequestProposal) Reset() { *m = UpdateBandOracl func (m *UpdateBandOracleRequestProposal) String() string { return proto.CompactTextString(m) } func (*UpdateBandOracleRequestProposal) ProtoMessage() {} func (*UpdateBandOracleRequestProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_b7efcb1ff26f229a, []int{2} + return fileDescriptor_b7efcb1ff26f229a, []int{1} } func (m *UpdateBandOracleRequestProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,7 +113,7 @@ func (m *DeleteBandOracleRequestProposal) Reset() { *m = DeleteBandOracl func (m *DeleteBandOracleRequestProposal) String() string { return proto.CompactTextString(m) } func (*DeleteBandOracleRequestProposal) ProtoMessage() {} func (*DeleteBandOracleRequestProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_b7efcb1ff26f229a, []int{3} + return fileDescriptor_b7efcb1ff26f229a, []int{2} } func (m *DeleteBandOracleRequestProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -183,7 +144,6 @@ var xxx_messageInfo_DeleteBandOracleRequestProposal proto.InternalMessageInfo func init() { proto.RegisterType((*UpdateBandParamsProposal)(nil), "reserve.oracle.UpdateBandParamsProposal") - proto.RegisterType((*AuthorizeBandOracleRequestProposal)(nil), "reserve.oracle.AuthorizeBandOracleRequestProposal") proto.RegisterType((*UpdateBandOracleRequestProposal)(nil), "reserve.oracle.UpdateBandOracleRequestProposal") proto.RegisterType((*DeleteBandOracleRequestProposal)(nil), "reserve.oracle.DeleteBandOracleRequestProposal") } @@ -191,36 +151,34 @@ func init() { func init() { proto.RegisterFile("reserve/oracle/proposal.proto", fileDescriptor_b7efcb1ff26f229a) } var fileDescriptor_b7efcb1ff26f229a = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x7d, 0x6d, 0x00, 0x71, 0x91, 0x10, 0x98, 0x22, 0x85, 0x08, 0xec, 0x90, 0x01, 0x05, - 0x04, 0xb6, 0x0a, 0x5b, 0xb6, 0x06, 0x96, 0xb2, 0x50, 0x2c, 0xba, 0xb0, 0x58, 0x67, 0xfb, 0x95, - 0x6b, 0xc9, 0xbe, 0xd7, 0xdc, 0x9d, 0x23, 0xca, 0xca, 0x82, 0x98, 0xf8, 0x08, 0xfd, 0x08, 0x0c, - 0x7c, 0x88, 0x8a, 0xa9, 0x23, 0x62, 0x40, 0x90, 0x0c, 0xf0, 0x05, 0xd8, 0x51, 0xef, 0xce, 0x94, - 0x40, 0x11, 0x19, 0xda, 0xc5, 0xba, 0x7b, 0x9f, 0x7b, 0xff, 0xfc, 0x1e, 0xdb, 0x47, 0xaf, 0x0b, - 0x90, 0x20, 0xa6, 0x10, 0xa2, 0x60, 0x69, 0x09, 0x61, 0x2d, 0xb0, 0x46, 0xc9, 0xca, 0xa0, 0x16, - 0xa8, 0xd0, 0xbd, 0x60, 0xe5, 0xc0, 0xc8, 0xfd, 0x6b, 0x7f, 0x1c, 0xcf, 0x81, 0x83, 0x2c, 0xa4, - 0x39, 0xdd, 0xbf, 0xc4, 0xaa, 0x82, 0x63, 0xa8, 0x9f, 0x36, 0xb4, 0x96, 0x63, 0x8e, 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, 0xd4, 0x3f, 0x32, 0xe5, 0x64, 0xa1, 0xb7, 0xe9, 0x95, 0x46, 0x97, 0x8e, - 0xcd, 0x3c, 0x71, 0x6b, 0x41, 0x67, 0x49, 0x0b, 0xa2, 0xcb, 0x26, 0x7f, 0x21, 0x38, 0x7e, 0xb2, - 0xbc, 0x11, 0x37, 0xff, 0x7a, 0xed, 0xc7, 0xbb, 0xf0, 0x89, 0x50, 0xff, 0x21, 0x94, 0x70, 0x1a, - 0x2e, 0xdc, 0xa1, 0x6e, 0xa6, 0x4b, 0xb7, 0xf8, 0x71, 0x91, 0x1d, 0x7e, 0xef, 0xab, 0xa3, 0x4e, - 0x74, 0xd1, 0x28, 0xb6, 0xd5, 0x66, 0x26, 0x4f, 0x01, 0x6e, 0xb2, 0xb9, 0x3f, 0xf3, 0xc8, 0xc1, - 0xcc, 0x23, 0x5f, 0x66, 0x1e, 0x79, 0x3b, 0xf7, 0x9c, 0x83, 0xb9, 0xe7, 0x7c, 0x9c, 0x7b, 0xce, - 0xb3, 0x30, 0x2f, 0xd4, 0x4e, 0x93, 0x04, 0x29, 0x56, 0x21, 0x72, 0xac, 0x76, 0xf5, 0xff, 0x9e, - 0x62, 0x19, 0xb6, 0x77, 0xca, 0x8b, 0xf6, 0x56, 0x51, 0xbb, 0x35, 0xc8, 0xe4, 0xac, 0x3e, 0x70, - 0xff, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x7b, 0x2b, 0x21, 0xa3, 0x04, 0x00, 0x00, + // 425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xc1, 0xaa, 0xd3, 0x40, + 0x14, 0x86, 0x33, 0xf7, 0x56, 0xc1, 0x29, 0x88, 0xc6, 0x2b, 0xc4, 0xa0, 0x49, 0xed, 0x42, 0x8a, + 0x68, 0xc2, 0xd5, 0xdd, 0xdd, 0x59, 0xdd, 0xd4, 0x8d, 0x35, 0xd0, 0x8d, 0x9b, 0x30, 0x49, 0x0e, + 0x31, 0x90, 0xcc, 0x89, 0x33, 0xd3, 0x62, 0xd7, 0x6e, 0xc4, 0x95, 0x8f, 0xd0, 0x47, 0x70, 0xe1, + 0x43, 0x14, 0x57, 0x5d, 0x8a, 0x0b, 0xd1, 0x76, 0xa1, 0x8f, 0x21, 0x9d, 0x49, 0xad, 0xd5, 0x0a, + 0x82, 0x74, 0x13, 0x66, 0xfe, 0xff, 0xe4, 0xcc, 0xff, 0x4d, 0x72, 0xe8, 0x0d, 0x01, 0x12, 0xc4, + 0x04, 0x42, 0x14, 0x2c, 0x2d, 0x21, 0xac, 0x05, 0xd6, 0x28, 0x59, 0x19, 0xd4, 0x02, 0x15, 0xda, + 0x17, 0x1b, 0x3b, 0x30, 0xb6, 0x7b, 0xfd, 0xb7, 0xf2, 0x1c, 0x38, 0xc8, 0x42, 0x9a, 0x6a, 0xf7, + 0x32, 0xab, 0x0a, 0x8e, 0xa1, 0x7e, 0x36, 0xd2, 0x49, 0x8e, 0x39, 0xea, 0x65, 0xb8, 0x5e, 0x35, + 0xea, 0xb5, 0x14, 0x65, 0x85, 0x32, 0x36, 0x86, 0xd9, 0x18, 0xab, 0xfb, 0x95, 0x50, 0x67, 0x54, + 0x67, 0x4c, 0x41, 0x9f, 0xf1, 0x6c, 0xc8, 0x04, 0xab, 0xe4, 0xb0, 0x09, 0x65, 0x9f, 0xd0, 0x73, + 0xaa, 0x50, 0x25, 0x38, 0xa4, 0x43, 0x7a, 0x17, 0x22, 0xb3, 0xb1, 0x3b, 0xb4, 0x9d, 0x81, 0x4c, + 0x45, 0x51, 0xab, 0x02, 0xb9, 0x73, 0xa4, 0xbd, 0x5f, 0x25, 0xfb, 0x01, 0x6d, 0x27, 0x8c, 0x67, + 0x71, 0xad, 0xdb, 0x39, 0xc7, 0x1d, 0xd2, 0x6b, 0xdf, 0x73, 0x83, 0x5d, 0xb8, 0x60, 0x7b, 0x60, + 0xb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0x06, 0x99, 0x9c, 0xd7, 0x05, 0xf7, 0x7f, 0x04, 0x00, 0x00, 0xff, + 0xff, 0xaa, 0x3e, 0xe9, 0x4e, 0xab, 0x03, 0x00, 0x00, } func (m *UpdateBandParamsProposal) Marshal() (dAtA []byte, err error) { @@ -270,53 +228,6 @@ func (m *UpdateBandParamsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *AuthorizeBandOracleRequestProposal) 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 *AuthorizeBandOracleRequestProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthorizeBandOracleRequestProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *UpdateBandOracleRequestProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -387,20 +298,20 @@ func (m *DeleteBandOracleRequestProposal) MarshalToSizedBuffer(dAtA []byte) (int var l int _ = l if len(m.DeleteRequestIds) > 0 { - dAtA5 := make([]byte, len(m.DeleteRequestIds)*10) - var j4 int + dAtA4 := make([]byte, len(m.DeleteRequestIds)*10) + var j3 int for _, num := range m.DeleteRequestIds { for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j4++ + j3++ } - dAtA5[j4] = uint8(num) - j4++ + dAtA4[j3] = uint8(num) + j3++ } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintProposal(dAtA, i, uint64(j4)) + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintProposal(dAtA, i, uint64(j3)) i-- dAtA[i] = 0x1a } @@ -451,25 +362,6 @@ func (m *UpdateBandParamsProposal) Size() (n int) { return n } -func (m *AuthorizeBandOracleRequestProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = m.Request.Size() - n += 1 + l + sovProposal(uint64(l)) - return n -} - func (m *UpdateBandOracleRequestProposal) Size() (n int) { if m == nil { return 0 @@ -668,153 +560,6 @@ func (m *UpdateBandParamsProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthorizeBandOracleRequestProposal) 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 ErrIntOverflowProposal - } - 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: AuthorizeBandOracleRequestProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthorizeBandOracleRequestProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *UpdateBandOracleRequestProposal) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0