Skip to content

Commit

Permalink
PR comments changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Unique-Divine committed Nov 28, 2023
1 parent 63b72aa commit b081818
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions x/perp/v2/keeper/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ func (k admin) UnsafeChangeCollateralDenom(
return nil
}

// ShiftPegMultiplier: Edit the peg multiplier of an amm pool after making
// sure there's enough money in the perp EF fund to pay for the repeg. These
// funds get send to the vault to pay for trader's new net margin.
// ShiftPegMultiplier: Edit the peg multiplier of an amm pool after making sure
// there's enough money in the perp fund to pay for the repeg. These funds get
// send to the vault to pay for trader's new net margin.
func (k admin) ShiftPegMultiplier(
ctx sdk.Context,
pair asset.Pair,
Expand All @@ -190,9 +190,9 @@ func (k admin) ShiftPegMultiplier(
return k.UnsafeShiftPegMultiplier(ctx, pair, newPriceMultiplier)
}

// ShiftSwapInvariant: Edit the peg multiplier of an amm pool after making
// sure there's enough money in the perp EF fund to pay for the repeg. These
// funds get send to the vault to pay for trader's new net margin.
// ShiftSwapInvariant: Edit the swap invariant (liquidity depth) of an amm pool,
// ensuring that there's enough money in the perp fund to pay for the operation.
// These funds get send to the vault to pay for trader's new net margin.
func (k admin) ShiftSwapInvariant(
ctx sdk.Context,
pair asset.Pair,
Expand Down
4 changes: 0 additions & 4 deletions x/perp/v2/keeper/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,6 @@ func (s *TestSuiteAdmin) TestCheckPermissions() {
}
sender := senderAddr.String()

state, err := s.nibiru.AppKeepers.SudoKeeper.Sudoers.Get(s.ctx)
fmt.Printf("state: %v\n", state)
fmt.Printf("err: %v\n", err)

for _, testCaseMsg := range []sdk.Msg{
&perptypes.MsgShiftPegMultiplier{
Sender: sender, Pair: asset.Pair("valid:pair"), NewPegMult: sdk.NewDec(420),
Expand Down
4 changes: 2 additions & 2 deletions x/perp/v2/keeper/amm.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func (k Keeper) UnsafeShiftPegMultiplier(
}

// UnsafeShiftSwapInvariant: [Without checking x/sudo permissions] Edit the swap
// invariant of an amm pool after making sure there's enough money in the perp EF
// fund to pay for the repeg. These funds get send to the vault to pay for
// invariant of an amm pool after making sure there's enough money in the perp
// fund to pay for the operation. These funds get send to the vault to pay for
// trader's new net margin.
func (k Keeper) UnsafeShiftSwapInvariant(
ctx sdk.Context, pair asset.Pair, newSwapInvariant sdk.Dec,
Expand Down
12 changes: 8 additions & 4 deletions x/perp/v2/keeper/amm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
types "github.com/NibiruChain/nibiru/x/perp/v2/types"
)

func TestEditPriceMultipler(t *testing.T) {
func TestUnsafeShiftPegMultiplier(t *testing.T) {
pair := asset.Registry.Pair(denoms.BTC, denoms.NUSD)

tests := TestCases{
Expand Down Expand Up @@ -152,7 +152,9 @@ func TestEditPriceMultipler(t *testing.T) {
NewTestSuite(t).WithTestCases(tests...).Run()
}

func TestEditPriceMultiplerFail(t *testing.T) {
// TestUnsafeShiftPegMultiplier_Fail: Test scenarios for the
// `UnsafeShiftPegMultiplier` function that should error
func TestUnsafeShiftPegMultiplier_Fail(t *testing.T) {
pair := asset.Registry.Pair(denoms.BTC, denoms.NUSD)
app, ctx := testapp.NewNibiruTestAppAndContext()

Expand Down Expand Up @@ -219,7 +221,9 @@ func TestEditPriceMultiplerFail(t *testing.T) {
require.NoError(t, err)
}

func TestEditSwapInvariantFail(t *testing.T) {
// TestUnsafeShiftSwapInvariant_Fail: Test scenarios for the
// `UnsafeShiftSwapInvariant` function that should error
func TestUnsafeShiftSwapInvariant_Fail(t *testing.T) {
pair := asset.Registry.Pair(denoms.BTC, denoms.NUSD)
app, ctx := testapp.NewNibiruTestAppAndContext()
account := testutil.AccAddress()
Expand Down Expand Up @@ -289,7 +293,7 @@ func TestEditSwapInvariantFail(t *testing.T) {
require.NoError(t, err)
}

func TestEditSwapInvariant(t *testing.T) {
func TestUnsafeShiftSwapInvariant(t *testing.T) {
pair := asset.Registry.Pair(denoms.BTC, denoms.NUSD)

tests := TestCases{
Expand Down

0 comments on commit b081818

Please sign in to comment.