Skip to content

Commit fbf0bd9

Browse files
committed
fmt + test fix
1 parent 98306f9 commit fbf0bd9

File tree

14 files changed

+31
-26
lines changed

14 files changed

+31
-26
lines changed

crates/op-rbuilder/src/integration/op_rbuilder.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ impl Service for OpRbuilderConfig {
122122
if let Some(http_port) = self.http_port {
123123
cmd.arg("--http")
124124
.arg("--http.port")
125-
.arg(http_port.to_string());
125+
.arg(http_port.to_string())
126+
.arg("--http.api")
127+
.arg("txpool,eth,debug,admin");
126128
}
127129

128130
if let Some(flashblocks_ws_url) = &self.flashblocks_ws_url {

crates/rbuilder/benches/benchmarks/txpool_fetcher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async fn txpool_receive_util(count: u32) {
3232

3333
let provider = ProviderBuilder::new()
3434
.wallet(wallet)
35-
.on_http(anvil.endpoint().parse().unwrap());
35+
.connect_http(anvil.endpoint().parse().unwrap());
3636

3737
let alice = anvil.addresses()[0];
3838
let eip1559_est = provider.estimate_eip1559_fees().await.unwrap();

crates/rbuilder/src/building/block_orders/prioritized_order_store.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ use super::{OrderPriority, SimulatedOrderSink};
1616
/// Order must implement BlockOrdersOrder which has priority(). This priority is used to sort the simulated orders.
1717
/// Usage:
1818
/// - Add new order (a little bit complex):
19-
/// ALWAYS BE SURE THAT YOU CALLED update_onchain_nonces and updated the current state of all the needed nonces by the order
20-
/// call insert_order
19+
/// ALWAYS BE SURE THAT YOU CALLED update_onchain_nonces and updated the current state of all the needed nonces by the order
20+
/// call insert_order
2121
/// - Get best order to execute
22-
/// call pop_order to get the best order
23-
/// if the order is executed call update_onchain_nonces to update all the changed nonces.
22+
/// call pop_order to get the best order
23+
/// if the order is executed call update_onchain_nonces to update all the changed nonces.
2424
/// - Remove orders: remove_orders. This is useful if we think this orders are no really good (failed to execute to often)
2525
#[derive(Debug, Clone)]
2626
pub struct PrioritizedOrderStore<OrderPriorityType> {

crates/rbuilder/src/building/builders/block_building_helper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub trait BlockBuildingHelper: Send + Sync {
5959

6060
/// Eats the BlockBuildingHelper since once it's finished you should not use it anymore.
6161
/// payout_tx_value: If Some, added at the end of the block from coinbase to the final fee recipient.
62-
/// This only works if can_add_payout_tx.
62+
/// This only works if can_add_payout_tx.
6363
fn finalize_block(
6464
self: Box<Self>,
6565
local_ctx: &mut ThreadBlockBuildingContext,

crates/rbuilder/src/building/builders/ordering_builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl OrderingBuilderContext {
222222
}
223223

224224
/// use_suggested_fee_recipient_as_coinbase: all the mev profit goes directly to the slot suggested_fee_recipient so we avoid the payout tx.
225-
/// This mode disables mev-share orders since the builder has to receive the mev profit to give some portion back to the mev-share user.
225+
/// This mode disables mev-share orders since the builder has to receive the mev profit to give some portion back to the mev-share user.
226226
/// !use_suggested_fee_recipient_as_coinbase: all the mev profit goes to the builder and at the end of the block we pay to the suggested_fee_recipient.
227227
pub fn build_block<OrderPriorityType: OrderPriority>(
228228
&mut self,

crates/rbuilder/src/building/builders/parallel_builder/conflict_resolvers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ mod tests {
491491
..Default::default()
492492
};
493493
Recovered::new_unchecked(
494-
TransactionSigned::new(
494+
TransactionSigned::new_unchecked(
495495
Transaction::Legacy(tx_legacy),
496496
alloy_primitives::Signature::test_signature(),
497497
self.create_hash(),

crates/rbuilder/src/building/builders/parallel_builder/conflict_task_generator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ mod tests {
437437

438438
pub fn create_tx(&mut self) -> Recovered<TransactionSigned> {
439439
Recovered::new_unchecked(
440-
TransactionSigned::new(
440+
TransactionSigned::new_unchecked(
441441
Transaction::Legacy(TxLegacy::default()),
442442
alloy_primitives::Signature::test_signature(),
443443
self.create_hash(),

crates/rbuilder/src/building/builders/parallel_builder/groups.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ mod tests {
428428

429429
pub fn create_tx(&mut self) -> Recovered<TransactionSigned> {
430430
Recovered::new_unchecked(
431-
TransactionSigned::new(
431+
TransactionSigned::new_unchecked(
432432
Transaction::Legacy(TxLegacy::default()),
433433
alloy_primitives::Signature::test_signature(),
434434
self.create_hash(),

crates/rbuilder/src/building/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ impl<Tracer: SimulationTracer> PartialBlock<Tracer> {
536536
}
537537

538538
/// result_filter: little hack to allow "cancel" the execution depending no the SimValue result. Ideally it would be nicer to split commit_order
539-
/// in 2 parts, one that executes but does not apply (returns state changes) and then another one that applies the changes.
540-
/// You can always pass &|_| Ok(()) if you don't need the filter.
539+
/// in 2 parts, one that executes but does not apply (returns state changes) and then another one that applies the changes.
540+
/// You can always pass &|_| Ok(()) if you don't need the filter.
541541
pub fn commit_order(
542542
&mut self,
543543
order: &SimulatedOrder,

crates/rbuilder/src/integration/simple.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ mod tests {
1919
to: Option<alloy_primitives::Address>,
2020
) -> eyre::Result<alloy_primitives::TxHash> {
2121
let rbuilder_provider =
22-
ProviderBuilder::new().on_http(Url::parse(srv.rbuilder_rpc_url()).unwrap());
22+
ProviderBuilder::new().connect_http(Url::parse(srv.rbuilder_rpc_url()).unwrap());
2323

2424
let provider = ProviderBuilder::new()
2525
.wallet(private_key)
26-
.on_http(Url::parse(srv.el_url()).unwrap());
26+
.connect_http(Url::parse(srv.el_url()).unwrap());
2727

2828
let gas_price = provider.get_gas_price().await?;
2929

@@ -59,7 +59,7 @@ mod tests {
5959
.unwrap();
6060

6161
// Wait for receipt
62-
let binding = ProviderBuilder::new().on_http(Url::parse(srv.el_url()).unwrap());
62+
let binding = ProviderBuilder::new().connect_http(Url::parse(srv.el_url()).unwrap());
6363
let pending_tx = PendingTransactionBuilder::new(binding.root().clone(), tx_hash)
6464
.with_timeout(Some(std::time::Duration::from_secs(60)));
6565

crates/rbuilder/src/live_builder/order_input/txpool_fetcher.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ pub async fn subscribe_to_txpool_with_blobs(
3131
let provider = match mempool {
3232
MempoolSource::Ipc(path) => {
3333
let ipc = IpcConnect::new(path);
34-
ProviderBuilder::new().on_ipc(ipc).await?
34+
ProviderBuilder::new().connect_ipc(ipc).await?
3535
}
3636
MempoolSource::Ws(url) => {
3737
let ws_conn = alloy_provider::WsConnect::new(url);
38-
ProviderBuilder::new().on_ws(ws_conn).await?
38+
ProviderBuilder::new().connect_ws(ws_conn).await?
3939
}
4040
};
4141

@@ -150,7 +150,7 @@ mod test {
150150

151151
let provider = ProviderBuilder::new()
152152
.wallet(wallet)
153-
.on_http(anvil.endpoint().parse().unwrap());
153+
.connect_http(anvil.endpoint().parse().unwrap());
154154

155155
let alice = anvil.addresses()[0];
156156

crates/rbuilder/src/primitives/mod.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,10 @@ impl TransactionSignedEcRecoveredWithBlobs {
702702
metadata: Option<Metadata>,
703703
) -> Result<Self, TxWithBlobsCreateError> {
704704
// Check for an eip4844 tx passed without blobs
705-
if tx.transaction().blob_versioned_hashes().is_some() && blob_sidecar.is_none() {
705+
if tx.inner().blob_versioned_hashes().is_some() && blob_sidecar.is_none() {
706706
Err(TxWithBlobsCreateError::Eip4844MissingBlobSidecar)
707707
// Check for a non-eip4844 tx passed with blobs
708-
} else if blob_sidecar.is_some() && tx.transaction().blob_versioned_hashes().is_none() {
708+
} else if blob_sidecar.is_some() && tx.inner().blob_versioned_hashes().is_none() {
709709
Err(TxWithBlobsCreateError::BlobsMissingEip4844)
710710
// Groovy!
711711
} else {
@@ -812,8 +812,11 @@ impl TransactionSignedEcRecoveredWithBlobs {
812812
PooledTransaction::Eip4844(blob_tx) => {
813813
let (blob_tx, signature, hash) = blob_tx.into_parts();
814814
let (blob_tx, sidecar) = blob_tx.into_parts();
815-
let tx_signed =
816-
TransactionSigned::new(Transaction::Eip4844(blob_tx), signature, hash);
815+
let tx_signed = TransactionSigned::new_unchecked(
816+
Transaction::Eip4844(blob_tx),
817+
signature,
818+
hash,
819+
);
817820
Ok(TransactionSignedEcRecoveredWithBlobs {
818821
tx: tx_signed.with_signer(signer),
819822
blobs_sidecar: Arc::new(sidecar),
@@ -1239,7 +1242,7 @@ mod tests {
12391242
fn can_execute_single_optional_tx() {
12401243
let needed_base_gas: u128 = 100000;
12411244
let tx = Recovered::new_unchecked(
1242-
TransactionSigned::new(
1245+
TransactionSigned::new_unchecked(
12431246
Transaction::Legacy(TxLegacy {
12441247
gas_price: needed_base_gas,
12451248
..Default::default()

crates/rbuilder/src/primitives/test_data_generator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl TestDataGenerator {
2222

2323
pub fn create_tx_nonce(&mut self, sender_nonce: AccountNonce) -> Recovered<TransactionSigned> {
2424
Recovered::new_unchecked(
25-
TransactionSigned::new(
25+
TransactionSigned::new_unchecked(
2626
Transaction::Legacy(TxLegacy {
2727
nonce: sender_nonce.nonce,
2828
..TxLegacy::default()

crates/rbuilder/src/utils/test_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn i256(i: i64) -> I256 {
2424

2525
pub fn tx(tx_hash: u64) -> TransactionSignedEcRecoveredWithBlobs {
2626
TransactionSignedEcRecoveredWithBlobs::new_for_testing(Recovered::new_unchecked(
27-
TransactionSigned::new(
27+
TransactionSigned::new_unchecked(
2828
Transaction::Legacy(Default::default()),
2929
Signature::test_signature(),
3030
hash(tx_hash),

0 commit comments

Comments
 (0)