Skip to content

Commit a3ff46d

Browse files
authored
fix: use with_chain, improve logging (#22)
* fix: add with_chain * fix: misleading log * fix: stale comment * feat: log RU transaction hashes for easier tracking
1 parent 9aa2f20 commit a3ff46d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

bin/roundtrip.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async fn main() -> eyre::Result<()> {
4040
let provider = connect_provider(signer.clone(), config.ru_rpc_url.clone()).await?;
4141
info!(signer_address = %signer.address(), "Connected to Signer and Provider");
4242

43-
// create an example order swapping 1 rollup USDC for 1 host USDC
43+
// create an example order
4444
let example_order = get_example_order(&config, signer.address(), args.rollup);
4545

4646
// sign & send the order to the transaction cache
@@ -53,7 +53,7 @@ async fn main() -> eyre::Result<()> {
5353

5454
// fill the order from the transaction cache
5555
fill_orders(&signed, signer, provider, config).await?;
56-
info!("Order filled successfully");
56+
info!("Bundle sent to tx cache successfully; wait for bundle to mine.");
5757

5858
Ok(())
5959
}
@@ -101,7 +101,10 @@ async fn send_order(
101101
let send_order = SendOrder::new(signer.clone(), config.constants.clone())?;
102102

103103
// sign the order, return it back for comparison
104-
let signed = order.sign(signer).await?;
104+
let signed = order
105+
.with_chain(config.constants.system())
106+
.sign(signer)
107+
.await?;
105108

106109
// send the signed order to the transaction cache
107110
send_order.send_order(signed.clone()).await?;

bin/submit_order.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ async fn send_order(
103103
let send_order = SendOrder::new(signer.clone(), config.constants.clone())?;
104104

105105
// sign the order, return it back for comparison
106-
let signed = order.sign(signer).await?;
106+
let signed = order
107+
.with_chain(config.constants.system())
108+
.sign(signer)
109+
.await?;
107110

108111
tracing::Span::current().record("signed_order_signature", signed.order_hash().to_string());
109112
debug!(?signed, "Signed order contents");
@@ -139,7 +142,7 @@ async fn fill_orders(
139142
// fill each individually
140143
filler.fill_individually(orders.as_slice()).await?;
141144

142-
info!("Order filled successfully");
145+
info!("Bundle sent to tx cache successfully; wait for bundle to mine.");
143146

144147
Ok(())
145148
}

src/filler.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ where
283283

284284
// encode it
285285
let encoded = filled.encoded_2718();
286+
info!(
287+
tx_hash = filled.hash().to_string(),
288+
"Rollup transaction signed and encoded"
289+
);
286290

287291
// add to array
288292
encoded_txs.push(Bytes::from(encoded));

0 commit comments

Comments
 (0)