Add test for front heavy sandwiches

This commit is contained in:
Gui Heise 2022-08-04 11:00:09 -04:00
parent 27199ac65b
commit 458ad7f7f5
2 changed files with 18 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -23,3 +23,20 @@ def test_back_heavy_sandwich_profits(trace_classifier: TraceClassifier):
if observed_sandwich.sandwicher_address == expected_sandwicher:
assert expected_token_address == observed_sandwich.profit_token_address
assert expected_profit_amount == observed_sandwich.profit_amount
def test_front_heavy_sandwich_profits(trace_classifier: TraceClassifier):
block_number = 14659109
expected_sandwicher = "0x01ff6318440f7d5553a82294d78262d5f5084eff"
expected_token_address = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
expected_profit_amount = -180511102573164864
block = load_test_block(block_number)
classified_traces = trace_classifier.classify(block.traces)
swaps: List[Swap] = get_swaps(classified_traces)
result: List[Sandwich] = get_sandwiches(swaps)
for observed_sandwich in result:
if observed_sandwich.sandwicher_address == expected_sandwicher:
assert expected_token_address == observed_sandwich.profit_token_address
assert expected_profit_amount == observed_sandwich.profit_amount