-
Notifications
You must be signed in to change notification settings - Fork 0
testing: adds a full test harness #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4354ec8
14f9864
ddb81f2
f0ab05b
4300dcf
540fec6
510e9ae
7fa40e5
7cf1320
6587d53
3f62361
078075a
d3b0e1b
207e19e
18ef534
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,15 +14,14 @@ use init4_bin_base::{ | |
| perms::OAuthConfig, | ||
| utils::{calc::SlotCalculator, provider::ProviderConfig}, | ||
| }; | ||
| use signet_constants::SignetSystemConstants; | ||
| use signet_constants::{SignetSystemConstants, pecorino}; | ||
| use std::env; | ||
| use std::str::FromStr; | ||
| use trevm::revm::{context::BlockEnv, context_interface::block::BlobExcessGasAndPrice}; | ||
|
|
||
| /// Sets up a block builder with test values | ||
| pub fn setup_test_config() -> Result<BuilderConfig> { | ||
| let config = BuilderConfig { | ||
| // host_chain_id: signet_constants::pecorino::HOST_CHAIN_ID, | ||
| let pecorino_config = BuilderConfig { | ||
| host_rpc: "ws://host-rpc.pecorino.signet.sh" | ||
| .parse::<BuiltInConnectionString>() | ||
| .map(ProviderConfig::new) | ||
|
|
@@ -32,10 +31,10 @@ pub fn setup_test_config() -> Result<BuilderConfig> { | |
| .unwrap() | ||
| .try_into() | ||
| .unwrap(), | ||
| flashbots_endpoint: Some("https://relay-sepolia.flashbots.net:443".parse().unwrap()), | ||
| flashbots_endpoint: Some("https://host-builder-rpc.pecorino.signet.sh".parse().unwrap()), | ||
| quincey_url: "http://localhost:8080".into(), | ||
| sequencer_key: None, | ||
| builder_key: env::var("SEPOLIA_ETH_PRIV_KEY") | ||
| builder_key: env::var("BUILDER_KEY") | ||
| .unwrap_or_else(|_| B256::repeat_byte(0x42).to_string()), | ||
| builder_port: 8080, | ||
| builder_rewards_address: Address::default(), | ||
|
|
@@ -56,20 +55,21 @@ pub fn setup_test_config() -> Result<BuilderConfig> { | |
| max_host_gas_coefficient: Some(80), | ||
| constants: SignetSystemConstants::pecorino(), | ||
| }; | ||
| Ok(config) | ||
| Ok(pecorino_config) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the test config is not a pecorino config. if we want a pecorino config it should be a separate setupd function
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unit and integration tests should generally NOT be run against pecorino. the test config is for local uni ttesting |
||
| } | ||
|
|
||
| /// Returns a new signed test transaction with the provided nonce, value, and mpfpg. | ||
| pub fn new_signed_tx( | ||
| /// Returns a new signed test transaction with the provided nonce, value, mpfpg, and max fee. | ||
| pub fn new_signed_tx_with_max_fee( | ||
| wallet: &PrivateKeySigner, | ||
| nonce: u64, | ||
| value: U256, | ||
| mpfpg: u128, | ||
| max_fee_per_gas: u128, | ||
| ) -> Result<TxEnvelope> { | ||
| let tx = TxEip1559 { | ||
| chain_id: 11155111, | ||
| chain_id: pecorino::RU_CHAIN_ID, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while we're fixing this, let's read it from the config by basing this work on #174 and using |
||
| nonce, | ||
| max_fee_per_gas: 10_000_000, | ||
| max_fee_per_gas, | ||
| max_priority_fee_per_gas: mpfpg, | ||
| to: TxKind::Call(Address::from_str("0x0000000000000000000000000000000000000000").unwrap()), | ||
| value, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should base this branch on the config changes in #174