Skip to content

Commit

Permalink
lint, vaults.DefaultParams.MintDenome call to nomUSD
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Nov 1, 2024
1 parent c3a9969 commit 909239a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions x/oracle/keeper/band_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions x/oracle/module/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
1 change: 0 additions & 1 deletion x/oracle/types/band_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const (
BandPriceMultiplier uint64 = 1000000000 // 1e9
MaxDataSize = 256 // 256B
QuoteUSD = "USD"
QuoteNomUSD = "nomUSD"
)

type RequestID int64
Expand Down
5 changes: 2 additions & 3 deletions x/oracle/types/msgs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package types

import (
"cosmossdk.io/errors"
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 909239a

Please sign in to comment.