Skip to content

Commit 213dd6d

Browse files
authored
Fix getting transaction hash from competition data (#123)
This PR changes how transaction hashes are fetched from competition data. To support multiple winners, the competition data format was changed to allow for multiple transactions to be associated to an auction. This meant, that instead of a `"transactionHash"` field containing a string, a `"transactionHashes"` field containing a vector of strings is stored. This PR, changes the code to use the new convention.
1 parent 7677080 commit 213dd6d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/monitoring_tests/combinatorial_auction_surplus_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def run_combinatorial_auction(self, competition_data: dict[str, Any]) -> bool:
8888
log_output = "\t".join(
8989
[
9090
"Combinatorial auction surplus test:",
91-
f"Tx Hash: {competition_data['transactionHash']}",
91+
f"Tx Hash: {competition_data['transactionHashes'][0]}",
9292
f"Winning Solver: {competition_data['solutions'][-1]['solver']}",
9393
f"Winning surplus: {self.convert_fractions_to_floats(aggregate_solutions[-1])}",
9494
f"Baseline surplus: {self.convert_fractions_to_floats(baseline_surplus)}",

src/monitoring_tests/high_score_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def compute_winning_score(self, competition_data: dict[str, Any]) -> bool:
2929
log_output = "\t".join(
3030
[
3131
"Large score test:",
32-
f"Tx Hash: {competition_data['transactionHash']}",
32+
f"Tx Hash: {competition_data['transactionHashes'][0]}",
3333
f"Winning Solver: {solution['solver']}",
3434
f"Score in ETH: {score}",
3535
]

src/monitoring_tests/reference_solver_surplus_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def compare_orders_surplus(
7575
log_output = "\t".join(
7676
[
7777
"Reference solver surplus test:",
78-
f"Tx Hash: {competition_data['transactionHash']}",
78+
f"Tx Hash: {competition_data['transactionHashes'][0]}",
7979
f"Order UID: {uid}",
8080
f"Winning Solver: {solution['solver']}",
8181
"Solver providing more surplus: Reference solver",
@@ -85,7 +85,7 @@ def compare_orders_surplus(
8585
)
8686
ref_solver_log = "\t".join(
8787
[
88-
f"Tx Hash: {competition_data['transactionHash']}",
88+
f"Tx Hash: {competition_data['transactionHashes'][0]}",
8989
f"Order UID: {uid}",
9090
f"Solution providing more surplus: {ref_solver_response}",
9191
]

src/monitoring_tests/solver_competition_surplus_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def compare_orders_surplus(self, competition_data: dict[str, Any]) -> bool:
5858
log_output = "\t".join(
5959
[
6060
"Solver competition surplus test:",
61-
f"Tx Hash: {competition_data['transactionHash']}",
61+
f"Tx Hash: {competition_data['transactionHashes'][0]}",
6262
f"Order UID: {uid}",
6363
f"Winning Solver: {solution['solver']}",
6464
f"Solver providing more surplus: {solver_alt}",

src/monitoring_tests/uniform_directed_prices_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def check_udp(self, competition_data: dict[str, Any]) -> bool:
5555
log_output = "\t".join(
5656
[
5757
"Uniform Directed Prices test:",
58-
f"Tx Hash: {competition_data['transactionHash']}",
58+
f"Tx Hash: {competition_data['transactionHashes'][0]}",
5959
f"Winning Solver: {solution['solver']}",
6060
f"Token pair: {pair}",
6161
f"Directional prices: {[float(p) for p in prices_list]}",

0 commit comments

Comments
 (0)