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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.14.0"
version = "0.14.1"
edition = "2021"
rust-version = "1.85"
authors = ["init4"]
Expand Down
3 changes: 2 additions & 1 deletion crates/types/src/signing/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ pub enum SigningError {
MissingChainId,
/// Missing rollup chain id for a Fill.
#[error(
"Rollup chain id is missing. Populate it by calling with_ru_chain_id before attempting to sign"
"Rollup chain id is missing. Populate it by calling with_chain before attempting to sign"
)]
#[deprecated(since = "0.14.1", note = "Use MissingChainId instead.")]
MissingRollupChainId,
/// Missing chain config for a specific chain.
#[error("Target Order contract address is missing for chain id {0}. Populate it by calling with_chain before attempting to sign")]
Expand Down
15 changes: 8 additions & 7 deletions crates/types/src/signing/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ impl From<&SignedFill> for FillPermit2 {
/// or [`AggregateOrders`] into a [`SignedFill`] with correct permit2 semantics.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct UnsignedFill<'a> {
/// The rollup chain id from which the Orders originated.
/// The rollup chain id from which the Orders originated
/// to which the Fill will be credited.
ru_chain_id: Option<u64>,
/// The set of Orders to fill. Multiple Orders can be aggregated into a single Fill,
/// but they MUST all originate on the same rollup chain indicated by `ru_chain_id`.
Expand Down Expand Up @@ -215,18 +216,18 @@ impl<'a> UnsignedFill<'a> {
}

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

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

/// Sign the UnsignedFill, generating a SignedFill for each target chain.
Expand Down Expand Up @@ -270,7 +271,7 @@ impl<'a> UnsignedFill<'a> {
.ok_or(SigningError::MissingOrderContract(target_chain_id))?;

// get the rollup chain id, or throw an error if not set
let ru_chain_id = self.ru_chain_id.ok_or(SigningError::MissingRollupChainId)?;
let ru_chain_id = self.ru_chain_id.ok_or(SigningError::MissingChainId)?;

// get the outputs for the target chain from the AggregateOrders
let outputs = self.orders.outputs_for(target_chain_id, ru_chain_id);
Expand Down
1 change: 1 addition & 0 deletions crates/types/src/signing/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ impl<'a> UnsignedOrder<'a> {
}

/// Add the chain id and Order contract address to the UnsignedOrder.
/// MUST call before `sign`.
pub fn with_chain(self, constants: &SignetSystemConstants) -> Self {
Self {
rollup_chain_id: Some(constants.ru_chain_id()),
Expand Down
Loading