Skip to content

Commit

Permalink
fix test pass ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Nov 8, 2024
1 parent d89cee4 commit 02856bd
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 330 deletions.
2 changes: 1 addition & 1 deletion x/psm/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (k Keeper) BeginBlocker(ctx context.Context) error {

func (k Keeper) UpdatesStablecoinEpoch(ctx context.Context) error {
updatePrice := func(info types.StablecoinInfo) bool {
price := k.OracleKeeper.GetPrice(ctx, info.Denom, "USD")
price := k.OracleKeeper.GetPrice(ctx, info.Denom, types.ReserveStableCoinDenom)
if price == nil || price.IsNil() {
return false
}
Expand Down
9 changes: 5 additions & 4 deletions x/psm/keeper/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ func (s *KeeperTestSuite) TestUpdatesStablecoinEpoch() {
for _, t := range tests {
s.Run(t.name, func() {
sc := types.GetMsgStablecoin(&types.MsgAddStableCoin{
Denom: usdt,
LimitTotal: limitUSDT,
FeeIn: t.feeIn,
FeeOut: t.feeOut,
Denom: usdt,
LimitTotal: limitUSDT,
FeeIn: t.feeIn,
FeeOut: t.feeOut,
OracleScript: 44,
})
s.mockOracleKeeper.SetPrice(s.Ctx, sc.Denom, t.priceCurrent)
err := s.k.StablecoinInfos.Set(s.Ctx, sc.Denom, sc)
Expand Down
4 changes: 2 additions & 2 deletions x/psm/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ var (
usdt = "usdt"
usdc = "usdc"

limitUSDT = math.NewInt(1000000)
limitUSDC = math.NewInt(1000000)
limitUSDT = math.NewInt(100000000)
limitUSDC = math.NewInt(100000000)
)

type MockOracleKeeper struct {
Expand Down
158 changes: 0 additions & 158 deletions x/psm/keeper/msg_server_test.go

This file was deleted.

33 changes: 18 additions & 15 deletions x/psm/keeper/proposals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ func (s *KeeperTestSuite) TestAddStableCoinProposal() {
s.SetupTest()

proAdd := types.MsgAddStableCoin{
Denom: usdt,
LimitTotal: limitUSDT,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
FeeIn: math.LegacyMustNewDecFromStr("0.001"),
FeeOut: math.LegacyMustNewDecFromStr("0.001"),
Denom: usdt,
LimitTotal: limitUSDT,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
FeeIn: math.LegacyMustNewDecFromStr("0.001"),
FeeOut: math.LegacyMustNewDecFromStr("0.001"),
OracleScript: 44,
}

_, err := s.msgServer.AddStableCoinProposal(s.Ctx, &proAdd)
Expand All @@ -31,11 +32,12 @@ func (s *KeeperTestSuite) TestUpdateStableCoinProposal() {
s.SetupTest()

proAdd := types.MsgAddStableCoin{
Denom: usdt,
LimitTotal: limitUSDT,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
FeeIn: math.LegacyMustNewDecFromStr("0.001"),
FeeOut: math.LegacyMustNewDecFromStr("0.001"),
Denom: usdt,
LimitTotal: limitUSDT,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
FeeIn: math.LegacyMustNewDecFromStr("0.001"),
FeeOut: math.LegacyMustNewDecFromStr("0.001"),
OracleScript: 44,
}

_, err := s.msgServer.AddStableCoinProposal(s.Ctx, &proAdd)
Expand All @@ -50,11 +52,12 @@ func (s *KeeperTestSuite) TestUpdateStableCoinProposal() {
limitTotalUpdates := math.NewInt(2000000)

proUpdates := types.MsgUpdatesStableCoin{
Denom: usdt,
LimitTotal: limitTotalUpdates,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
FeeIn: math.LegacyMustNewDecFromStr("0.001"),
FeeOut: math.LegacyMustNewDecFromStr("0.001"),
Denom: usdt,
LimitTotal: limitTotalUpdates,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
FeeIn: math.LegacyMustNewDecFromStr("0.001"),
FeeOut: math.LegacyMustNewDecFromStr("0.001"),
OracleScript: 44,
}

_, err = s.msgServer.UpdatesStableCoinProposal(s.Ctx, &proUpdates)
Expand Down
Loading

0 comments on commit 02856bd

Please sign in to comment.