Skip to content

Commit 4ca1540

Browse files
committed
chore: remove constants
1 parent 1528e27 commit 4ca1540

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ path = "bin/submit_transaction.rs"
2525
init4-bin-base = "0.3"
2626

2727
signet-zenith = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
28+
signet-constants = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
2829
signet-types = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
2930
signet-bundle = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
3031
signet-sim = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }

src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
#![deny(unused_must_use, rust_2018_idioms)]
1313
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
1414

15-
/// Constants for the Builder.
16-
pub mod constants;
17-
1815
/// Configuration for the Builder binary.
1916
pub mod config;
2017

src/tasks/block.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! and turns them into valid Pecorino blocks for network submission.
44
use crate::{
55
config::{BuilderConfig, RuProvider},
6-
constants::{BASEFEE_DEFAULT, PECORINO_CHAIN_ID},
76
tasks::bundler::Bundle,
87
};
98
use alloy::{
@@ -347,7 +346,7 @@ impl Simulator {
347346
Some(basefee) => basefee,
348347
None => {
349348
warn!("get basefee failed - RPC error likely occurred");
350-
BASEFEE_DEFAULT
349+
todo!()
351350
}
352351
};
353352
debug!(basefee = basefee, "setting basefee");
@@ -433,7 +432,7 @@ impl trevm::Cfg for PecorinoCfg {
433432
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
434433
let CfgEnv { chain_id, spec, .. } = cfg_env;
435434

436-
*chain_id = PECORINO_CHAIN_ID;
435+
*chain_id = signet_constants::pecorino::RU_CHAIN_ID;
437436
*spec = SpecId::default();
438437
}
439438
}

src/test_utils.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
//! Test utilities for testing builder tasks
2-
use crate::{
3-
config::BuilderConfig,
4-
constants::{PECORINO_CHAIN_ID, PECORINO_HOST_CHAIN_ID},
5-
tasks::block::PecorinoBlockEnv,
6-
};
2+
use crate::{config::BuilderConfig, tasks::block::PecorinoBlockEnv};
73
use alloy::{
84
consensus::{SignableTransaction, TxEip1559, TxEnvelope},
95
primitives::{Address, FixedBytes, TxKind, U256},
@@ -25,8 +21,8 @@ use std::{
2521
/// Sets up a block builder with test values
2622
pub fn setup_test_config() -> Result<BuilderConfig> {
2723
let config = BuilderConfig {
28-
host_chain_id: PECORINO_HOST_CHAIN_ID,
29-
ru_chain_id: PECORINO_CHAIN_ID,
24+
host_chain_id: signet_constants::pecorino::HOST_CHAIN_ID,
25+
ru_chain_id: signet_constants::pecorino::RU_CHAIN_ID,
3026
host_rpc_url: "https://host-rpc.pecorino.signet.sh".into(),
3127
ru_rpc_url: "https://rpc.pecorino.signet.sh".into(),
3228
tx_broadcast_urls: vec!["http://localhost:9000".into()],
@@ -64,7 +60,7 @@ pub fn new_signed_tx(
6460
mpfpg: u128,
6561
) -> Result<TxEnvelope> {
6662
let tx = TxEip1559 {
67-
chain_id: PECORINO_CHAIN_ID,
63+
chain_id: signet_constants::pecorino::RU_CHAIN_ID,
6864
nonce,
6965
max_fee_per_gas: 50_000,
7066
max_priority_fee_per_gas: mpfpg,

tests/block_builder_test.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ mod tests {
99
signers::local::PrivateKeySigner,
1010
};
1111
use builder::{
12-
constants::PECORINO_CHAIN_ID,
1312
tasks::block::Simulator,
1413
test_utils::{new_signed_tx, setup_logging, setup_test_config, test_block_env},
1514
};
@@ -37,7 +36,9 @@ mod tests {
3736
let constants = SignetSystemConstants::pecorino();
3837

3938
// Create an anvil instance for testing
40-
let anvil_instance = Anvil::new().chain_id(PECORINO_CHAIN_ID).spawn();
39+
let anvil_instance = Anvil::new().chain_id(
40+
signet_constants::pecorino::RU_CHAIN_ID,
41+
).spawn();
4142

4243
// Create a wallet
4344
let keys = anvil_instance.keys();
@@ -94,7 +95,7 @@ mod tests {
9495
let constants = SignetSystemConstants::pecorino();
9596

9697
// Create an anvil instance for testing
97-
let anvil_instance = Anvil::new().chain_id(PECORINO_CHAIN_ID).spawn();
98+
let anvil_instance = Anvil::new().chain_id(signet_constants::pecorino::RU_CHAIN_ID).spawn();
9899

99100
// Create a wallet
100101
let keys = anvil_instance.keys();

0 commit comments

Comments
 (0)