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
6 changes: 3 additions & 3 deletions crates/composable-cow/src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ pub enum Verdict {
/// orderbook prepends `from` before settlement).
signature: Bytes,
/// Advisory Unix timestamp (seconds) the fork's generator hints
/// the next poll at. `0` when synthetic - the legacy adapter
/// has no such hint, so the submit path ignores it.
next_poll_timestamp: u64,
/// the next poll at. `None` when synthetic - the legacy adapter
/// has no such hint.
next_poll_timestamp: Option<u64>,
},
/// Retry once the wall clock (Unix seconds, UTC) reaches
/// `wait_until`.
Expand Down
2 changes: 1 addition & 1 deletion crates/composable-cow/tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn ready_outcome(order: &GPv2OrderData) -> Verdict {
Verdict::Post {
order: Box::new(order.clone()),
signature: hex!("c0ffeec0ffeec0ffee").to_vec().into(),
next_poll_timestamp: 0,
next_poll_timestamp: None,
}
}

Expand Down
7 changes: 3 additions & 4 deletions modules/twap-monitor/src/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,13 @@ fn poll_one<H: ChainHost>(
/// `Post { order, signature, .. }`. The wire format is the canonical
/// Solidity return tuple `abi.encode(order, signature)`, so the
/// two-tuple parameter decode lines up. The deployed 1.x contract
/// carries no next-poll hint, so `next_poll_timestamp` is synthetic
/// (`0`).
/// carries no next-poll hint, so `next_poll_timestamp` is `None`.
fn decode_return(data: &[u8]) -> Option<Verdict> {
let (order, signature) = <(GPv2OrderData, Bytes)>::abi_decode_params(data).ok()?;
Some(Verdict::Post {
order: Box::new(order),
signature,
next_poll_timestamp: 0,
next_poll_timestamp: None,
})
}

Expand Down Expand Up @@ -569,7 +568,7 @@ mod tests {
assert_eq!(o.sellToken, order.sellToken);
assert_eq!(o.buyAmount, order.buyAmount);
assert_eq!(s, sig);
assert_eq!(next_poll_timestamp, 0, "legacy path carries no hint");
assert_eq!(next_poll_timestamp, None, "legacy path carries no hint");
}
other => panic!("expected Post, got {other:?}"),
}
Expand Down
Loading