Skip to content

Commit f02246f

Browse files
authored
Fix scaling of objective in combinatorial auction test (#87)
1 parent bcde774 commit f02246f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/monitoring_tests/combinatorial_auction_surplus_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ def get_token_pairs_surplus(
163163
if len(surplus_dict) == 1:
164164
for token_pair in surplus_dict:
165165
surplus_dict[token_pair] = min(
166-
surplus_dict[token_pair], solution["objective"]["total"]
166+
surplus_dict[token_pair],
167+
Fraction(solution["objective"]["total"]) / 10**18,
167168
)
168169

169170
return surplus_dict

tests/e2e/combinatorial_auction_surplus_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def test_surplus(self) -> None:
2525
# tx_hash = "0xe28b92ba73632d6b167fdb9bbfec10744ce208536901dd43379a6778c4408536"
2626
# tx_hash = "0xad0ede9fd68481b8ef4722d069598898e01d61427ccb378ca4c82c772c6644e0"
2727
# tx_hash = "0xead8f01e8e24fdc306fca8fcac5146edc22c27e49a7aad6134adc2ad50ba8581"
28-
tx_hash = "0x6200e744e5d6f9990271be53840c01044cc19f3a8526190e1eaac0bc5fefed85"
28+
# tx_hash = "0x6200e744e5d6f9990271be53840c01044cc19f3a8526190e1eaac0bc5fefed85"
29+
# uncovered bug with wrong scaling of objective
30+
tx_hash = "0x97b2f8402d239e16b62b7cc2302ed77ac8fa40d63114ab6804041c9d3b9e6b81"
2931
self.assertTrue(surplus_test.run(tx_hash))
3032

3133

0 commit comments

Comments
 (0)