@@ -214,19 +214,12 @@ impl<'a> UnsignedFill<'a> {
214214 Self { deadline : Some ( deadline) , ..self }
215215 }
216216
217- /// 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.
221- pub fn with_ru_chain_id ( self , ru_chain_id : u64 ) -> Self {
222- Self { ru_chain_id : Some ( ru_chain_id) , ..self }
223- }
224-
225217 /// Add the chain id and Order contract address to the UnsignedFill.
226- pub fn with_chain ( mut self , constants : SignetSystemConstants ) -> Self {
218+ /// MUST call before `sign` or `sign_for`.
219+ pub fn with_constants ( mut self , constants : SignetSystemConstants ) -> Self {
227220 self . target_chains . insert ( constants. ru_chain_id ( ) , constants. ru_orders ( ) ) ;
228221 self . target_chains . insert ( constants. host_chain_id ( ) , constants. host_orders ( ) ) ;
229- self
222+ Self { ru_chain_id : Some ( constants . ru_chain_id ( ) ) , .. self }
230223 }
231224
232225 /// Sign the UnsignedFill, generating a SignedFill for each target chain.
@@ -264,13 +257,11 @@ impl<'a> UnsignedFill<'a> {
264257 let deadline = self . deadline . unwrap_or ( now. timestamp ( ) as u64 + 12 ) ;
265258
266259 // get the target order address
267- let target_order_address = self
268- . target_chains
269- . get ( & target_chain_id)
270- . ok_or ( SigningError :: MissingOrderContract ( target_chain_id) ) ?;
260+ let target_order_address =
261+ self . target_chains . get ( & target_chain_id) . ok_or ( SigningError :: MissingConstants ) ?;
271262
272263 // get the rollup chain id, or throw an error if not set
273- let ru_chain_id = self . ru_chain_id . ok_or ( SigningError :: MissingRollupChainId ) ?;
264+ let ru_chain_id = self . ru_chain_id . ok_or ( SigningError :: MissingConstants ) ?;
274265
275266 // get the outputs for the target chain from the AggregateOrders
276267 let outputs = self . orders . outputs_for ( target_chain_id, ru_chain_id) ;
0 commit comments