@@ -33,45 +33,32 @@ defmodule Itest.Reorg do
33
33
Logger . info ( "get_latest_block_number done #{ block_before_reorg } " )
34
34
pause_container! ( @ node1 )
35
35
unpause_container! ( @ node2 )
36
-
37
- :ok =
38
- Client . wait_until_block_number (
39
- block_before_reorg + 4 ,
40
- System . get_env ( "ETHEREUM_RPC_URL_2" , "http://localhost:9001" )
41
- )
36
+ Application . put_env ( :ethereumex , :url , System . get_env ( "ETHEREUM_RPC_URL_2" , "http://localhost:9001" ) )
37
+ :ok = Client . wait_until_block_number ( block_before_reorg + 4 )
42
38
43
39
Logger . info ( "wait_until_block_number done #{ block_before_reorg + 4 } " )
44
40
func . ( )
45
41
46
42
{ :ok , block_on_the_first_node1 } = Client . get_latest_block_number ( )
47
43
48
- :ok =
49
- Client . wait_until_block_number (
50
- block_on_the_first_node1 + 2 ,
51
- System . get_env ( "ETHEREUM_RPC_URL_2" , "http://localhost:9001" )
52
- )
44
+ :ok = Client . wait_until_block_number ( block_on_the_first_node1 + 2 )
53
45
54
46
{ :ok , block_on_the_first_node2 } = Client . get_latest_block_number ( )
55
47
56
48
pause_container! ( @ node2 )
57
49
unpause_container! ( @ node1 )
58
50
59
- :ok =
60
- Client . wait_until_block_number (
61
- block_before_reorg + 4 ,
62
- System . get_env ( "ETHEREUM_RPC_URL_1" , "http://localhost:9001" )
63
- )
51
+ Application . put_env ( :ethereumex , :url , System . get_env ( "ETHEREUM_RPC_URL_1" , "http://localhost:9001" ) )
52
+
53
+ :ok = Client . wait_until_block_number ( block_before_reorg + 4 )
64
54
65
55
response = func . ( )
66
56
67
- :ok =
68
- Client . wait_until_block_number (
69
- block_on_the_first_node2 + 4 ,
70
- System . get_env ( "ETHEREUM_RPC_URL_1" , "http://localhost:9001" )
71
- )
57
+ :ok = Client . wait_until_block_number ( block_on_the_first_node2 + 4 )
72
58
73
59
unpause_container! ( @ node2 )
74
60
unpause_container! ( @ node1 )
61
+ Application . put_env ( :ethereumex , :url , System . get_env ( "ETHEREUM_RPC_URL_1" , "http://localhost:9001" ) )
75
62
76
63
wait_for_nodes_to_be_in_sync ( )
77
64
0 commit comments