Skip to content
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
42 changes: 18 additions & 24 deletions Cargo.lock

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

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ alloy-chains = { version = "0.2", default-features = false, features = ["std", "
# hoisting). The engine takes `http-client` for `OrderBookApi`;
# guest-side consumers (SDK, strategies) express their own
# `default-features = false` builds for the `cdylib` wasm target.
cowprotocol = { version = "0.1.0", default-features = false, features = ["http-client"] }
cowprotocol = { version = "0.2.0", default-features = false, features = ["http-client"] }

# HTTP transport for `cow_api::request` REST passthrough and the
# orderbook-mock test surface.
Expand Down Expand Up @@ -183,6 +183,14 @@ unsafe_op_in_unsafe_fn = "warn"
dbg_macro = "deny"
todo = "deny"

# `cowprotocol` 0.2.0 (the `OrderCreationAppData` hash-only submission
# shape plus the WASI clock fix that keeps `js_sys` out of non-browser
# wasm builds) is not published yet; the latest crates.io release is
# 0.2.0-alpha.1 without either. Patch to the cow-rs rev carrying both.
# Drop once a cowprotocol release with the hash-only constructor ships.
[patch.crates-io]
cowprotocol = { git = "https://github.com/nullislabs/cow-rs", rev = "17fc0c5f55d04fad38963911da07d5da9290fefb" }

[profile.dev]
panic = "abort"

Expand Down
2 changes: 1 addition & 1 deletion crates/shepherd-cow-host/src/cow_orderbook/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fn sample_order_json() -> String {
buy_token_balance: BuyTokenDestination::Erc20,
};
let signature = Signature::from_bytes(SigningScheme::PreSign, &[]).expect("presign empty");
let creation = OrderCreation::from_signed_order_data(
let creation = OrderCreation::new(
&order_data,
signature,
Address::from([0x03; 20]),
Expand Down
3 changes: 1 addition & 2 deletions crates/shepherd-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ description = "CoW-domain guest SDK for Shepherd modules: cow-api host trait, or

[dependencies]
nexum-sdk = { path = "../nexum-sdk" }
cowprotocol = { version = "0.1.0", default-features = false }
cowprotocol = { version = "0.2.0", default-features = false }
alloy-primitives.workspace = true
alloy-sol-types.workspace = true
serde_json.workspace = true
strum.workspace = true
thiserror.workspace = true

Expand Down
4 changes: 1 addition & 3 deletions crates/shepherd-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use shepherd_sdk::cow::{gpv2_to_order_data, classify_api_error, RetryAction};
| `cow::order` | `gpv2_to_order_data` - `GPv2OrderData` -> typed `OrderData`. |
| `cow::composable` | `sol! IConditionalOrder` errors + `PollOutcome` + `decode_revert` + `decode_revert_hex`. |
| `cow::error` | `CowApiError` (mirror of `cow-api-error`: `Fault` / `Http` / `Rejected`) + `RetryAction` enum + `classify_api_error` over an `OrderRejection`. |
| `cow::app_data` | `resolve_app_data` - appData hash -> canonical JSON document. |
| `wit_bindgen_macro` | `bind_cow_host_via_wit_bindgen!` - the generic `WitBindgenHost` adapter plus the `CowApiHost` impl. |

## Testing modules host-free
Expand Down Expand Up @@ -64,8 +63,7 @@ crates/shepherd-sdk/
│ │ ├── mod.rs CowApiHost + CowHost
│ │ ├── order.rs gpv2_to_order_data
│ │ ├── composable.rs IConditionalOrder + PollOutcome + decode_revert(_hex)
│ │ ├── error.rs RetryAction + classify_api_error
│ │ └── app_data.rs resolve_app_data
│ │ └── error.rs RetryAction + classify_api_error
│ └── wit_bindgen_macro.rs bind_cow_host_via_wit_bindgen!
└── README.md you are here

Expand Down
Loading