Skip to content
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

OpenAPI: Add surplusCapturingJitOrderOwners to the aucction payload #28

Merged
merged 3 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contracts = { git = "https://github.com/cowprotocol/services.git", tag = "v2.258
ethrpc = { git = "https://github.com/cowprotocol/services.git", tag = "v2.258.0", package = "ethrpc" }
observe = { git = "https://github.com/cowprotocol/services.git", tag = "v2.258.0", package = "observe" }
shared = { git = "https://github.com/cowprotocol/services.git", tag = "v2.258.0", package = "shared" }
dto = { git = "https://github.com/cowprotocol/services.git", tag = "v2.258.1-temp-solvers-dto", package = "solvers-dto" }
dto = { git = "https://github.com/cowprotocol/services.git", tag = "v2.260.0-jit-order-owners", package = "solvers-dto" }
rate-limit = { git = "https://github.com/cowprotocol/services.git", tag = "v2.258.0", package = "rate-limit" }

[dev-dependencies]
Expand Down
6 changes: 6 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ components:
by the caller.
allOf:
- $ref: "#/components/schemas/DateTime"
surplusCapturingJitOrderOwners:
type: array
items:
$ref: "#/components/schemas/Address"
description: |
List of addresses on whose surplus will count towards the objective value of their solution (unlike other orders that were created by the solver).

JitOrder:
description: |
Expand Down
6 changes: 4 additions & 2 deletions src/tests/balancer/market_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ async fn sell() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -259,7 +260,8 @@ async fn buy() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/tests/balancer/not_found.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async fn test() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
6 changes: 4 additions & 2 deletions src/tests/balancer/out_of_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ async fn sell() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -196,7 +197,8 @@ async fn buy() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
15 changes: 10 additions & 5 deletions src/tests/dex/partial_fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ endpoint = 'http://{}/sor'
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
});

let empty_solution = json!({
Expand Down Expand Up @@ -403,7 +404,8 @@ async fn tested_amounts_wrap_around() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
});

for _ in 0..4 {
Expand Down Expand Up @@ -566,7 +568,8 @@ endpoint = 'http://{}/sor'
],
"liquidity": [],
"effectiveGasPrice": "6000000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
});

// The first try doesn't match.
Expand Down Expand Up @@ -752,7 +755,8 @@ async fn insufficient_room_for_surplus_fee() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -864,7 +868,8 @@ async fn market() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
3 changes: 2 additions & 1 deletion src/tests/dex/wrong_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ async fn test() {
],
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z"
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/tests/oneinch/market_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async fn sell() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -319,6 +320,7 @@ async fn buy_not_supported() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/tests/oneinch/not_found.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async fn test() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/tests/oneinch/out_of_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ async fn sell() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/tests/paraswap/market_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ async fn sell() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -462,6 +463,7 @@ async fn buy() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/tests/paraswap/not_found.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async fn test() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/tests/paraswap/out_of_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ async fn sell() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -421,6 +422,7 @@ async fn buy() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/tests/zeroex/market_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ async fn sell() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -329,6 +330,7 @@ async fn buy() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/tests/zeroex/not_found.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ async fn test() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/tests/zeroex/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ enable-slippage-protection = true
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/tests/zeroex/out_of_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async fn sell() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down Expand Up @@ -259,6 +260,7 @@ async fn buy() {
"liquidity": [],
"effectiveGasPrice": "15000000000",
"deadline": "2106-01-01T00:00:00.000Z",
"surplusCapturingJitOrderOwners": []
}))
.await
.unwrap();
Expand Down
Loading