@@ -87,6 +87,42 @@ static KNOWN_EMPTY_CALIBNET_ADDRESS: LazyLock<Address> = LazyLock::new(|| {
8787 . into ( )
8888} ) ;
8989
90+ // this is the ID address of the `t1w2zb5a723izlm4q3khclsjcnapfzxcfhvqyfoly` address
91+ static KNOWN_CALIBNET_F0_ADDRESS : LazyLock < Address > = LazyLock :: new ( || {
92+ crate :: shim:: address:: Network :: Testnet
93+ . parse_address ( "t0168923" )
94+ . unwrap ( )
95+ . into ( )
96+ } ) ;
97+
98+ static KNOWN_CALIBNET_F1_ADDRESS : LazyLock < Address > = LazyLock :: new ( || {
99+ crate :: shim:: address:: Network :: Testnet
100+ . parse_address ( "t1w2zb5a723izlm4q3khclsjcnapfzxcfhvqyfoly" )
101+ . unwrap ( )
102+ . into ( )
103+ } ) ;
104+
105+ static KNOWN_CALIBNET_F2_ADDRESS : LazyLock < Address > = LazyLock :: new ( || {
106+ crate :: shim:: address:: Network :: Testnet
107+ . parse_address ( "t2nfplhzpyeck5dcc4fokj5ar6nbs3mhbdmq6xu3q" )
108+ . unwrap ( )
109+ . into ( )
110+ } ) ;
111+
112+ static KNOWN_CALIBNET_F3_ADDRESS : LazyLock < Address > = LazyLock :: new ( || {
113+ crate :: shim:: address:: Network :: Testnet
114+ . parse_address ( "t3wmbvnabsj6x2uki33phgtqqemmunnttowpx3chklrchy76pv52g5ajnaqdypxoomq5ubfk65twl5ofvkhshq" )
115+ . unwrap ( )
116+ . into ( )
117+ } ) ;
118+
119+ static KNOWN_CALIBNET_F4_ADDRESS : LazyLock < Address > = LazyLock :: new ( || {
120+ crate :: shim:: address:: Network :: Testnet
121+ . parse_address ( "t410fx2cumi6pgaz64varl77xbuub54bgs3k5xsvn3ki" )
122+ . unwrap ( )
123+ . into ( )
124+ } ) ;
125+
90126const TICKET_QUALITY_GREEDY : f64 = 0.9 ;
91127const TICKET_QUALITY_OPTIMAL : f64 = 0.8 ;
92128const ZERO_ADDRESS : & str = "0x0000000000000000000000000000000000000000" ;
@@ -1255,11 +1291,11 @@ fn state_tests_with_tipset<DB: Blockstore>(
12551291fn wallet_tests ( worker_address : Option < Address > ) -> Vec < RpcTest > {
12561292 let prefunded_wallets = [
12571293 // the following addresses should have 666 attoFIL each
1258- Address :: from_str ( "t0168923" ) . unwrap ( ) , // this is the ID address of the `t1w2zb5a723izlm4q3khclsjcnapfzxcfhvqyfoly` address
1259- Address :: from_str ( "t1w2zb5a723izlm4q3khclsjcnapfzxcfhvqyfoly" ) . unwrap ( ) ,
1260- Address :: from_str ( "t2nfplhzpyeck5dcc4fokj5ar6nbs3mhbdmq6xu3q" ) . unwrap ( ) ,
1261- Address :: from_str ( "t3wmbvnabsj6x2uki33phgtqqemmunnttowpx3chklrchy76pv52g5ajnaqdypxoomq5ubfk65twl5ofvkhshq" ) . unwrap ( ) ,
1262- Address :: from_str ( "t410fx2cumi6pgaz64varl77xbuub54bgs3k5xsvn3ki" ) . unwrap ( ) ,
1294+ * KNOWN_CALIBNET_F0_ADDRESS ,
1295+ * KNOWN_CALIBNET_F1_ADDRESS ,
1296+ * KNOWN_CALIBNET_F2_ADDRESS ,
1297+ * KNOWN_CALIBNET_F3_ADDRESS ,
1298+ * KNOWN_CALIBNET_F4_ADDRESS ,
12631299 // This address should have 0 FIL
12641300 * KNOWN_EMPTY_CALIBNET_ADDRESS ,
12651301 ] ;
@@ -1456,12 +1492,26 @@ fn eth_tests() -> Vec<RpcTest> {
14561492 EthUninstallFilter :: request_with_alias ( ( FilterID :: new ( ) . unwrap ( ) , ) , use_alias) . unwrap ( ) ,
14571493 ) ) ;
14581494 tests. push ( RpcTest :: identity (
1459- EthAddressToFilecoinAddress :: request ( ( EthAddress :: from_str (
1460- "0xff38c072f286e3b20b3954ca9f99c05fbecc64aa" ,
1461- )
1462- . unwrap ( ) , ) )
1495+ EthAddressToFilecoinAddress :: request ( ( "0xff38c072f286e3b20b3954ca9f99c05fbecc64aa"
1496+ . parse ( )
1497+ . unwrap ( ) , ) )
14631498 . unwrap ( ) ,
14641499 ) ) ;
1500+ tests. push ( RpcTest :: identity (
1501+ FilecoinAddressToEthAddress :: request ( ( * KNOWN_CALIBNET_F0_ADDRESS , None ) ) . unwrap ( ) ,
1502+ ) ) ;
1503+ tests. push ( RpcTest :: identity (
1504+ FilecoinAddressToEthAddress :: request ( ( * KNOWN_CALIBNET_F1_ADDRESS , None ) ) . unwrap ( ) ,
1505+ ) ) ;
1506+ tests. push ( RpcTest :: identity (
1507+ FilecoinAddressToEthAddress :: request ( ( * KNOWN_CALIBNET_F2_ADDRESS , None ) ) . unwrap ( ) ,
1508+ ) ) ;
1509+ tests. push ( RpcTest :: identity (
1510+ FilecoinAddressToEthAddress :: request ( ( * KNOWN_CALIBNET_F3_ADDRESS , None ) ) . unwrap ( ) ,
1511+ ) ) ;
1512+ tests. push ( RpcTest :: identity (
1513+ FilecoinAddressToEthAddress :: request ( ( * KNOWN_CALIBNET_F4_ADDRESS , None ) ) . unwrap ( ) ,
1514+ ) ) ;
14651515 }
14661516 tests
14671517}
@@ -1936,9 +1986,27 @@ fn eth_tests_with_tipset<DB: Blockstore>(store: &Arc<DB>, shared_tipset: &Tipset
19361986 ] ;
19371987
19381988 for block in shared_tipset. block_headers ( ) {
1989+ tests. extend ( [ RpcTest :: identity (
1990+ FilecoinAddressToEthAddress :: request ( (
1991+ block. miner_address ,
1992+ Some ( BlockNumberOrPredefined :: PredefinedBlock (
1993+ ExtPredefined :: Latest ,
1994+ ) ) ,
1995+ ) )
1996+ . unwrap ( ) ,
1997+ ) ] ) ;
19391998 let ( bls_messages, secp_messages) =
19401999 crate :: chain:: store:: block_messages ( store, block) . unwrap ( ) ;
19412000 for msg in sample_messages ( bls_messages. iter ( ) , secp_messages. iter ( ) ) {
2001+ tests. extend ( [ RpcTest :: identity (
2002+ FilecoinAddressToEthAddress :: request ( (
2003+ msg. from ( ) ,
2004+ Some ( BlockNumberOrPredefined :: PredefinedBlock (
2005+ ExtPredefined :: Latest ,
2006+ ) ) ,
2007+ ) )
2008+ . unwrap ( ) ,
2009+ ) ] ) ;
19422010 if let Ok ( eth_to_addr) = msg. to . try_into ( ) {
19432011 tests. extend ( [ RpcTest :: identity (
19442012 EthEstimateGas :: request ( (
0 commit comments