11package units
22
3- import com .wavesplatform .state .Height
3+ import com .wavesplatform .state .{ Height , StringDataEntry }
44import com .wavesplatform .utils .EthEncoding
55import org .web3j .crypto .{RawTransaction , TransactionEncoder }
66import org .web3j .protocol .core .methods .response .{EthSendTransaction , TransactionReceipt }
77import org .web3j .tx .gas .DefaultGasProvider
88import org .web3j .utils .Convert
9- import units .docker .EcContainer
9+ import units .docker .{ EcContainer , Networks , WavesNodeContainer }
1010
1111import java .math .BigInteger
1212import scala .jdk .OptionConverters .RichOptional
@@ -17,6 +17,28 @@ class SyncingTestSuite extends BaseDockerTestSuite {
1717 private val elSender = elRichAccount1
1818 private val amount = Convert .toWei(" 1" , Convert .Unit .ETHER ).toBigInteger
1919
20+ override protected lazy val waves1 : WavesNodeContainer = new WavesNodeContainer (
21+ network = network,
22+ number = 1 ,
23+ ip = Networks .ipForNode(3 ),
24+ baseSeed = " devnet-2" ,
25+ chainContractAddress = chainContractAddress,
26+ ecEngineApiUrl = ec1.engineApiDockerUrl,
27+ genesisConfigPath = wavesGenesisConfigPath
28+ )
29+
30+ override def beforeAll (): Unit = {
31+ super .beforeAll()
32+ waves1.api.broadcast(ChainContract .join(miner21Account, miner21RewardAddress))
33+
34+ eventually {
35+ waves1.api.dataByKey(chainContractAddress, " allMiners" ) match {
36+ case Some (StringDataEntry (_, value)) => value.split(" ," ).length shouldBe 2
37+ case _ => fail(" not all miners have joined" )
38+ }
39+ }
40+ }
41+
2042 " L2-381 EL transactions appear after rollback" in {
2143 step(" Send transaction 1" )
2244 val txn1Result = sendTxn(0 )
@@ -44,7 +66,7 @@ class SyncingTestSuite extends BaseDockerTestSuite {
4466 waves1.api.rollback(Height (contractBlock.epoch - 1 ))
4567
4668 step(" Wait for EL blocks" )
47- eventually(Timeout (1 .minute ), Interval (10 .seconds)) {
69+ eventually(Timeout (2 .minutes ), Interval (10 .seconds)) {
4870 ec1.web3j.ethBlockNumber().send().getBlockNumber.intValueExact() should be >= elWaitHeight
4971 }
5072
0 commit comments