-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into configuration_subgraph
- Loading branch information
Showing
12 changed files
with
99 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
use crate::{ | ||
domain::competition::order, | ||
tests::{ | ||
self, | ||
setup::{ab_order, ab_pool, ab_solution}, | ||
}, | ||
}; | ||
|
||
#[tokio::test] | ||
#[ignore] | ||
async fn rejects_unwarranted_solver_fee() { | ||
let test = tests::setup() | ||
.name("Solver fee on market order".to_string()) | ||
.pool(ab_pool()) | ||
.order( | ||
// A solver reporting a fee on a swap order | ||
ab_order() | ||
.user_fee(1000.into()) | ||
.solver_fee(Some(500.into())), | ||
) | ||
.solution(ab_solution()) | ||
.done() | ||
.await; | ||
|
||
test.solve().await.status(hyper::StatusCode::BAD_REQUEST); | ||
} | ||
|
||
#[tokio::test] | ||
#[ignore] | ||
async fn solver_fee() { | ||
for side in [order::Side::Buy, order::Side::Sell] { | ||
let test = tests::setup() | ||
.name(format!("Solver Fee: {side:?}")) | ||
.pool(ab_pool()) | ||
.order( | ||
ab_order() | ||
.kind(order::Kind::Limit) | ||
.side(side) | ||
.solver_fee(Some(500.into())), | ||
) | ||
.solution(ab_solution()) | ||
.done() | ||
.await; | ||
|
||
test.solve().await.ok().orders(&[ab_order().name]); | ||
} | ||
} | ||
|
||
#[tokio::test] | ||
#[ignore] | ||
async fn user_fee() { | ||
for side in [order::Side::Buy, order::Side::Sell] { | ||
let test = tests::setup() | ||
.name(format!("User Fee: {side:?}")) | ||
.pool(ab_pool()) | ||
.order(ab_order().side(side).user_fee(1000.into())) | ||
.solution(ab_solution()) | ||
.done() | ||
.await; | ||
|
||
test.solve().await.ok().orders(&[ab_order().name]); | ||
} | ||
} |
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
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