From 909239af56551f3ee13e39b6ee319b668c78d961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDongLieu=E2=80=9D?= Date: Fri, 1 Nov 2024 10:36:51 +0700 Subject: [PATCH] lint, vaults.DefaultParams.MintDenome call to nomUSD --- x/oracle/keeper/band_oracle.go | 6 ++++-- x/oracle/module/genesis.go | 1 + x/oracle/types/band_oracle.go | 1 - x/oracle/types/msgs.go | 5 ++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/x/oracle/keeper/band_oracle.go b/x/oracle/keeper/band_oracle.go index a694a989..7ceec386 100644 --- a/x/oracle/keeper/band_oracle.go +++ b/x/oracle/keeper/band_oracle.go @@ -15,7 +15,9 @@ import ( clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" // nolint:all channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + "github.com/onomyprotocol/reserve/x/oracle/types" + vaultstypes "github.com/onomyprotocol/reserve/x/vaults/types" ) // SetBandParams sets the Band params in the state @@ -279,7 +281,7 @@ func (k Keeper) AddNewSymbolToBandOracleRequest(ctx context.Context, symbol stri err = k.SetBandLatestRequestID(ctx, requestID) if err != nil { - return fmt.Errorf("can not set latest request id %v with symbol %s", requestID ,symbol) + return fmt.Errorf("can not set latest request id %v with symbol %s", requestID, symbol) } return nil @@ -294,7 +296,7 @@ func (k Keeper) GetPrice(ctx context.Context, base, quote string) *math.LegacyDe return nil } - if quote == types.QuoteUSD || quote == types.QuoteNomUSD { + if quote == types.QuoteUSD || quote == vaultstypes.DefaultMintDenom { return &basePriceState.PriceState.Price } diff --git a/x/oracle/module/genesis.go b/x/oracle/module/genesis.go index 579affe6..5148f5fc 100644 --- a/x/oracle/module/genesis.go +++ b/x/oracle/module/genesis.go @@ -3,6 +3,7 @@ package oracle import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onomyprotocol/reserve/x/oracle/keeper" "github.com/onomyprotocol/reserve/x/oracle/types" ) diff --git a/x/oracle/types/band_oracle.go b/x/oracle/types/band_oracle.go index 3b987357..cba44f3b 100644 --- a/x/oracle/types/band_oracle.go +++ b/x/oracle/types/band_oracle.go @@ -14,7 +14,6 @@ const ( BandPriceMultiplier uint64 = 1000000000 // 1e9 MaxDataSize = 256 // 256B QuoteUSD = "USD" - QuoteNomUSD = "nomUSD" ) type RequestID int64 diff --git a/x/oracle/types/msgs.go b/x/oracle/types/msgs.go index 4fbb9d78..d13237dd 100644 --- a/x/oracle/types/msgs.go +++ b/x/oracle/types/msgs.go @@ -1,7 +1,6 @@ package types import ( - "cosmossdk.io/errors" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -68,11 +67,11 @@ func (msg MsgRequestBandRates) ValidateBasic() error { return err } if sender.Empty() { - return errors.Wrapf(ErrInvalidBandRequest, "MsgRequestBandRates: Sender address must not be empty.") + return errorsmod.Wrapf(ErrInvalidBandRequest, "MsgRequestBandRates: Sender address must not be empty.") } if msg.RequestId == 0 { - return errors.Wrapf(ErrInvalidBandRequest, "MsgRequestBandRates: requestID should be greater than zero") + return errorsmod.Wrapf(ErrInvalidBandRequest, "MsgRequestBandRates: requestID should be greater than zero") } return nil }