From bd3e45540a9e99cbe8f5f7a09b3c0989c6946426 Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:38:26 +0530 Subject: [PATCH 1/2] chore: adding govulncheck to github actions (#2266) * added govulncheck and move go version from 1.20 to 1.21 on github actions * added git diff on govulncheck action --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/debug.yml | 2 +- .github/workflows/govulncheck.yml | 29 +++++++++++++++++++++++++++ .github/workflows/lint.yml | 2 +- .github/workflows/release-umee.yml | 2 +- .github/workflows/simulations.yml | 10 ++++----- .github/workflows/tests.yml | 8 ++++---- 7 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/govulncheck.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0b7f5e5d0e..d27d67dd97 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 06c35338f6..08c6392a6e 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" cache: true - uses: actions/checkout@v4 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml new file mode 100644 index 0000000000..9b7a20d157 --- /dev/null +++ b/.github/workflows/govulncheck.yml @@ -0,0 +1,29 @@ +name: Tests +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + merge_group: + types: [checks_requested] + +concurrency: + group: ci-${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + govulncheck: + runs-on: ubuntu-latest + name: Run govulncheck + steps: + - uses: actions/checkout@v4 + - uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - uses: golang/govulncheck-action@v1.0.1 + id: govulncheck + if: env.GIT_DIFF + with: + go-version-input: 1.21 + go-package: ./... diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a19b82e241..140faaa93e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - name: golangci-lint main diff --git a/.github/workflows/release-umee.yml b/.github/workflows/release-umee.yml index f9b55119cd..0c9b6da2a5 100644 --- a/.github/workflows/release-umee.yml +++ b/.github/workflows/release-umee.yml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" cache: true - name: Set Env diff --git a/.github/workflows/simulations.yml b/.github/workflows/simulations.yml index 47227a1832..5add21a779 100644 --- a/.github/workflows/simulations.yml +++ b/.github/workflows/simulations.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - name: Install runsim run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0 @@ -39,7 +39,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - name: Test application non-determinism if: env.GIT_DIFF @@ -63,7 +63,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - uses: actions/cache@v3 if: env.GIT_DIFF @@ -92,7 +92,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - uses: actions/cache@v3 if: env.GIT_DIFF @@ -120,7 +120,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - uses: actions/cache@v3 if: env.GIT_DIFF diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 76de25c0bb..939476beaa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - uses: actions/cache@v3 id: cache-go-tparse with: @@ -51,7 +51,7 @@ jobs: if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" cache: true env: GOOS: ${{ matrix.targetos }} @@ -76,7 +76,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - name: Test and Create Coverage Report if: env.GIT_DIFF @@ -107,7 +107,7 @@ jobs: - uses: actions/setup-go@v4 if: env.GIT_DIFF with: - go-version: "1.20" + go-version: "1.21" cache: true - name: Test E2E From 498bd30437024db5366b376a894c37b8a3ad3662 Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:06:57 +0530 Subject: [PATCH 2/2] feat(oracle): add timestamp to exchange rates (#2254) * add timestamp to denom price * address the first review comments * add SetExchangeRateWithTimestamp func * storing rate and timestamp without denom into exg rates * renamed ExchangeRate to DenomExchangeRate on oracle genesis and using ExchangeRate for return types on oracle * address the review comments * add some tests and cli query for getting timestamps of exgrates * add tests to cli and grpc exg rates with timestamp req * fix the tests on oracle * fix the tests --------- Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com> --- app/test_helpers.go | 5 +- proto/umee/oracle/v1/genesis.proto | 23 +- proto/umee/oracle/v1/oracle.proto | 8 +- proto/umee/oracle/v1/query.proto | 28 ++ x/leverage/simulation/operations_test.go | 4 +- x/oracle/abci.go | 1 + x/oracle/abci_test.go | 10 +- x/oracle/client/cli/query.go | 32 ++ x/oracle/client/tests/suite.go | 53 ++ x/oracle/genesis.go | 13 +- x/oracle/genesis_test.go | 20 +- x/oracle/keeper/grpc_query.go | 39 +- x/oracle/keeper/grpc_query_test.go | 32 +- x/oracle/keeper/keeper.go | 33 +- x/oracle/keeper/keeper_test.go | 5 +- x/oracle/keeper/msg_server_test.go | 7 +- x/oracle/types/asset.go | 22 +- x/oracle/types/exchange_rates.go | 56 +++ x/oracle/types/exchange_rates_test.go | 37 ++ x/oracle/types/genesis.go | 4 +- x/oracle/types/genesis.pb.go | 89 ++-- x/oracle/types/genesis_test.go | 2 +- x/oracle/types/oracle.pb.go | 230 +++++---- x/oracle/types/query.pb.go | 598 +++++++++++++++++++---- x/oracle/types/query.pb.gw.go | 83 ++++ x/oracle/types/vote.go | 5 - x/oracle/types/vote_test.go | 6 + 27 files changed, 1118 insertions(+), 327 deletions(-) create mode 100644 x/oracle/types/exchange_rates.go create mode 100644 x/oracle/types/exchange_rates_test.go diff --git a/app/test_helpers.go b/app/test_helpers.go index 3676eafaab..7c54acdb9f 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -266,9 +266,8 @@ func IntegrationTestNetworkConfig() network.Config { // execute ballot voting and thus clear out previous exchange rates, since we // are not running a price-feeder. oracleGenState.Params.VotePeriod = 1000 - oracleGenState.ExchangeRates = append(oracleGenState.ExchangeRates, oracletypes.NewExchangeRateTuple( - params.DisplayDenom, sdk.MustNewDecFromStr("34.21"), - )) + oracleGenState.ExchangeRates = append(oracleGenState.ExchangeRates, oracletypes.NewDenomExchangeRate( + params.DisplayDenom, sdk.MustNewDecFromStr("34.21"), time.Now())) // Set mock historic medians to satisfy leverage module's 24 median requirement for i := 1; i <= 24; i++ { median := oracletypes.Price{ diff --git a/proto/umee/oracle/v1/genesis.proto b/proto/umee/oracle/v1/genesis.proto index 57e1c76f55..a58861b4b3 100644 --- a/proto/umee/oracle/v1/genesis.proto +++ b/proto/umee/oracle/v1/genesis.proto @@ -10,22 +10,15 @@ option (gogoproto.goproto_getters_all) = false; // GenesisState defines the oracle module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated FeederDelegation feeder_delegations = 2 - [(gogoproto.nullable) = false]; - // TODO: need to update this to save data with timestamp - repeated ExchangeRateTuple exchange_rates = 3 [ - (gogoproto.castrepeated) = "ExchangeRateTuples", - (gogoproto.nullable) = false - ]; + Params params = 1 [(gogoproto.nullable) = false]; + repeated FeederDelegation feeder_delegations = 2 [(gogoproto.nullable) = false]; + repeated DenomExchangeRate exchange_rates = 3 [(gogoproto.nullable) = false]; repeated MissCounter miss_counters = 4 [(gogoproto.nullable) = false]; - repeated AggregateExchangeRatePrevote aggregate_exchange_rate_prevotes = 5 - [(gogoproto.nullable) = false]; - repeated AggregateExchangeRateVote aggregate_exchange_rate_votes = 6 - [(gogoproto.nullable) = false]; - repeated Price medians = 7 [(gogoproto.nullable) = false]; - repeated Price historic_prices = 8 [(gogoproto.nullable) = false]; - repeated Price medianDeviations = 9 [(gogoproto.nullable) = false]; + repeated AggregateExchangeRatePrevote aggregate_exchange_rate_prevotes = 5 [(gogoproto.nullable) = false]; + repeated AggregateExchangeRateVote aggregate_exchange_rate_votes = 6 [(gogoproto.nullable) = false]; + repeated Price medians = 7 [(gogoproto.nullable) = false]; + repeated Price historic_prices = 8 [(gogoproto.nullable) = false]; + repeated Price medianDeviations = 9 [(gogoproto.nullable) = false]; // Historic Avg Counter params AvgCounterParams avg_counter_params = 10 [ (gogoproto.moretags) = "yaml:\"avg_counter_params\"", diff --git a/proto/umee/oracle/v1/oracle.proto b/proto/umee/oracle/v1/oracle.proto index 8cecd4a33b..565fa3cd98 100644 --- a/proto/umee/oracle/v1/oracle.proto +++ b/proto/umee/oracle/v1/oracle.proto @@ -145,12 +145,12 @@ message AvgCounter { google.protobuf.Timestamp start = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } -// ExchangeRate stores exchange rate with timestamp -message ExchangeRate { +// DenomExchangeRate stores exchange rate with timestamp +message DenomExchangeRate { option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; - - string rate = 1 [ + string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; + string rate = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; diff --git a/proto/umee/oracle/v1/query.proto b/proto/umee/oracle/v1/query.proto index 3f6038242f..71fb405ab1 100644 --- a/proto/umee/oracle/v1/query.proto +++ b/proto/umee/oracle/v1/query.proto @@ -101,6 +101,34 @@ service Query { option (google.api.http).get = "/umee/historacle/v1/avg_price/{denom}"; } + + // ExgRatesWithTimestamp returns exchange rates of all denoms with timestamp, + // or, if specified, returns a single denom + rpc ExgRatesWithTimestamp(QueryExgRatesWithTimestamp) + returns (QueryExgRatesWithTimestampResponse) { + option (google.api.http).get = + "/umee/oracle/v1/denoms/exg_rates_timestamp"; + } +} + +// QueryExgRatesWithTimestamp is the request type for the Query/ExchangeRatesWithTimestamp RPC +// method. +message QueryExgRatesWithTimestamp { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // denom defines the denomination to query for. + string denom = 1; +} + +// QueryExgRatesWithTimestampResponse is response type for the +// Query/ExchangeRatesWithTimestamp RPC method. +message QueryExgRatesWithTimestampResponse { + // exchange_rates defines a list of the exchange rate for all whitelisted + // denoms with timestamp + repeated DenomExchangeRate exg_rates = 1 [ + (gogoproto.nullable) = false + ]; } // QueryExchangeRates is the request type for the Query/ExchangeRate RPC diff --git a/x/leverage/simulation/operations_test.go b/x/leverage/simulation/operations_test.go index 51990e4931..dd7d631f92 100644 --- a/x/leverage/simulation/operations_test.go +++ b/x/leverage/simulation/operations_test.go @@ -3,6 +3,7 @@ package simulation_test import ( "math/rand" "testing" + "time" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -32,8 +33,7 @@ type SimTestSuite struct { func (s *SimTestSuite) SetupTest() { checkTx := false app := umeeapp.Setup(s.T()) - ctx := app.NewContext(checkTx, tmproto.Header{}) - + ctx := app.NewContext(checkTx, tmproto.Header{Time: time.Now()}) leverage.InitGenesis(ctx, app.LeverageKeeper, *types.DefaultGenesis()) // Use default umee token for sim tests diff --git a/x/oracle/abci.go b/x/oracle/abci.go index 28f9d73461..c59004bca1 100644 --- a/x/oracle/abci.go +++ b/x/oracle/abci.go @@ -77,6 +77,7 @@ func CalcPrices(ctx sdk.Context, params types.Params, k keeper.Keeper) error { if err != nil { return err } + // save the exchange rate to store with denom and timestamp k.SetExchangeRateWithEvent(ctx, denom, exchangeRate) if k.IsPeriodLastBlock(ctx, params.HistoricStampPeriod) { diff --git a/x/oracle/abci_test.go b/x/oracle/abci_test.go index 6b57cb318c..ca9e98dbfe 100644 --- a/x/oracle/abci_test.go +++ b/x/oracle/abci_test.go @@ -3,6 +3,7 @@ package oracle_test import ( "fmt" "testing" + "time" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -43,6 +44,7 @@ func (s *IntegrationTestSuite) SetupTest() { app := umeeapp.Setup(s.T()) ctx := app.NewContext(isCheckTx, tmproto.Header{ ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)), + Time: time.Now(), }) oracle.InitGenesis(ctx, app.OracleKeeper, *types.DefaultGenesisState()) @@ -156,7 +158,9 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { for _, denom := range app.OracleKeeper.AcceptList(ctx) { rate, err := app.OracleKeeper.GetExchangeRate(ctx, denom.SymbolDenom) s.Require().NoError(err) - s.Require().Equal(types.ExchangeRate{Rate: sdk.OneDec(), Timestamp: ctx.BlockTime()}, + s.Require().Equal(types.ExchangeRate{ + Rate: sdk.OneDec(), + Timestamp: ctx.BlockTime()}, rate) } @@ -237,8 +241,8 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { rate, err := app.OracleKeeper.GetExchangeRate(ctx, "umee") s.Require().NoError(err) s.Require().Equal(types.ExchangeRate{Rate: sdk.OneDec(), Timestamp: ctx.BlockTime()}, rate) - rate, err = app.OracleKeeper.GetExchangeRate(ctx, "atom") - s.Require().ErrorIs(err, types.ErrUnknownDenom.Wrap("atom")) + rate, err = app.OracleKeeper.GetExchangeRate(ctx, "ATOM") + s.Require().ErrorIs(err, types.ErrUnknownDenom.Wrap("ATOM")) s.Require().Equal(types.ExchangeRate{}, rate) } diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index fd10b14bd5..1e07b7f5ef 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -33,6 +33,7 @@ func GetQueryCmd() *cobra.Command { QueryMissCounter(), QuerySlashWindow(), QueryHistoricAvgPrice(), + QueryExchangeRatesWithTimestamp(), ) return cmd @@ -300,3 +301,34 @@ func QueryHistoricAvgPrice() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +// QueryExchangeRatesWithTimestamp implements the query rate command. +func QueryExchangeRatesWithTimestamp() *cobra.Command { + cmd := &cobra.Command{ + Use: "exg-rates-timestamp [denom]", + Args: cobra.MaximumNArgs(1), + Short: "Query the exchange rates with timestamp", + Long: strings.TrimSpace(` +Query the current exchange rates of assets based on USD with timestamp. +You can find the current list of active denoms by running + +$ umeed query oracle exg-rates-timestamp +`), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + query := &types.QueryExgRatesWithTimestamp{} + if len(args) > 0 { + query.Denom = args[0] + } + res, err := queryClient.ExgRatesWithTimestamp(cmd.Context(), query) + return cli.PrintOrErr(res, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/oracle/client/tests/suite.go b/x/oracle/client/tests/suite.go index 1dd8b223ba..b3b66834ab 100644 --- a/x/oracle/client/tests/suite.go +++ b/x/oracle/client/tests/suite.go @@ -231,3 +231,56 @@ func (s *IntegrationTestSuite) TestQueryExchangeRate() { }) } } + +func (s *IntegrationTestSuite) TestQueryExchangeRateWithTimestamp() { + val := s.network.Validators[0] + clientCtx := val.ClientCtx + + testCases := []struct { + name string + args []string + expectErr bool + respType proto.Message + }{ + { + name: "valid", + args: []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + expectErr: false, + respType: &types.QueryExgRatesWithTimestampResponse{}, + }, + { + name: "valid denom", + args: []string{ + "UMEE", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + expectErr: false, + respType: &types.QueryExgRatesWithTimestampResponse{}, + }, + { + name: "invalid denom", + args: []string{ + "ABCD", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + expectErr: true, + respType: &types.QueryExgRatesWithTimestampResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + out, err := clitestutil.ExecTestCLICmd(clientCtx, cli.QueryExchangeRatesWithTimestamp(), tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + } + }) + } +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index f979ea2238..f6a69c4008 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -2,6 +2,7 @@ package oracle import ( "fmt" + "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,7 +24,7 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, genState types.GenesisSt } for _, ex := range genState.ExchangeRates { - keeper.SetExchangeRate(ctx, ex.Denom, ex.ExchangeRate) + keeper.SetExchangeRateWithTimestamp(ctx, ex.Denom, ex.Rate, ex.Timestamp) } for _, mc := range genState.MissCounters { @@ -91,13 +92,9 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { return false }) - exchangeRates := []types.ExchangeRateTuple{} - keeper.IterateExchangeRates(ctx, func(denom string, rate sdk.Dec) (stop bool) { - exchangeRates = append(exchangeRates, types.ExchangeRateTuple{ - Denom: denom, - ExchangeRate: rate, - }) - + exchangeRates := []types.DenomExchangeRate{} + keeper.IterateExchangeRates(ctx, func(denom string, er sdk.Dec, t time.Time) (stop bool) { + exchangeRates = append(exchangeRates, types.NewDenomExchangeRate(denom, er, t)) return false }) diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 5ba2e03352..dda18754c5 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -1,6 +1,8 @@ package oracle_test import ( + "time" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/umee-network/umee/v6/x/oracle" "github.com/umee-network/umee/v6/x/oracle/types" @@ -54,10 +56,11 @@ func (s *IntegrationTestSuite) TestGenesis_InitGenesis() { "valid", types.GenesisState{ Params: types.DefaultParams(), - ExchangeRates: types.ExchangeRateTuples{ - types.ExchangeRateTuple{ - Denom: denom, - ExchangeRate: exchangeRate, + ExchangeRates: []types.DenomExchangeRate{ + { + Denom: denom, + Rate: exchangeRate, + Timestamp: time.Now(), }, }, HistoricPrices: types.Prices{ @@ -152,10 +155,11 @@ func (s *IntegrationTestSuite) TestGenesis_ExportGenesis() { ValidatorAddress: umeevaloperAddr, }, } - exchangeRateTuples := types.ExchangeRateTuples{ - types.ExchangeRateTuple{ - Denom: upperDenom, - ExchangeRate: exchangeRate, + exchangeRateTuples := []types.DenomExchangeRate{ + { + Denom: upperDenom, + Rate: exchangeRate, + Timestamp: ctx.BlockTime(), }, } missCounters := []types.MissCounter{ diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 7d297ae7c7..4556e17689 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "strings" + "time" sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" @@ -64,8 +65,8 @@ func (q querier) ExchangeRates( exchangeRates = exchangeRates.Add(sdk.NewDecCoinFromDec(req.Denom, exchangeRate.Rate)) } else { - q.IterateExchangeRates(ctx, func(denom string, rate sdk.Dec) (stop bool) { - exchangeRates = exchangeRates.Add(sdk.NewDecCoinFromDec(denom, rate)) + q.IterateExchangeRates(ctx, func(denom string, exgRate sdk.Dec, _ time.Time) (stop bool) { + exchangeRates = exchangeRates.Add(sdk.NewDecCoinFromDec(denom, exgRate)) return false }) } @@ -85,7 +86,7 @@ func (q querier) ActiveExchangeRates( ctx := sdk.UnwrapSDKContext(goCtx) denoms := []string{} - q.IterateExchangeRates(ctx, func(denom string, _ sdk.Dec) (stop bool) { + q.IterateExchangeRates(ctx, func(denom string, _ sdk.Dec, _ time.Time) (stop bool) { denoms = append(denoms, denom) return false }) @@ -329,3 +330,35 @@ func (q querier) AvgPrice( } return &types.QueryAvgPriceResponse{Price: p}, nil } + +// ExgRatesWithTimestamp queries exchange rates of all denoms with timestamp, or, if specified, returns +// a single denom. +func (q querier) ExgRatesWithTimestamp( + goCtx context.Context, + req *types.QueryExgRatesWithTimestamp, +) (*types.QueryExgRatesWithTimestampResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: need to decide if we want to return DecCoins here or list of ExchangeRates with denoms (we + // need the latter for genesis anyway) + var exgRates []types.DenomExchangeRate + + if len(req.Denom) > 0 { + exchangeRate, err := q.GetExchangeRate(ctx, req.Denom) + if err != nil { + return nil, err + } + exgRates = append(exgRates, types.NewDenomExchangeRate(req.Denom, exchangeRate.Rate, exchangeRate.Timestamp)) + } else { + q.IterateExchangeRates(ctx, func(denom string, exgRate sdk.Dec, t time.Time) (stop bool) { + exgRates = append(exgRates, types.NewDenomExchangeRate(denom, exgRate, t)) + return false + }) + } + + return &types.QueryExgRatesWithTimestampResponse{ExgRates: exgRates}, nil +} diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 9f6bc75bd5..db4714e8f2 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "math/rand" + "time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/crypto/secp256k1" @@ -193,8 +194,13 @@ func (s *IntegrationTestSuite) TestQuerier_AggregatePrevotesAppendVotes() { } func (s *IntegrationTestSuite) TestQuerier_AggregateVotesAppendVotes() { + exgRateTuples := types.ExchangeRateTuples{} + + for _, er := range types.DefaultGenesisState().ExchangeRates { + exgRateTuples = append(exgRateTuples, types.ExchangeRateTuple{Denom: er.Denom, ExchangeRate: er.Rate}) + } s.app.OracleKeeper.SetAggregateExchangeRateVote(s.ctx, valAddr, types.NewAggregateExchangeRateVote( - types.DefaultGenesisState().ExchangeRates, + exgRateTuples, valAddr, )) @@ -368,3 +374,27 @@ func (s *IntegrationTestSuite) TestQuerier_AvgPrice() { _, err = s.queryClient.AvgPrice(ctx.Context(), &types.QueryAvgPrice{Denom: "12"}) s.Require().ErrorContains(err, "malformed denom") } + +func (s *IntegrationTestSuite) TestQuerier_ExchangeRatesWithTimestamp() { + s.ctx = s.ctx.WithBlockTime(time.Now()) + s.app.OracleKeeper.SetExchangeRate(s.ctx, displayDenom, sdk.OneDec()) + res, err := s.queryClient.ExgRatesWithTimestamp(s.ctx.Context(), &types.QueryExgRatesWithTimestamp{}) + s.Require().NoError(err) + s.Require().Equal([]types.DenomExchangeRate{ + { + Denom: displayDenom, + Rate: sdk.OneDec(), + Timestamp: s.ctx.BlockTime(), + }, + }, res.ExgRates) + + res, err = s.queryClient.ExgRatesWithTimestamp(s.ctx.Context(), &types.QueryExgRatesWithTimestamp{ + Denom: displayDenom, + }) + s.Require().NoError(err) + s.Require().Equal(types.DenomExchangeRate{ + Denom: displayDenom, + Rate: sdk.OneDec(), + Timestamp: s.ctx.BlockTime(), + }, res.ExgRates[0]) +} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 35ccd7e1eb..6327af58ca 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "time" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -110,39 +111,45 @@ func (k Keeper) GetExchangeRateBase(ctx sdk.Context, denom string) (sdk.Dec, err return exchangeRate.Rate.Quo(powerReduction), nil } -// SetExchangeRate sets the consensus exchange rate of USD denominated in the -// denom asset to the store. -func (k Keeper) SetExchangeRate(ctx sdk.Context, denom string, rate sdk.Dec) { +// SetExchangeRateWithTimestamp sets the consensus exchange rate of USD denominated in the +// denom asset to the store with a timestamp specified instead of using ctx +func (k Keeper) SetExchangeRateWithTimestamp(ctx sdk.Context, denom string, rate sdk.Dec, t time.Time) { key := types.KeyExchangeRate(denom) - val := types.ExchangeRate{Rate: rate, Timestamp: ctx.BlockTime()} - err := store.SetValue(ctx.KVStore(k.storeKey), key, &val, "exchange_rate") + val := types.ExchangeRate{Rate: rate, Timestamp: t} + err := store.SetValue[*types.ExchangeRate](ctx.KVStore(k.storeKey), key, &val, "exchange_rate") util.Panic(err) } +// SetExchangeRate sets the consensus exchange rate of USD denominated in the +// denom asset to the store using timestamp from ctx +func (k Keeper) SetExchangeRate(ctx sdk.Context, denom string, rate sdk.Dec) { + k.SetExchangeRateWithTimestamp(ctx, denom, rate, ctx.BlockTime()) +} + // SetExchangeRateWithEvent sets an consensus // exchange rate to the store with ABCI event -func (k Keeper) SetExchangeRateWithEvent(ctx sdk.Context, denom string, exchangeRate sdk.Dec) { - k.SetExchangeRate(ctx, denom, exchangeRate) +func (k Keeper) SetExchangeRateWithEvent(ctx sdk.Context, denom string, rate sdk.Dec) { + k.SetExchangeRateWithTimestamp(ctx, denom, rate, ctx.BlockTime()) sdkutil.Emit(&ctx, &types.EventSetFxRate{ - Denom: denom, Rate: exchangeRate, + Denom: denom, Rate: rate, }) } // IterateExchangeRates iterates over all USD rates in the store. // TODO: handler should use ExchangeRate type rather than Dec -func (k Keeper) IterateExchangeRates(ctx sdk.Context, handler func(string, sdk.Dec) bool) { +func (k Keeper) IterateExchangeRates(ctx sdk.Context, handler func(string, sdk.Dec, time.Time) bool) { store := ctx.KVStore(k.storeKey) iter := sdk.KVStorePrefixIterator(store, types.KeyPrefixExchangeRate) defer iter.Close() prefixLen := len(types.KeyPrefixExchangeRate) - for ; iter.Valid(); iter.Next() { key := iter.Key() denom := string(key[prefixLen : len(key)-1]) // -1 to remove the null suffix - var er types.ExchangeRate - k.cdc.MustUnmarshal(iter.Value(), &er) + var exgRate types.ExchangeRate + err := exgRate.Unmarshal(iter.Value()) + util.Panic(err) - if handler(denom, er.Rate) { + if handler(denom, exgRate.Rate, exgRate.Timestamp) { break } } diff --git a/x/oracle/keeper/keeper_test.go b/x/oracle/keeper/keeper_test.go index 2d2d8d56d9..b764d7acdc 100644 --- a/x/oracle/keeper/keeper_test.go +++ b/x/oracle/keeper/keeper_test.go @@ -5,6 +5,7 @@ import ( "math/rand" "strings" "testing" + "time" "github.com/cosmos/cosmos-sdk/baseapp" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -86,7 +87,7 @@ func (s *IntegrationTestSuite) SetupTest() { staking.EndBlocker(ctx, *app.StakingKeeper) s.app = app - s.ctx = ctx + s.ctx = ctx.WithBlockTime(time.Now()) s.queryClient = types.NewQueryClient(queryHelper) s.msgServer = keeper.NewMsgServerImpl(app.OracleKeeper) } @@ -234,7 +235,7 @@ func (s *IntegrationTestSuite) TestGetExchangeRate_Valid() { s.Require().NoError(err) s.Require().Equal(rate, expected) - s.app.OracleKeeper.SetExchangeRate(s.ctx, strings.ToLower(displayDenom), sdk.OneDec()) + s.app.OracleKeeper.SetExchangeRate(s.ctx, displayDenom, sdk.OneDec()) rate, err = s.app.OracleKeeper.GetExchangeRate(s.ctx, displayDenom) s.Require().NoError(err) s.Require().Equal(rate, expected) diff --git a/x/oracle/keeper/msg_server_test.go b/x/oracle/keeper/msg_server_test.go index e0fbec1f80..636c9d6b2e 100644 --- a/x/oracle/keeper/msg_server_test.go +++ b/x/oracle/keeper/msg_server_test.go @@ -98,7 +98,7 @@ func (s *IntegrationTestSuite) TestMsgServer_AggregateExchangeRateVote() { acceptList := s.app.OracleKeeper.GetParams(ctx).AcceptList var acceptListFlat []string for _, v := range acceptList { - acceptListFlat = append(acceptListFlat, v.SymbolDenom) + acceptListFlat = append(acceptListFlat, strings.ToUpper(v.SymbolDenom)) } // No existing prevote @@ -122,7 +122,7 @@ func (s *IntegrationTestSuite) TestMsgServer_AggregateExchangeRateVote() { vote, err := s.app.OracleKeeper.GetAggregateExchangeRateVote(ctx, valAddr) s.Require().Nil(err) for _, v := range vote.ExchangeRateTuples { - s.Require().Contains(acceptListFlat, strings.ToLower(v.Denom)) + s.Require().Contains(acceptListFlat, v.Denom) } // Valid, but with an exchange rate which isn't in AcceptList @@ -132,12 +132,13 @@ func (s *IntegrationTestSuite) TestMsgServer_AggregateExchangeRateVote() { types.NewAggregateExchangeRatePrevote( hashInvalidRate, valAddr, 1, )) + _, err = s.msgServer.AggregateExchangeRateVote(sdk.WrapSDKContext(ctx), voteMsgInvalidRate) s.Require().NoError(err) vote, err = s.app.OracleKeeper.GetAggregateExchangeRateVote(ctx, valAddr) s.Require().NoError(err) for _, v := range vote.ExchangeRateTuples { - s.Require().Contains(acceptListFlat, strings.ToLower(v.Denom)) + s.Require().Contains(acceptListFlat, v.Denom) } } diff --git a/x/oracle/types/asset.go b/x/oracle/types/asset.go index 7ef07be2aa..526e143bf2 100644 --- a/x/oracle/types/asset.go +++ b/x/oracle/types/asset.go @@ -7,17 +7,17 @@ import ( ) const ( - UmeeDenom string = appparams.BondDenom - UmeeSymbol string = "umee" - UmeeExponent = uint32(6) - USDDenom string = "USD" - BlocksPerMinute = uint64(10) - BlocksPerHour = BlocksPerMinute * 60 - BlocksPerDay = BlocksPerHour * 24 - BlocksPerWeek = BlocksPerDay * 7 - BlocksPerMonth = BlocksPerDay * 30 - BlocksPerYear = BlocksPerDay * 365 - MicroUnit = int64(1e6) + UmeeDenom = appparams.BondDenom + UmeeSymbol = "umee" + UmeeExponent = uint32(6) + USDDenom = "USD" + BlocksPerMinute = uint64(10) + BlocksPerHour = BlocksPerMinute * 60 + BlocksPerDay = BlocksPerHour * 24 + BlocksPerWeek = BlocksPerDay * 7 + BlocksPerMonth = BlocksPerDay * 30 + BlocksPerYear = BlocksPerDay * 365 + MicroUnit = int64(1e6) ) type ( diff --git a/x/oracle/types/exchange_rates.go b/x/oracle/types/exchange_rates.go new file mode 100644 index 0000000000..cad93742cd --- /dev/null +++ b/x/oracle/types/exchange_rates.go @@ -0,0 +1,56 @@ +package types + +import ( + "encoding/json" + "fmt" + time "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewDenomExchangeRate creates a DenomExchangeRate instance +func NewDenomExchangeRate(denom string, exchangeRate sdk.Dec, t time.Time) DenomExchangeRate { + return DenomExchangeRate{ + Denom: denom, + Rate: exchangeRate, + Timestamp: t, + } +} + +func (v DenomExchangeRate) String() string { + bz, _ := json.Marshal(v) + return string(bz) +} + +// ExchangeRate is type for storing rate and timestamp of denom into store without denom. +type ExchangeRate struct { + Rate sdk.Dec `json:"rate"` + Timestamp time.Time `json:"timestamp"` +} + +// Marshal implements store.Marshalable. +func (d *ExchangeRate) Marshal() ([]byte, error) { + if d.Rate.IsNil() { + return nil, fmt.Errorf("rate should not be nil") + } + if d.Timestamp.IsZero() { + return nil, fmt.Errorf("timestamp in exchange_rate should not be nil") + } + return json.Marshal(d) +} + +func (d *ExchangeRate) String() string { + out, _ := json.Marshal(d) + return string(out) +} + +// MarshalTo implements store.Marshalable. +func (ExchangeRate) MarshalTo(_ []byte) (int, error) { + panic("unimplemented") +} + +// Unmarshal implements store.Marshalable. +func (d *ExchangeRate) Unmarshal(data []byte) error { + err := json.Unmarshal(data, d) + return err +} diff --git a/x/oracle/types/exchange_rates_test.go b/x/oracle/types/exchange_rates_test.go new file mode 100644 index 0000000000..31a2ca920f --- /dev/null +++ b/x/oracle/types/exchange_rates_test.go @@ -0,0 +1,37 @@ +package types + +import ( + "testing" + time "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "gotest.tools/v3/assert" +) + +func TestExchangeRateMarshalAndUnmarshal(t *testing.T) { + der := ExchangeRate{Rate: sdk.NewDec(1), Timestamp: time.Now()} + + // Marshal the exchange rate + md, err := der.Marshal() + assert.NilError(t, err) + + // Unmarshal the exchange rate + var newExgRate ExchangeRate + err = newExgRate.Unmarshal(md) + assert.NilError(t, err) + assert.DeepEqual(t, der, newExgRate) + + // error expected + der = ExchangeRate{Timestamp: time.Now()} + + // Marshal the exchange rate + _, err = der.Marshal() + assert.ErrorContains(t, err, "rate should not be nil") + + // error expected + der = ExchangeRate{Rate: sdk.NewDec(1)} + + // Marshal the exchange rate + _, err = der.Marshal() + assert.ErrorContains(t, err, "timestamp in exchange_rate should not be nil") +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 946a0fb220..51c24d304e 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -10,7 +10,7 @@ import ( // NewGenesisState creates a new GenesisState object func NewGenesisState( params Params, - rates []ExchangeRateTuple, + rates []DenomExchangeRate, feederDelegations []FeederDelegation, missCounters []MissCounter, aggregateExchangeRatePrevotes []AggregateExchangeRatePrevote, @@ -39,7 +39,7 @@ func NewGenesisState( func DefaultGenesisState() *GenesisState { return &GenesisState{ Params: DefaultParams(), - ExchangeRates: []ExchangeRateTuple{}, + ExchangeRates: []DenomExchangeRate{}, FeederDelegations: []FeederDelegation{}, MissCounters: []MissCounter{}, AggregateExchangeRatePrevotes: []AggregateExchangeRatePrevote{}, diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index b4862a32bf..4072305747 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -25,10 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the oracle module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - FeederDelegations []FeederDelegation `protobuf:"bytes,2,rep,name=feeder_delegations,json=feederDelegations,proto3" json:"feeder_delegations"` - // TODO: need to update this to save data with timestamp - ExchangeRates ExchangeRateTuples `protobuf:"bytes,3,rep,name=exchange_rates,json=exchangeRates,proto3,castrepeated=ExchangeRateTuples" json:"exchange_rates"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + FeederDelegations []FeederDelegation `protobuf:"bytes,2,rep,name=feeder_delegations,json=feederDelegations,proto3" json:"feeder_delegations"` + ExchangeRates []DenomExchangeRate `protobuf:"bytes,3,rep,name=exchange_rates,json=exchangeRates,proto3" json:"exchange_rates"` MissCounters []MissCounter `protobuf:"bytes,4,rep,name=miss_counters,json=missCounters,proto3" json:"miss_counters"` AggregateExchangeRatePrevotes []AggregateExchangeRatePrevote `protobuf:"bytes,5,rep,name=aggregate_exchange_rate_prevotes,json=aggregateExchangeRatePrevotes,proto3" json:"aggregate_exchange_rate_prevotes"` AggregateExchangeRateVotes []AggregateExchangeRateVote `protobuf:"bytes,6,rep,name=aggregate_exchange_rate_votes,json=aggregateExchangeRateVotes,proto3" json:"aggregate_exchange_rate_votes"` @@ -202,46 +201,46 @@ func init() { func init() { proto.RegisterFile("umee/oracle/v1/genesis.proto", fileDescriptor_c99b4af40468acc1) } var fileDescriptor_c99b4af40468acc1 = []byte{ - // 620 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdd, 0x4e, 0xd4, 0x4e, - 0x14, 0xdf, 0xf2, 0xb1, 0xc0, 0x2c, 0xec, 0x7f, 0x99, 0xbf, 0x9a, 0xba, 0x48, 0x59, 0x9a, 0x98, - 0x60, 0xd4, 0x36, 0xe0, 0xc7, 0x85, 0x77, 0x20, 0xc2, 0x8d, 0x1a, 0x52, 0xbf, 0x12, 0x13, 0xd3, - 0x0c, 0xed, 0xa1, 0x34, 0xb4, 0x9d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x14, 0xf8, 0x66, 0x53, 0x1e, 0xc4, 0x07, 0x7f, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x72, 0xa7, 0x58, 0xb8, 0x73, 0x05, 0x00, 0x00, + // 615 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x5d, 0x4f, 0xd4, 0x4e, + 0x14, 0xc6, 0xb7, 0xbc, 0x2c, 0x30, 0x0b, 0xfb, 0x5f, 0xe6, 0xaf, 0xa6, 0x82, 0x94, 0xa5, 0x89, + 0x09, 0x46, 0x6d, 0x03, 0xbe, 0x5c, 0x78, 0x07, 0xae, 0x70, 0xa3, 0x84, 0xac, 0x6f, 0x89, 0x89, + 0x69, 0x86, 0xf6, 0x50, 0x1a, 0xda, 0x4e, 0x9d, 0x99, 0x56, 0x88, 0xf1, 0x3b, 0xf8, 0xb1, 0xb8, + 0xe4, 0xd2, 0x1b, 0x89, 0xc2, 0x37, 0xf0, 0x13, 0x98, 0x4e, 0xa7, 0xd0, 0xed, 0x82, 0x78, 0x07, + 0xe7, 0x3c, 0xe7, 0xf7, 0x9c, 0x6c, 0x9f, 0x33, 0xe8, 0x4e, 0x1a, 0x01, 0xd8, 0x94, 0x11, 0x37, + 0x04, 0x3b, 0x5b, 0xb1, 0x7d, 0x88, 0x81, 0x07, 0xdc, 0x4a, 0x18, 0x15, 0x14, 0xb7, 0xf3, 0xae, + 0x55, 0x74, 0xad, 0x6c, 0x65, 0xee, 0x86, 0x4f, 0x7d, 0x2a, 0x5b, 0x76, 0xfe, 0x57, 0xa1, 0x9a, + 0x9b, 0xaf, 0x31, 0x94, 0x5e, 0x36, 0xcd, 0x1f, 0x4d, 0x34, 0xbd, 0x59, 0x40, 0x5f, 0x0b, 0x22, + 0x00, 0x3f, 0x46, 0xcd, 0x84, 0x30, 0x12, 0x71, 0x5d, 0xeb, 0x6a, 0xcb, 0xad, 0xd5, 0x5b, 0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3b, 0x21, 0x75, 0xf7, 0x9d, + 0x38, 0x8d, 0xd4, 0x06, 0x93, 0xb2, 0xb0, 0x95, 0x46, 0xeb, 0x2f, 0x8f, 0x7e, 0x19, 0x8d, 0xa3, + 0x53, 0x43, 0x3b, 0x3e, 0x35, 0xb4, 0x9f, 0xa7, 0x86, 0xf6, 0xed, 0xcc, 0x68, 0x1c, 0x9f, 0x19, + 0x8d, 0xef, 0x67, 0x46, 0xe3, 0x83, 0xe5, 0x07, 0x62, 0x2f, 0xdd, 0xb1, 0x5c, 0x1a, 0xd9, 0xf9, + 0x02, 0x0f, 0x63, 0x10, 0x9f, 0x29, 0xdb, 0x97, 0xff, 0xd8, 0xd9, 0x53, 0xfb, 0xa0, 0x7c, 0xfd, + 0xc4, 0x61, 0x02, 0x7c, 0xa7, 0x29, 0x9f, 0xbe, 0x47, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x24, + 0x3f, 0x4a, 0x96, 0x5d, 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -759,7 +758,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeRates = append(m.ExchangeRates, ExchangeRateTuple{}) + m.ExchangeRates = append(m.ExchangeRates, DenomExchangeRate{}) if err := m.ExchangeRates[len(m.ExchangeRates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 9067fbcce2..9871ae61ad 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -62,7 +62,7 @@ func TestGenesisValidation(t *testing.T) { func TestGetGenesisStateFromAppState(t *testing.T) { emptyGenesis := GenesisState{ Params: Params{}, - ExchangeRates: []ExchangeRateTuple{}, + ExchangeRates: []DenomExchangeRate{}, FeederDelegations: []FeederDelegation{}, MissCounters: []MissCounter{}, AggregateExchangeRatePrevotes: []AggregateExchangeRatePrevote{}, diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index 4d51ad8e5b..cb8533e660 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -330,23 +330,24 @@ func (m *AvgCounter) XXX_DiscardUnknown() { var xxx_messageInfo_AvgCounter proto.InternalMessageInfo -// ExchangeRate stores exchange rate with timestamp -type ExchangeRate struct { - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` +// DenomExchangeRate stores exchange rate with timestamp +type DenomExchangeRate struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"` } -func (m *ExchangeRate) Reset() { *m = ExchangeRate{} } -func (*ExchangeRate) ProtoMessage() {} -func (*ExchangeRate) Descriptor() ([]byte, []int) { +func (m *DenomExchangeRate) Reset() { *m = DenomExchangeRate{} } +func (*DenomExchangeRate) ProtoMessage() {} +func (*DenomExchangeRate) Descriptor() ([]byte, []int) { return fileDescriptor_8893c9e0e94ceb54, []int{7} } -func (m *ExchangeRate) XXX_Unmarshal(b []byte) error { +func (m *DenomExchangeRate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ExchangeRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DenomExchangeRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ExchangeRate.Marshal(b, m, deterministic) + return xxx_messageInfo_DenomExchangeRate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -356,17 +357,17 @@ func (m *ExchangeRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *ExchangeRate) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExchangeRate.Merge(m, src) +func (m *DenomExchangeRate) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomExchangeRate.Merge(m, src) } -func (m *ExchangeRate) XXX_Size() int { +func (m *DenomExchangeRate) XXX_Size() int { return m.Size() } -func (m *ExchangeRate) XXX_DiscardUnknown() { - xxx_messageInfo_ExchangeRate.DiscardUnknown(m) +func (m *DenomExchangeRate) XXX_DiscardUnknown() { + xxx_messageInfo_DenomExchangeRate.DiscardUnknown(m) } -var xxx_messageInfo_ExchangeRate proto.InternalMessageInfo +var xxx_messageInfo_DenomExchangeRate proto.InternalMessageInfo func init() { proto.RegisterType((*Params)(nil), "umee.oracle.v1.Params") @@ -376,81 +377,81 @@ func init() { proto.RegisterType((*AggregateExchangeRateVote)(nil), "umee.oracle.v1.AggregateExchangeRateVote") proto.RegisterType((*ExchangeRateTuple)(nil), "umee.oracle.v1.ExchangeRateTuple") proto.RegisterType((*AvgCounter)(nil), "umee.oracle.v1.AvgCounter") - proto.RegisterType((*ExchangeRate)(nil), "umee.oracle.v1.ExchangeRate") + proto.RegisterType((*DenomExchangeRate)(nil), "umee.oracle.v1.DenomExchangeRate") } func init() { proto.RegisterFile("umee/oracle/v1/oracle.proto", fileDescriptor_8893c9e0e94ceb54) } var fileDescriptor_8893c9e0e94ceb54 = []byte{ - // 1074 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0x92, 0x8f, 0xda, 0xe3, 0xa4, 0x4d, 0x36, 0x0e, 0xb8, 0x09, 0xf2, 0xa6, 0x8b, 0x28, - 0x39, 0xd0, 0x35, 0x4d, 0xf9, 0x10, 0x39, 0xd1, 0x25, 0x94, 0x4b, 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c, 0xf3, 0x41, - 0xf9, 0x47, 0xc4, 0xaf, 0x8b, 0x88, 0xcf, 0xc5, 0x88, 0x2a, 0xca, 0x6e, 0xfd, 0xdb, 0x52, 0xe8, - 0x99, 0x05, 0x96, 0xcc, 0xea, 0xda, 0x3e, 0x98, 0x97, 0x75, 0xfa, 0x6f, 0x5a, 0x25, 0xd7, 0xf6, - 0x41, 0x63, 0xf2, 0x2f, 0x68, 0x26, 0x79, 0x15, 0xad, 0xaa, 0xa5, 0xff, 0xf8, 0xfc, 0xf7, 0x4e, - 0xed, 0xfc, 0xa2, 0x63, 0xbd, 0xbc, 0xe8, 0x58, 0xbf, 0x5d, 0x74, 0xac, 0xe7, 0x97, 0x9d, 0xda, - 0xcb, 0xcb, 0x4e, 0xed, 0x97, 0xcb, 0x4e, 0xed, 0x6b, 0xcf, 0x50, 0x26, 0x9a, 0xf9, 0x5e, 0x86, - 0xf8, 0x31, 0xa1, 0x47, 0xd2, 0xe8, 0x8e, 0x3e, 0xee, 0x9e, 0x94, 0xff, 0xef, 0xa4, 0xca, 0xde, - 0xa2, 0x14, 0xf0, 0xe0, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xc7, 0x26, 0x38, 0xfb, 0x09, - 0x00, 0x00, + // 1079 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbd, 0x6f, 0xdb, 0x46, + 0x14, 0x17, 0xeb, 0x8f, 0x48, 0x27, 0x3b, 0xb1, 0x69, 0xb9, 0x55, 0xec, 0x42, 0x74, 0x58, 0x34, + 0xf5, 0xd0, 0x50, 0x8d, 0xd3, 0x0f, 0xd4, 0x53, 0xc3, 0xba, 0xe9, 0x92, 0x00, 0x06, 0x63, 0xa4, + 0x40, 0x17, 0xe2, 0x44, 0x9e, 0xa9, 0x83, 0x45, 0x9e, 0x70, 0x77, 0x94, 0xed, 0xa5, 0x73, 0xa7, +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 0xde, 0x19, 0x17, + 0xce, 0x9a, 0xc9, 0x2f, 0x2b, 0xd3, 0x94, 0xa6, 0x2e, 0xc6, 0x77, 0xa0, 0x95, 0xe2, 0x2c, 0x1c, + 0xc1, 0x01, 0x8e, 0x45, 0xa7, 0x95, 0x3e, 0xea, 0x52, 0xf1, 0xa3, 0x99, 0x15, 0x6f, 0xaa, 0x88, + 0x57, 0xf9, 0x74, 0x83, 0xd5, 0x14, 0x67, 0x4f, 0xc4, 0xe9, 0x3e, 0xa2, 0x3a, 0xfe, 0x0e, 0x58, + 0xef, 0x63, 0xc6, 0x09, 0xc5, 0x51, 0x28, 0x87, 0xa8, 0x9c, 0x85, 0x86, 0x48, 0x22, 0x58, 0x2b, + 0xc1, 0xc7, 0x02, 0xd3, 0xcd, 0xef, 0x81, 0xb5, 0x14, 0xc5, 0x18, 0x66, 0xd3, 0x0c, 0x20, 0x19, + 0xab, 0x0a, 0x32, 0xef, 0x7f, 0x04, 0x5a, 0x29, 0x3c, 0xc1, 0x69, 0x9e, 0x86, 0x43, 0x8a, 0x23, + 0xa4, 0x68, 0xac, 0xdd, 0x94, 0x04, 0x5b, 0x63, 0xfb, 0x02, 0x92, 0x34, 0x26, 0x54, 0x95, 0x0c, + 0x33, 0x12, 0x6b, 0x2f, 0x29, 0x55, 0x1a, 0x7c, 0x54, 0x85, 0x62, 0xbb, 0xf5, 0x67, 0xcf, 0x9d, + 0xda, 0xdf, 0xcf, 0x1d, 0xcb, 0xfd, 0xd7, 0x02, 0x2b, 0xf7, 0x47, 0xc9, 0x97, 0x24, 0xcf, 0x38, + 0xa2, 0x7a, 0xd4, 0x09, 0x00, 0x70, 0x94, 0x98, 0x93, 0xde, 0xdc, 0xb9, 0xe9, 0xa9, 0x55, 0xe1, + 0x95, 0xab, 0xc2, 0xdb, 0xd3, 0xab, 0xc2, 0xff, 0x44, 0x54, 0xfe, 0x9f, 0xc2, 0x69, 0x55, 0xa4, + 0x0f, 0x49, 0x8a, 0x39, 0x4a,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59, 0x60, 0x55, 0xce, 0x8d, 0x59, 0xe2, 0xd7, 0xae, 0xae, 0x0f, 0xe6, 0x8d, 0xa2, + 0xce, 0x9a, 0x98, 0xe4, 0xda, 0x3e, 0x68, 0x4c, 0xfe, 0x32, 0xcd, 0x94, 0x4b, 0x45, 0xab, 0x0a, + 0xef, 0x3f, 0x3c, 0xfb, 0xab, 0x53, 0x3b, 0x3b, 0xef, 0x58, 0x2f, 0xce, 0x3b, 0xd6, 0x9f, 0xe7, + 0x1d, 0xeb, 0xe9, 0x45, 0xa7, 0xf6, 0xe2, 0xa2, 0x53, 0xfb, 0xfd, 0xa2, 0x53, 0xfb, 0xd6, 0x33, + 0x94, 0x89, 0xce, 0xbf, 0x93, 0x21, 0x7e, 0x4c, 0xe8, 0x91, 0x34, 0xba, 0xa3, 0x4f, 0xbb, 0x27, + 0xe5, 0x9f, 0x41, 0xa9, 0xb2, 0xb7, 0x28, 0x05, 0xdc, 0xfb, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x1b, + 0x86, 0x5f, 0xfc, 0x28, 0x0a, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -880,7 +881,7 @@ func (m *AvgCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ExchangeRate) Marshal() (dAtA []byte, err error) { +func (m *DenomExchangeRate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -890,12 +891,12 @@ func (m *ExchangeRate) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExchangeRate) MarshalTo(dAtA []byte) (int, error) { +func (m *DenomExchangeRate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExchangeRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DenomExchangeRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -917,7 +918,14 @@ func (m *ExchangeRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintOracle(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintOracle(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1079,12 +1087,16 @@ func (m *AvgCounter) Size() (n int) { return n } -func (m *ExchangeRate) Size() (n int) { +func (m *DenomExchangeRate) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovOracle(uint64(l)) + } l = m.Rate.Size() n += 1 + l + sovOracle(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) @@ -2201,7 +2213,7 @@ func (m *AvgCounter) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExchangeRate) Unmarshal(dAtA []byte) error { +func (m *DenomExchangeRate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2224,13 +2236,45 @@ func (m *ExchangeRate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExchangeRate: wiretype end group for non-group") + return fmt.Errorf("proto: DenomExchangeRate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExchangeRate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DenomExchangeRate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOracle + } + 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 ErrInvalidLengthOracle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOracle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) } diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index bd922f2613..d97cf6b9b8 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -31,6 +31,87 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryExgRatesWithTimestamp is the request type for the Query/ExchangeRatesWithTimestamp RPC +// method. +type QueryExgRatesWithTimestamp struct { + // denom defines the denomination to query for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryExgRatesWithTimestamp) Reset() { *m = QueryExgRatesWithTimestamp{} } +func (m *QueryExgRatesWithTimestamp) String() string { return proto.CompactTextString(m) } +func (*QueryExgRatesWithTimestamp) ProtoMessage() {} +func (*QueryExgRatesWithTimestamp) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{0} +} +func (m *QueryExgRatesWithTimestamp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExgRatesWithTimestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExgRatesWithTimestamp.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 *QueryExgRatesWithTimestamp) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExgRatesWithTimestamp.Merge(m, src) +} +func (m *QueryExgRatesWithTimestamp) XXX_Size() int { + return m.Size() +} +func (m *QueryExgRatesWithTimestamp) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExgRatesWithTimestamp.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExgRatesWithTimestamp proto.InternalMessageInfo + +// QueryExgRatesWithTimestampResponse is response type for the +// Query/ExchangeRatesWithTimestamp RPC method. +type QueryExgRatesWithTimestampResponse struct { + // exchange_rates defines a list of the exchange rate for all whitelisted + // denoms with timestamp + ExgRates []DenomExchangeRate `protobuf:"bytes,1,rep,name=exg_rates,json=exgRates,proto3" json:"exg_rates"` +} + +func (m *QueryExgRatesWithTimestampResponse) Reset() { *m = QueryExgRatesWithTimestampResponse{} } +func (m *QueryExgRatesWithTimestampResponse) String() string { return proto.CompactTextString(m) } +func (*QueryExgRatesWithTimestampResponse) ProtoMessage() {} +func (*QueryExgRatesWithTimestampResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{1} +} +func (m *QueryExgRatesWithTimestampResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExgRatesWithTimestampResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExgRatesWithTimestampResponse.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 *QueryExgRatesWithTimestampResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExgRatesWithTimestampResponse.Merge(m, src) +} +func (m *QueryExgRatesWithTimestampResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryExgRatesWithTimestampResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExgRatesWithTimestampResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExgRatesWithTimestampResponse proto.InternalMessageInfo + // QueryExchangeRates is the request type for the Query/ExchangeRate RPC // method. type QueryExchangeRates struct { @@ -42,7 +123,7 @@ func (m *QueryExchangeRates) Reset() { *m = QueryExchangeRates{} } func (m *QueryExchangeRates) String() string { return proto.CompactTextString(m) } func (*QueryExchangeRates) ProtoMessage() {} func (*QueryExchangeRates) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{0} + return fileDescriptor_710e319bc1815d33, []int{2} } func (m *QueryExchangeRates) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -83,7 +164,7 @@ func (m *QueryExchangeRatesResponse) Reset() { *m = QueryExchangeRatesRe func (m *QueryExchangeRatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryExchangeRatesResponse) ProtoMessage() {} func (*QueryExchangeRatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{1} + return fileDescriptor_710e319bc1815d33, []int{3} } func (m *QueryExchangeRatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,7 +202,7 @@ func (m *QueryActiveExchangeRates) Reset() { *m = QueryActiveExchangeRat func (m *QueryActiveExchangeRates) String() string { return proto.CompactTextString(m) } func (*QueryActiveExchangeRates) ProtoMessage() {} func (*QueryActiveExchangeRates) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{2} + return fileDescriptor_710e319bc1815d33, []int{4} } func (m *QueryActiveExchangeRates) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -162,7 +243,7 @@ func (m *QueryActiveExchangeRatesResponse) Reset() { *m = QueryActiveExc func (m *QueryActiveExchangeRatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryActiveExchangeRatesResponse) ProtoMessage() {} func (*QueryActiveExchangeRatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{3} + return fileDescriptor_710e319bc1815d33, []int{5} } func (m *QueryActiveExchangeRatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -202,7 +283,7 @@ func (m *QueryFeederDelegation) Reset() { *m = QueryFeederDelegation{} } func (m *QueryFeederDelegation) String() string { return proto.CompactTextString(m) } func (*QueryFeederDelegation) ProtoMessage() {} func (*QueryFeederDelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{4} + return fileDescriptor_710e319bc1815d33, []int{6} } func (m *QueryFeederDelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -242,7 +323,7 @@ func (m *QueryFeederDelegationResponse) Reset() { *m = QueryFeederDelega func (m *QueryFeederDelegationResponse) String() string { return proto.CompactTextString(m) } func (*QueryFeederDelegationResponse) ProtoMessage() {} func (*QueryFeederDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{5} + return fileDescriptor_710e319bc1815d33, []int{7} } func (m *QueryFeederDelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -282,7 +363,7 @@ func (m *QueryMissCounter) Reset() { *m = QueryMissCounter{} } func (m *QueryMissCounter) String() string { return proto.CompactTextString(m) } func (*QueryMissCounter) ProtoMessage() {} func (*QueryMissCounter) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{6} + return fileDescriptor_710e319bc1815d33, []int{8} } func (m *QueryMissCounter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -322,7 +403,7 @@ func (m *QueryMissCounterResponse) Reset() { *m = QueryMissCounterRespon func (m *QueryMissCounterResponse) String() string { return proto.CompactTextString(m) } func (*QueryMissCounterResponse) ProtoMessage() {} func (*QueryMissCounterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{7} + return fileDescriptor_710e319bc1815d33, []int{9} } func (m *QueryMissCounterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +441,7 @@ func (m *QuerySlashWindow) Reset() { *m = QuerySlashWindow{} } func (m *QuerySlashWindow) String() string { return proto.CompactTextString(m) } func (*QuerySlashWindow) ProtoMessage() {} func (*QuerySlashWindow) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{8} + return fileDescriptor_710e319bc1815d33, []int{10} } func (m *QuerySlashWindow) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -401,7 +482,7 @@ func (m *QuerySlashWindowResponse) Reset() { *m = QuerySlashWindowRespon func (m *QuerySlashWindowResponse) String() string { return proto.CompactTextString(m) } func (*QuerySlashWindowResponse) ProtoMessage() {} func (*QuerySlashWindowResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{9} + return fileDescriptor_710e319bc1815d33, []int{11} } func (m *QuerySlashWindowResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -441,7 +522,7 @@ func (m *QueryAggregatePrevote) Reset() { *m = QueryAggregatePrevote{} } func (m *QueryAggregatePrevote) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevote) ProtoMessage() {} func (*QueryAggregatePrevote) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{10} + return fileDescriptor_710e319bc1815d33, []int{12} } func (m *QueryAggregatePrevote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,7 +563,7 @@ func (m *QueryAggregatePrevoteResponse) Reset() { *m = QueryAggregatePre func (m *QueryAggregatePrevoteResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevoteResponse) ProtoMessage() {} func (*QueryAggregatePrevoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{11} + return fileDescriptor_710e319bc1815d33, []int{13} } func (m *QueryAggregatePrevoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -520,7 +601,7 @@ func (m *QueryAggregatePrevotes) Reset() { *m = QueryAggregatePrevotes{} func (m *QueryAggregatePrevotes) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevotes) ProtoMessage() {} func (*QueryAggregatePrevotes) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{12} + return fileDescriptor_710e319bc1815d33, []int{14} } func (m *QueryAggregatePrevotes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -561,7 +642,7 @@ func (m *QueryAggregatePrevotesResponse) Reset() { *m = QueryAggregatePr func (m *QueryAggregatePrevotesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevotesResponse) ProtoMessage() {} func (*QueryAggregatePrevotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{13} + return fileDescriptor_710e319bc1815d33, []int{15} } func (m *QueryAggregatePrevotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -601,7 +682,7 @@ func (m *QueryAggregateVote) Reset() { *m = QueryAggregateVote{} } func (m *QueryAggregateVote) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVote) ProtoMessage() {} func (*QueryAggregateVote) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{14} + return fileDescriptor_710e319bc1815d33, []int{16} } func (m *QueryAggregateVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -642,7 +723,7 @@ func (m *QueryAggregateVoteResponse) Reset() { *m = QueryAggregateVoteRe func (m *QueryAggregateVoteResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVoteResponse) ProtoMessage() {} func (*QueryAggregateVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{15} + return fileDescriptor_710e319bc1815d33, []int{17} } func (m *QueryAggregateVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -680,7 +761,7 @@ func (m *QueryAggregateVotes) Reset() { *m = QueryAggregateVotes{} } func (m *QueryAggregateVotes) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVotes) ProtoMessage() {} func (*QueryAggregateVotes) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{16} + return fileDescriptor_710e319bc1815d33, []int{18} } func (m *QueryAggregateVotes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -721,7 +802,7 @@ func (m *QueryAggregateVotesResponse) Reset() { *m = QueryAggregateVotes func (m *QueryAggregateVotesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVotesResponse) ProtoMessage() {} func (*QueryAggregateVotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{17} + return fileDescriptor_710e319bc1815d33, []int{19} } func (m *QueryAggregateVotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,7 +839,7 @@ func (m *QueryParams) Reset() { *m = QueryParams{} } func (m *QueryParams) String() string { return proto.CompactTextString(m) } func (*QueryParams) ProtoMessage() {} func (*QueryParams) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{18} + return fileDescriptor_710e319bc1815d33, []int{20} } func (m *QueryParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -797,7 +878,7 @@ 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_710e319bc1815d33, []int{19} + return fileDescriptor_710e319bc1815d33, []int{21} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -839,7 +920,7 @@ func (m *QueryMedians) Reset() { *m = QueryMedians{} } func (m *QueryMedians) String() string { return proto.CompactTextString(m) } func (*QueryMedians) ProtoMessage() {} func (*QueryMedians) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{20} + return fileDescriptor_710e319bc1815d33, []int{22} } func (m *QueryMedians) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -879,7 +960,7 @@ func (m *QueryMediansResponse) Reset() { *m = QueryMediansResponse{} } func (m *QueryMediansResponse) String() string { return proto.CompactTextString(m) } func (*QueryMediansResponse) ProtoMessage() {} func (*QueryMediansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{21} + return fileDescriptor_710e319bc1815d33, []int{23} } func (m *QueryMediansResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -918,7 +999,7 @@ func (m *QueryMedianDeviations) Reset() { *m = QueryMedianDeviations{} } func (m *QueryMedianDeviations) String() string { return proto.CompactTextString(m) } func (*QueryMedianDeviations) ProtoMessage() {} func (*QueryMedianDeviations) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{22} + return fileDescriptor_710e319bc1815d33, []int{24} } func (m *QueryMedianDeviations) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -958,7 +1039,7 @@ func (m *QueryMedianDeviationsResponse) Reset() { *m = QueryMedianDeviat func (m *QueryMedianDeviationsResponse) String() string { return proto.CompactTextString(m) } func (*QueryMedianDeviationsResponse) ProtoMessage() {} func (*QueryMedianDeviationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{23} + return fileDescriptor_710e319bc1815d33, []int{25} } func (m *QueryMedianDeviationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -996,7 +1077,7 @@ func (m *QueryAvgPrice) Reset() { *m = QueryAvgPrice{} } func (m *QueryAvgPrice) String() string { return proto.CompactTextString(m) } func (*QueryAvgPrice) ProtoMessage() {} func (*QueryAvgPrice) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{24} + return fileDescriptor_710e319bc1815d33, []int{26} } func (m *QueryAvgPrice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1034,7 +1115,7 @@ func (m *QueryAvgPriceResponse) Reset() { *m = QueryAvgPriceResponse{} } func (m *QueryAvgPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryAvgPriceResponse) ProtoMessage() {} func (*QueryAvgPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{25} + return fileDescriptor_710e319bc1815d33, []int{27} } func (m *QueryAvgPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1064,6 +1145,8 @@ func (m *QueryAvgPriceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAvgPriceResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*QueryExgRatesWithTimestamp)(nil), "umee.oracle.v1.QueryExgRatesWithTimestamp") + proto.RegisterType((*QueryExgRatesWithTimestampResponse)(nil), "umee.oracle.v1.QueryExgRatesWithTimestampResponse") proto.RegisterType((*QueryExchangeRates)(nil), "umee.oracle.v1.QueryExchangeRates") proto.RegisterType((*QueryExchangeRatesResponse)(nil), "umee.oracle.v1.QueryExchangeRatesResponse") proto.RegisterType((*QueryActiveExchangeRates)(nil), "umee.oracle.v1.QueryActiveExchangeRates") @@ -1095,85 +1178,89 @@ func init() { func init() { proto.RegisterFile("umee/oracle/v1/query.proto", fileDescriptor_710e319bc1815d33) } var fileDescriptor_710e319bc1815d33 = []byte{ - // 1234 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xbd, 0xa5, 0x3f, 0x9f, 0x6b, 0xc7, 0x99, 0x26, 0x91, 0xb5, 0x49, 0xed, 0xb0, 0x4d, - 0xda, 0x90, 0x26, 0xbb, 0x8d, 0x9b, 0x02, 0x8a, 0xa8, 0x20, 0xbf, 0x00, 0x89, 0x56, 0x0a, 0xae, - 0x14, 0x10, 0x17, 0x6b, 0x62, 0x0f, 0x9b, 0xa5, 0xf1, 0xae, 0xd9, 0xd9, 0x38, 0x89, 0xaa, 0xaa, - 0x08, 0x2e, 0x1c, 0x91, 0x2a, 0xe5, 0x88, 0x2a, 0x40, 0xaa, 0xc4, 0x85, 0x7f, 0x23, 0xc7, 0x4a, - 0x5c, 0x10, 0x87, 0x02, 0x09, 0x07, 0xfe, 0x0c, 0xb4, 0x33, 0xb3, 0xe3, 0xfd, 0xe5, 0x1f, 0xc9, - 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, 0x3d, 0xf4, 0x01, 0xe0, 0xcb, 0xcd, 0xdb, 0xc4, 0xdb, - 0x73, 0xdc, 0xc7, 0x5c, 0xbb, 0xfd, 0xb6, 0xb1, 0x1f, 0x3c, 0x6e, 0xf6, 0x31, 0xb0, 0x75, 0x91, - 0xfd, 0x25, 0x7e, 0xf7, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x38, 0x8d, 0xc1, 0x46, 0x10, - 0x00, 0x00, + // 1311 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x98, 0xcf, 0x8f, 0x14, 0x45, + 0x14, 0xc7, 0xa7, 0x91, 0x5f, 0xfb, 0x86, 0x19, 0x86, 0x82, 0x25, 0x9b, 0x66, 0x99, 0x5d, 0x0a, + 0x16, 0x56, 0x60, 0xbb, 0x61, 0x58, 0xd4, 0x10, 0x88, 0xb2, 0x3f, 0xd4, 0x44, 0x48, 0x70, 0x30, + 0x60, 0xbc, 0x4c, 0x6a, 0x67, 0xca, 0x9e, 0x86, 0xed, 0xee, 0xb1, 0xab, 0x77, 0x76, 0x09, 0x21, + 0x18, 0xbd, 0x78, 0x34, 0x21, 0xe1, 0x68, 0x88, 0x9a, 0x98, 0xe8, 0xc1, 0x7f, 0x83, 0x23, 0x89, + 0x31, 0x31, 0x1e, 0x50, 0xc1, 0x83, 0x7f, 0x86, 0xe9, 0xaa, 0xea, 0x9a, 0xfe, 0x39, 0x33, 0xbb, + 0x27, 0x98, 0xf7, 0x5e, 0xbd, 0xef, 0xa7, 0xde, 0x74, 0xd5, 0xb7, 0x77, 0x40, 0xdf, 0x70, 0x28, + 0x35, 0x3d, 0x9f, 0xb4, 0xd7, 0xa9, 0xd9, 0xbf, 0x68, 0x7e, 0xb1, 0x41, 0xfd, 0x07, 0x46, 0xcf, + 0xf7, 0x02, 0x0f, 0x55, 0xc3, 0x9c, 0x21, 0x72, 0x46, 0x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xb6, 0xca, 0xb7, 0xe5, + 0x2f, 0x02, 0xad, 0x20, 0x5a, 0xbb, 0x74, 0xe3, 0xf9, 0x3f, 0xf5, 0xd2, 0xf3, 0x57, 0x75, 0xed, + 0xc5, 0xab, 0xba, 0xf6, 0xf7, 0xab, 0xba, 0xf6, 0xed, 0xeb, 0x7a, 0xe9, 0xc5, 0xeb, 0x7a, 0xe9, + 0x8f, 0xd7, 0xf5, 0xd2, 0x67, 0x46, 0xec, 0x75, 0x25, 0xec, 0xb9, 0xe0, 0xd2, 0x60, 0xd3, 0xf3, + 0xef, 0x0b, 0x81, 0xfe, 0x5b, 0xe6, 0x56, 0xa4, 0xc2, 0x5f, 0x5d, 0xd6, 0xf6, 0xf2, 0x5f, 0x38, + 0x2e, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x1b, 0x92, 0x89, 0x9e, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1217,6 +1304,9 @@ type QueryClient interface { MedianDeviations(ctx context.Context, in *QueryMedianDeviations, opts ...grpc.CallOption) (*QueryMedianDeviationsResponse, error) // QueryAvgPrice returns avg price of a given denom (required). AvgPrice(ctx context.Context, in *QueryAvgPrice, opts ...grpc.CallOption) (*QueryAvgPriceResponse, error) + // ExgRatesWithTimestamp returns exchange rates of all denoms with timestamp, + // or, if specified, returns a single denom + ExgRatesWithTimestamp(ctx context.Context, in *QueryExgRatesWithTimestamp, opts ...grpc.CallOption) (*QueryExgRatesWithTimestampResponse, error) } type queryClient struct { @@ -1344,6 +1434,15 @@ func (c *queryClient) AvgPrice(ctx context.Context, in *QueryAvgPrice, opts ...g return out, nil } +func (c *queryClient) ExgRatesWithTimestamp(ctx context.Context, in *QueryExgRatesWithTimestamp, opts ...grpc.CallOption) (*QueryExgRatesWithTimestampResponse, error) { + out := new(QueryExgRatesWithTimestampResponse) + err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/ExgRatesWithTimestamp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ExchangeRates returns exchange rates of all denoms, @@ -1375,6 +1474,9 @@ type QueryServer interface { MedianDeviations(context.Context, *QueryMedianDeviations) (*QueryMedianDeviationsResponse, error) // QueryAvgPrice returns avg price of a given denom (required). AvgPrice(context.Context, *QueryAvgPrice) (*QueryAvgPriceResponse, error) + // ExgRatesWithTimestamp returns exchange rates of all denoms with timestamp, + // or, if specified, returns a single denom + ExgRatesWithTimestamp(context.Context, *QueryExgRatesWithTimestamp) (*QueryExgRatesWithTimestampResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1420,6 +1522,9 @@ func (*UnimplementedQueryServer) MedianDeviations(ctx context.Context, req *Quer func (*UnimplementedQueryServer) AvgPrice(ctx context.Context, req *QueryAvgPrice) (*QueryAvgPriceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AvgPrice not implemented") } +func (*UnimplementedQueryServer) ExgRatesWithTimestamp(ctx context.Context, req *QueryExgRatesWithTimestamp) (*QueryExgRatesWithTimestampResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExgRatesWithTimestamp not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1659,6 +1764,24 @@ func _Query_AvgPrice_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Query_ExgRatesWithTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExgRatesWithTimestamp) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ExgRatesWithTimestamp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.oracle.v1.Query/ExgRatesWithTimestamp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ExgRatesWithTimestamp(ctx, req.(*QueryExgRatesWithTimestamp)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.oracle.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1715,11 +1838,82 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AvgPrice", Handler: _Query_AvgPrice_Handler, }, + { + MethodName: "ExgRatesWithTimestamp", + Handler: _Query_ExgRatesWithTimestamp_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/oracle/v1/query.proto", } +func (m *QueryExgRatesWithTimestamp) 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 *QueryExgRatesWithTimestamp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExgRatesWithTimestamp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryExgRatesWithTimestampResponse) 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 *QueryExgRatesWithTimestampResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExgRatesWithTimestampResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExgRates) > 0 { + for iNdEx := len(m.ExgRates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExgRates[iNdEx].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 (m *QueryExchangeRates) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2526,6 +2720,34 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryExgRatesWithTimestamp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryExgRatesWithTimestampResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ExgRates) > 0 { + for _, e := range m.ExgRates { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryExchangeRates) Size() (n int) { if m == nil { return 0 @@ -2855,6 +3077,172 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryExgRatesWithTimestamp) 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: QueryExgRatesWithTimestamp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExgRatesWithTimestamp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + 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 (m *QueryExgRatesWithTimestampResponse) 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: QueryExgRatesWithTimestampResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExgRatesWithTimestampResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExgRates", 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 + } + m.ExgRates = append(m.ExgRates, DenomExchangeRate{}) + if err := m.ExgRates[len(m.ExgRates)-1].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 (m *QueryExchangeRates) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 8837ae228e..a49c0fbe18 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -519,6 +519,42 @@ func local_request_Query_AvgPrice_0(ctx context.Context, marshaler runtime.Marsh } +var ( + filter_Query_ExgRatesWithTimestamp_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ExgRatesWithTimestamp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExgRatesWithTimestamp + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ExgRatesWithTimestamp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ExgRatesWithTimestamp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ExgRatesWithTimestamp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExgRatesWithTimestamp + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ExgRatesWithTimestamp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ExgRatesWithTimestamp(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. @@ -824,6 +860,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ExgRatesWithTimestamp_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_ExgRatesWithTimestamp_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_ExgRatesWithTimestamp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1125,6 +1184,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ExgRatesWithTimestamp_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_ExgRatesWithTimestamp_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_ExgRatesWithTimestamp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1154,6 +1233,8 @@ var ( pattern_Query_MedianDeviations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "median_deviations"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AvgPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"umee", "historacle", "v1", "avg_price", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ExgRatesWithTimestamp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "oracle", "v1", "denoms", "exg_rates_timestamp"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1182,4 +1263,6 @@ var ( forward_Query_MedianDeviations_0 = runtime.ForwardResponseMessage forward_Query_AvgPrice_0 = runtime.ForwardResponseMessage + + forward_Query_ExgRatesWithTimestamp_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/vote.go b/x/oracle/types/vote.go index 98991c1d56..f7e1e028e4 100644 --- a/x/oracle/types/vote.go +++ b/x/oracle/types/vote.go @@ -108,8 +108,3 @@ func ParseExchangeRateTuples(tuplesStr string) (ExchangeRateTuples, error) { return tuples, nil } - -func (v ExchangeRate) String() string { - bz, _ := json.Marshal(v) - return string(bz) -} diff --git a/x/oracle/types/vote_test.go b/x/oracle/types/vote_test.go index 97b968b572..d6cc69add5 100644 --- a/x/oracle/types/vote_test.go +++ b/x/oracle/types/vote_test.go @@ -76,6 +76,12 @@ func TestParseExchangeRateTuples(t *testing.T) { assert.NoError(t, err) } +func TestDenomExchangeRateString(t *testing.T) { + t1 := time.Date(2022, 9, 18, 15, 55, 01, 0, time.UTC) + er := DenomExchangeRate{Denom: "ABCD", Rate: sdk.MustNewDecFromStr("1.5"), Timestamp: t1} + assert.Equal(t, `{"denom":"ABCD","rate":"1.500000000000000000","timestamp":"2022-09-18T15:55:01Z"}`, er.String()) +} + func TestExchangeRateString(t *testing.T) { t1 := time.Date(2022, 9, 18, 15, 55, 01, 0, time.UTC) er := ExchangeRate{Rate: sdk.MustNewDecFromStr("1.5"), Timestamp: t1}