From 28cf22791f8b945e89a094a3c415432922dabcde Mon Sep 17 00:00:00 2001 From: Jay Yu <103467857+jayy04@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:06:32 -0500 Subject: [PATCH] fix test --- protocol/x/perpetuals/keeper/perpetual_test.go | 8 ++++---- protocol/x/perpetuals/module_test.go | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/protocol/x/perpetuals/keeper/perpetual_test.go b/protocol/x/perpetuals/keeper/perpetual_test.go index 9de721b8e9..8f6243ef7d 100644 --- a/protocol/x/perpetuals/keeper/perpetual_test.go +++ b/protocol/x/perpetuals/keeper/perpetual_test.go @@ -550,10 +550,10 @@ func TestGetMarginRequirements_Success(t *testing.T) { initialMarginPpm: uint32(oneBip * 1), maintenanceFractionPpm: uint32(1_000_000), // 100% of IM, bigExpectedInitialMarginPpm: big_testutil.MustFirst( - new(big.Int).SetString("340282366920938463426481119284349108", 10), + new(big.Int).SetString("340282366920938463426481119284349109", 10), ), bigExpectedMaintenanceMarginPpm: big_testutil.MustFirst( - new(big.Int).SetString("340282366920938463426481119284349108", 10), + new(big.Int).SetString("340282366920938463426481119284349109", 10), ), }, "InitialMargin 100 BIPs, MaintenanceMargin 50 BIPs, atomic resolution 6": { @@ -590,8 +590,8 @@ func TestGetMarginRequirements_Success(t *testing.T) { maintenanceFractionPpm: uint32(600_000), // 60% of IM // quoteQuantums = 123_456 * 74_523 = 9_200_311_488 // initialMarginPpmQuoteQuantums = initialMarginPpm * quoteQuantums / 1_000_000 - // = 50_000 * 9_200_311_488 / 1_000_000 ~= 460_015_574 - bigExpectedInitialMarginPpm: big.NewInt(460_015_574), + // = 50_000 * 9_200_311_488 / 1_000_000 ~= 460_015_575 + bigExpectedInitialMarginPpm: big.NewInt(460_015_575), bigExpectedMaintenanceMarginPpm: big.NewInt(276_009_345), }, "InitialMargin 25%, MaintenanceMargin 15%, atomic resolution 6": { diff --git a/protocol/x/perpetuals/module_test.go b/protocol/x/perpetuals/module_test.go index 64aab5ec86..2c76de5801 100644 --- a/protocol/x/perpetuals/module_test.go +++ b/protocol/x/perpetuals/module_test.go @@ -320,7 +320,6 @@ func TestAppModule_InitExportGenesis(t *testing.T) { "name":"Large-Cap", "initial_margin_ppm":50000, "maintenance_fraction_ppm":500000, - "base_position_notional":1000000000, "impact_notional":10000000000 } ], @@ -362,7 +361,7 @@ func TestAppModule_InitExportGenesis(t *testing.T) { "name":"Large-Cap", "initial_margin_ppm":50000, "maintenance_fraction_ppm":500000, - "base_position_notional":"1000000000", + "base_position_notional":"0", "impact_notional":"10000000000" } ],