-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simulate Balances with PreInteractions In Driver (#1894)
This PR adds balance simulation to the driver. This enables the `driver` to continue to work with orders that require pre-interactions for setting up balances (such as EthFlow). In addition - the pesky EthFlow exception was removed from the `driver` crate entirely 🎉! In fact, the `driver` no longer cares at all about the EthFlow contract address. ### Test Plan Added E2E test to verify that EthFlow orders are still executed. They use pre-interactions to ensure the balance is available, so we check that our new simulation logic actually works! Existing hooks E2E test continues to pass. <details><summary>You can also apply this patch to make the test fail:</summary> ```diff diff --git a/crates/driver/src/domain/competition/auction.rs b/crates/driver/src/domain/competition/auction.rs index 144b0562..4377d46e 100644 --- a/crates/driver/src/domain/competition/auction.rs +++ b/crates/driver/src/domain/competition/auction.rs @@ -119,10 +119,10 @@ impl Auction { .collect::<Vec<_>>(); let mut balances = join_all(traders.into_iter().map( - |(trader, token, source, interactions)| async move { + |(trader, token, source, _interactions)| async move { let balance = eth .erc20(token) - .tradable_balance(trader.into(), source, interactions) + .balance(trader.into()) .await; ((trader, token, source), balance) }, ``` </details>
- Loading branch information
Nicholas Rodrigues Lordello
authored
Sep 27, 2023
1 parent
7cbd3d0
commit 6fef562
Showing
18 changed files
with
598 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.