Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Move external-tracer from bus-mapping to a new crate only for test #84

Conversation

silathdiir
Copy link

@silathdiir silathdiir commented Jan 24, 2022

Close #61
Close privacy-scaling-explorations#272

Summary

  1. Move common types of external-tracer to etc-types/src/geth_types.rs.
  2. Move test code to a new crate external-tracer.
  3. Separate bus_mapping::mock::BlockData to test implement (commented with #[cfg(test)]) and common implement (exported for test of zkevm-circuit).

Comment on lines +10 to +20
/// Mock chain ID
pub const MOCK_CHAIN_ID: u64 = 1338;

/// Mock gas
pub const MOCK_GAS: u64 = 1_000_000u64;

lazy_static! {
/// Mock coinbase value
pub static ref MOCK_COINBASE: Address =
address!("0x00000000000000000000000000000000c014ba5e");
}
Copy link

@0xmountaintop 0xmountaintop Jan 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these seem for mocking. can we move these to mock?

/// with the given gas limit.
/// The trace will be generated automatically with the external_tracer
/// from the accounts code.
pub fn create_tx_by_accounts(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move create_tx_by_accounts create_tx_by_steps new_tx new_block and new_chain_constants to mock?

because they seem mock-specific.

and in mock::create_tx_by_accounts we can call external_tracer::trace

@scroll-dev scroll-dev closed this Jan 24, 2022
@scroll-dev
Copy link

moved to privacy-scaling-explorations#303

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make geth-utils and go a dev-dependency disable geth-utils for non-test mode
4 participants