Skip to content

Commit 5926a2c

Browse files
committed
feat: reduce required configuration fns for SignedFills
1 parent a57a150 commit 5926a2c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.14.0"
6+
version = "0.14.1"
77
edition = "2021"
88
rust-version = "1.85"
99
authors = ["init4"]

crates/types/src/signing/fill.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ impl From<&SignedFill> for FillPermit2 {
117117
/// or [`AggregateOrders`] into a [`SignedFill`] with correct permit2 semantics.
118118
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
119119
pub struct UnsignedFill<'a> {
120-
/// The rollup chain id from which the Orders originated.
120+
/// The rollup chain id from which the Orders originated
121+
/// to which the Fill will be credited.
121122
ru_chain_id: Option<u64>,
122123
/// The set of Orders to fill. Multiple Orders can be aggregated into a single Fill,
123124
/// but they MUST all originate on the same rollup chain indicated by `ru_chain_id`.
@@ -215,18 +216,18 @@ impl<'a> UnsignedFill<'a> {
215216
}
216217

217218
/// Add the rollup chain id to the UnsignedFill.
218-
/// This is the rollup chain id from which the Orders originated,
219-
/// to which the Fill should be credited.
220-
/// MUST call this before signing, cannot be inferred.
219+
#[deprecated(since = "0.14.1", note = "Use `with_chain` instead.")]
221220
pub fn with_ru_chain_id(self, ru_chain_id: u64) -> Self {
222221
Self { ru_chain_id: Some(ru_chain_id), ..self }
223222
}
224223

225-
/// Add the chain id and Order contract address to the UnsignedFill.
224+
/// Add the chain ids and Orders contract addresses
225+
/// used for signing the Fill.
226+
/// MUST call before `sign` or `sign_for`.
226227
pub fn with_chain(mut self, constants: SignetSystemConstants) -> Self {
227228
self.target_chains.insert(constants.ru_chain_id(), constants.ru_orders());
228229
self.target_chains.insert(constants.host_chain_id(), constants.host_orders());
229-
self
230+
Self { ru_chain_id: Some(constants.ru_chain_id()), ..self }
230231
}
231232

232233
/// Sign the UnsignedFill, generating a SignedFill for each target chain.

crates/types/src/signing/order.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ impl<'a> UnsignedOrder<'a> {
192192
}
193193

194194
/// Add the chain id and Order contract address to the UnsignedOrder.
195+
/// MUST call before `sign`.
195196
pub fn with_chain(self, constants: &SignetSystemConstants) -> Self {
196197
Self {
197198
rollup_chain_id: Some(constants.ru_chain_id()),

0 commit comments

Comments
 (0)