Skip to content

Commit

Permalink
Fix scaling of objective in combinatorial auction test (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhenneke authored Nov 13, 2023
1 parent bcde774 commit f02246f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/monitoring_tests/combinatorial_auction_surplus_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def get_token_pairs_surplus(
if len(surplus_dict) == 1:
for token_pair in surplus_dict:
surplus_dict[token_pair] = min(
surplus_dict[token_pair], solution["objective"]["total"]
surplus_dict[token_pair],
Fraction(solution["objective"]["total"]) / 10**18,
)

return surplus_dict
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/combinatorial_auction_surplus_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def test_surplus(self) -> None:
# tx_hash = "0xe28b92ba73632d6b167fdb9bbfec10744ce208536901dd43379a6778c4408536"
# tx_hash = "0xad0ede9fd68481b8ef4722d069598898e01d61427ccb378ca4c82c772c6644e0"
# tx_hash = "0xead8f01e8e24fdc306fca8fcac5146edc22c27e49a7aad6134adc2ad50ba8581"
tx_hash = "0x6200e744e5d6f9990271be53840c01044cc19f3a8526190e1eaac0bc5fefed85"
# tx_hash = "0x6200e744e5d6f9990271be53840c01044cc19f3a8526190e1eaac0bc5fefed85"
# uncovered bug with wrong scaling of objective
tx_hash = "0x97b2f8402d239e16b62b7cc2302ed77ac8fa40d63114ab6804041c9d3b9e6b81"
self.assertTrue(surplus_test.run(tx_hash))


Expand Down

0 comments on commit f02246f

Please sign in to comment.