@@ -76,61 +76,14 @@ where
7676}
7777
7878/// Test utilities for the Signet EVM impl.
79- #[ cfg( any( test, feature = "test_utils " ) ) ]
79+ #[ cfg( any( test, feature = "test-utils " ) ) ]
8080pub mod test_utils {
81- use alloy:: primitives:: Address ;
82- use reth:: revm:: InMemoryDB ;
83- use signet_types:: config:: { HostConfig , PredeployTokens , RollupConfig , SignetSystemConstants } ;
84-
85- /// Test chain id for the host chain.
86- pub const TEST_HOST_CHAIN_ID : u64 = 1 ;
87- /// Test chain id for the RU chain.
88- pub const TEST_RU_CHAIN_ID : u64 = 15 ;
89- /// Test address for the host zenith.
90- pub const HOST_ZENITH_ADDRESS : Address = Address :: repeat_byte ( 0xdf ) ;
91- /// Test address for the RU zenith.
92- pub const RU_ORDERS_ADDRESS : Address = Address :: repeat_byte ( 0xac ) ;
93- /// Test address for the host orders.
94- pub const HOST_ORDERS_ADDRESS : Address = Address :: repeat_byte ( 0xdc ) ;
95-
96- /// Test address for USDC.
97- pub const TEST_USDC : Address = Address :: repeat_byte ( 0x01 ) ;
98-
99- /// Test address for USDT.
100- pub const TEST_USDT : Address = Address :: repeat_byte ( 0x02 ) ;
101-
102- /// Test address for WBTC.
103- pub const TEST_WBTC : Address = Address :: repeat_byte ( 0x03 ) ;
104-
105- /// Create a new set of Signet system constants for testing.
106- pub const fn test_signet_constants ( ) -> SignetSystemConstants {
107- let usdc = Address :: repeat_byte ( 0x01 ) ;
108- let usdt = Address :: repeat_byte ( 0x02 ) ;
109- let wbtc = Address :: repeat_byte ( 0x03 ) ;
110-
111- SignetSystemConstants :: new (
112- HostConfig :: new (
113- TEST_HOST_CHAIN_ID ,
114- 0 ,
115- HOST_ZENITH_ADDRESS ,
116- HOST_ORDERS_ADDRESS ,
117- Address :: repeat_byte ( 1 ) ,
118- Address :: repeat_byte ( 2 ) ,
119- PredeployTokens :: new ( usdc, usdt, wbtc) ,
120- ) ,
121- RollupConfig :: new (
122- TEST_RU_CHAIN_ID ,
123- RU_ORDERS_ADDRESS ,
124- Address :: repeat_byte ( 3 ) ,
125- Address :: repeat_byte ( 4 ) ,
126- PredeployTokens :: new ( usdc, usdt, wbtc) ,
127- ) ,
128- )
129- }
81+ use signet_types:: test_utils:: * ;
82+ use trevm:: revm:: InMemoryDB ;
13083
13184 /// Create a new Signet EVM with an in-memory database for testing.
13285 pub fn test_signet_evm ( ) -> super :: EvmNeedsCfg < ' static , trevm:: revm:: db:: InMemoryDB > {
133- let mut trevm = super :: signet_evm ( InMemoryDB :: default ( ) , test_signet_constants ( ) ) ;
86+ let mut trevm = super :: signet_evm ( InMemoryDB :: default ( ) , TEST_CONSTANTS ) ;
13487 trevm. inner_mut_unchecked ( ) . cfg_mut ( ) . chain_id = TEST_RU_CHAIN_ID ;
13588 trevm
13689 }
0 commit comments