-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solvers solution pre/post interactions #2679
Changes from 7 commits
8d35d5b
47efc0d
8af1bd1
9832d10
6d53210
35414e3
29fc729
c3e7d75
3ddd0ec
b70f840
3609470
70f99f3
3059327
781fd23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,7 +22,9 @@ pub struct Solution { | |||||
pub id: Id, | ||||||
pub prices: ClearingPrices, | ||||||
pub trades: Vec<Trade>, | ||||||
pub pre_interactions: Vec<InteractionData>, | ||||||
pub interactions: Vec<Interaction>, | ||||||
pub post_interactions: Vec<InteractionData>, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would lead to this:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, you are completely right (I missed that this was a different create). We could still add this type in the eth module of the solvers crate but not super important. |
||||||
pub gas: Option<eth::Gas>, | ||||||
} | ||||||
|
||||||
|
@@ -187,7 +189,9 @@ impl Single { | |||||
(order.buy.token, sell.checked_sub(surplus_fee)?), | ||||||
]), | ||||||
trades: vec![Trade::Fulfillment(Fulfillment::new(order, executed, fee)?)], | ||||||
pre_interactions: Default::default(), | ||||||
interactions, | ||||||
post_interactions: Default::default(), | ||||||
gas: Some(gas), | ||||||
}) | ||||||
} | ||||||
|
@@ -357,6 +361,15 @@ pub struct CustomInteraction { | |||||
pub allowances: Vec<Allowance>, | ||||||
} | ||||||
|
||||||
/// An arbitrary ethereum interaction that is required for the settlement | ||||||
/// execution. | ||||||
#[derive(Debug)] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can maybe reuse this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't get it. To reuse something from the driver crate in what sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are redifining a struct in the domain which already exists in the domain. Now, we might not want to overload structs that happen to have the same fields (generally defining new structs for different semantics is good), but here this is similar to re-defining |
||||||
pub struct InteractionData { | ||||||
pub target: Address, | ||||||
pub value: eth::Ether, | ||||||
pub calldata: Vec<u8>, | ||||||
} | ||||||
|
||||||
/// Approval required to make some `[CustomInteraction]` possible. | ||||||
#[derive(Debug)] | ||||||
pub struct Allowance { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe
to avoid confusion with existing Interaction struct?
It would be nice to reuse this type on the CustomInteraction struct, but it seems like that would be a breaking change 😢