Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 committed Dec 5, 2023
1 parent a3c5a62 commit 28cf227
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions protocol/x/perpetuals/keeper/perpetual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
3 changes: 1 addition & 2 deletions protocol/x/perpetuals/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
],
Expand Down Expand Up @@ -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"
}
],
Expand Down

0 comments on commit 28cf227

Please sign in to comment.