Skip to content

Commit

Permalink
Merge pull request #94 from onomyprotocol/auction/remove_oracle_import
Browse files Browse the repository at this point in the history
remove oracle keeper import in vault keeper
  • Loading branch information
vuong177 authored Nov 11, 2024
2 parents 754728d + 66f4899 commit 52f0ab1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ func NewAppKeeper(
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
&appKeepers.VaultsKeeper,
&appKeepers.OracleKeeper,
logger,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
Expand Down
9 changes: 3 additions & 6 deletions x/auction/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ type (
logger log.Logger

// keepers
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
vaultKeeper types.VaultKeeper
OracleKeeper types.OracleKeeper
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
vaultKeeper types.VaultKeeper

// the address capable of executing a MsgUpdateParams message. Typically, this
// should be the x/gov module account.
Expand Down Expand Up @@ -55,7 +54,6 @@ func NewKeeper(
ak types.AccountKeeper,
bk types.BankKeeper,
vk types.VaultKeeper,
ok types.OracleKeeper,
logger log.Logger,
authority string,

Expand All @@ -73,7 +71,6 @@ func NewKeeper(
authKeeper: ak,
bankKeeper: bk,
vaultKeeper: vk,
OracleKeeper: ok,
AuctionIdSeq: collections.NewSequence(sb, types.AuctionIdSeqPrefix, "auction_id_sequence"),
LastestAuctionPeriods: collections.NewItem(sb, types.LastestAuctionPeriodPrefix, "lastestAuctionPeriods", collections.Int64Value),
BidIdSeq: collections.NewMap(sb, types.BidIdSeqPrefix, "bid_id_sequence", collections.Uint64Key, collections.Uint64Value),
Expand Down
1 change: 0 additions & 1 deletion x/auction/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
in.AccountKeeper,
in.BankKeeper,
&in.VaultKeeper,
&in.OracleKeeper,
in.Logger,
authority.String(),
)
Expand Down
6 changes: 0 additions & 6 deletions x/auction/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package types
import (
"context"

"cosmossdk.io/math"

addresscodec "cosmossdk.io/core/address"
sdk "github.com/cosmos/cosmos-sdk/types"
vaulttypes "github.com/onomyprotocol/reserve/x/vaults/types"
Expand Down Expand Up @@ -48,7 +46,3 @@ type VaultKeeper interface {
GetVault(ctx context.Context, vaultId uint64) (vaulttypes.Vault, error)
GetAllowedMintDenoms(ctx context.Context) []string
}

type OracleKeeper interface {
GetPrice(ctx context.Context, base, quote string) *math.LegacyDec
}
2 changes: 1 addition & 1 deletion x/psm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (k Keeper) checkLimitTotalStablecoin(ctx context.Context, coin sdk.Coin) er
return err
}
if (totalStablecoinLock.Add(coin.Amount)).GT(totalLimit) {
return fmt.Errorf("unable to perform %s token swap transaction because the amount of %s you want to swap exceeds the allowed limit, can only swap up to %s%s", coin.Denom, coin.Denom, (totalLimit).Sub(totalStablecoinLock).String(), coin.Denom)
return fmt.Errorf("unable to perform %s token swap transaction: exceeds the allowed limit %s , can only swap up to %s%s", coin.Denom, coin.Denom, (totalLimit).Sub(totalStablecoinLock).String(), coin.Denom)
}

return nil
Expand Down
1 change: 0 additions & 1 deletion x/psm/types/psm.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func GetMsgStablecoin(msg getStablecoinFromMsg) StablecoinInfo {
type getStablecoinFromMsg interface {
GetDenom() string
GetLimitTotal() math.Int
// GetPrice() math.LegacyDec
GetFeeIn() math.LegacyDec
GetFeeOut() math.LegacyDec
GetSymBol() string
Expand Down

0 comments on commit 52f0ab1

Please sign in to comment.