From bf8ce7863c928d0819ba8bd84a458798932fa665 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Mon, 18 Sep 2023 16:21:14 +0200 Subject: [PATCH] abci test --- x/oracle/abci_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/x/oracle/abci_test.go b/x/oracle/abci_test.go index efb506c778..6b57cb318c 100644 --- a/x/oracle/abci_test.go +++ b/x/oracle/abci_test.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" @@ -177,8 +176,8 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { for _, denom := range app.OracleKeeper.AcceptList(ctx) { rate, err := app.OracleKeeper.GetExchangeRate(ctx, denom.SymbolDenom) - s.Require().ErrorIs(err, sdkerrors.Wrap(types.ErrUnknownDenom, denom.SymbolDenom)) - s.Require().Equal(sdk.ZeroDec(), rate) + s.Require().ErrorIs(err, types.ErrUnknownDenom.Wrap(denom.SymbolDenom)) + s.Require().Equal(types.ExchangeRate{}, rate) } // Test: val2 and val3 votes. @@ -200,7 +199,7 @@ 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(sdk.MustNewDecFromStr("0.5"), rate) + s.Require().Equal(types.ExchangeRate{Rate: sdk.NewDecWithPrec(5, 1), Timestamp: ctx.BlockTime()}, rate) } // TODO: check reward distribution @@ -237,10 +236,10 @@ func (s *IntegrationTestSuite) TestEndBlockerVoteThreshold() { rate, err := app.OracleKeeper.GetExchangeRate(ctx, "umee") s.Require().NoError(err) - s.Require().Equal(sdk.MustNewDecFromStr("1.0"), rate) + s.Require().Equal(types.ExchangeRate{Rate: sdk.OneDec(), Timestamp: ctx.BlockTime()}, rate) rate, err = app.OracleKeeper.GetExchangeRate(ctx, "atom") - s.Require().ErrorIs(err, sdkerrors.Wrap(types.ErrUnknownDenom, "atom")) - s.Require().Equal(sdk.ZeroDec(), rate) + s.Require().ErrorIs(err, types.ErrUnknownDenom.Wrap("atom")) + s.Require().Equal(types.ExchangeRate{}, rate) } var exchangeRates = map[string][]sdk.Dec{