diff --git a/src/test/scala/units/BlockBriefValidationTestSuite.scala b/src/test/scala/units/BlockBriefValidationTestSuite.scala index ada4ebf5..ac4c54fc 100644 --- a/src/test/scala/units/BlockBriefValidationTestSuite.scala +++ b/src/test/scala/units/BlockBriefValidationTestSuite.scala @@ -12,7 +12,7 @@ class BlockBriefValidationTestSuite extends BaseIntegrationTestSuite { ) "Brief validation of EC Block incoming from network" - { - "accepts if it is valid" in test { d => + "L2-212 accepts if it is valid" in test { d => val ecBlock = d.createEcBlockBuilder("0", miner).build() step(s"Receive ecBlock ${ecBlock.hash} from a peer") @@ -26,7 +26,7 @@ class BlockBriefValidationTestSuite extends BaseIntegrationTestSuite { } } - "otherwise ignoring" in test { d => + "L2-384 otherwise ignoring" in test { d => val ecBlock = d.createEcBlockBuilder("0", minerRewardL2Address = EthAddress.empty, parent = d.ecGenesisBlock).build() step(s"Receive ecBlock ${ecBlock.hash} from a peer") diff --git a/src/test/scala/units/BlockFullValidationTestSuite.scala b/src/test/scala/units/BlockFullValidationTestSuite.scala index 643f029c..db924fce 100644 --- a/src/test/scala/units/BlockFullValidationTestSuite.scala +++ b/src/test/scala/units/BlockFullValidationTestSuite.scala @@ -21,9 +21,9 @@ class BlockFullValidationTestSuite extends BaseIntegrationTestSuite { ) "Full validation when the block is available on EL and CL" - { - "doesn't happen for finalized blocks" in withExtensionDomain(defaultSettings.copy(initialMiners = List(reliable))) { d => + "L2-315 doesn't happen for finalized blocks" in withExtensionDomain(defaultSettings.copy(initialMiners = List(reliable))) { d => step("Start new epoch for ecBlock") - d.advanceNewBlocks(reliable.address) + d.advanceNewBlocks(reliable.address) // Waiting for reliable miner epoch val ecBlock = d.createEcBlockBuilder("0", reliable).buildAndSetLogs(ecBlockLogs) d.advanceConsensusLayerChanged() @@ -48,7 +48,7 @@ class BlockFullValidationTestSuite extends BaseIntegrationTestSuite { } } - "happens for not finalized blocks" - { + "L2-310 happens for not finalized blocks" - { "successful validation updates the chain information" in withExtensionDomain() { d => step("Start new epoch for ecBlock") d.advanceNewBlocks(reliable.address) @@ -76,7 +76,7 @@ class BlockFullValidationTestSuite extends BaseIntegrationTestSuite { } } - "unsuccessful causes a fork" - { + "L2-245 unsuccessful causes a fork" - { def e2CTest( blockLogs: List[GetLogsResponseEntry], e2CTransfersRootHashHex: String, @@ -110,12 +110,12 @@ class BlockFullValidationTestSuite extends BaseIntegrationTestSuite { } } - "CL confirmation without a transfers root hash" in e2CTest( + "L2-361 CL confirmation without a transfers root hash" in e2CTest( blockLogs = ecBlockLogs, e2CTransfersRootHashHex = EmptyE2CTransfersRootHashHex ) - "Events from an unexpected EL bridge address" in { + "L2-385 Events from an unexpected EL bridge address" in { val fakeBridgeAddress = EthAddress.unsafeFrom("0x53481054Ad294207F6ed4B6C2E6EaE34E1Bb8704") val ecBlock2Logs = transferEvents.map(x => getLogsResponseEntry(x).copy(address = fakeBridgeAddress)) e2CTest( @@ -124,7 +124,7 @@ class BlockFullValidationTestSuite extends BaseIntegrationTestSuite { ) } - "Different miners in CL and EL" in e2CTest( + "L2-256 Different miners in CL and EL" in e2CTest( blockLogs = ecBlockLogs, e2CTransfersRootHashHex = e2CTransfersRootHashHex, badBlockPostProcessing = _.copy(minerRewardL2Address = reliable.elRewardAddress) diff --git a/src/test/scala/units/BlockIssuesForgingTestSuite.scala b/src/test/scala/units/BlockIssuesForgingTestSuite.scala index 7cea6538..5ae6323f 100644 --- a/src/test/scala/units/BlockIssuesForgingTestSuite.scala +++ b/src/test/scala/units/BlockIssuesForgingTestSuite.scala @@ -52,7 +52,7 @@ class BlockIssuesForgingTestSuite extends BaseIntegrationTestSuite { f(d, ecBlock2, ecBlock2Epoch) } - "EC-block comes within timeout - then we continue forging" in test { (d, ecBlock2, ecBlock2Epoch) => + "L2-309 EC-block comes within timeout - then we continue forging" in test { (d, ecBlock2, ecBlock2Epoch) => d.advanceElu(WaitRequestedBlockTimeout - 1.millis) d.waitForCS[FollowingChain](s"Still waiting ecBlock2 ${ecBlock2.hash}") { s => s.nextExpectedBlock.value.hash shouldBe ecBlock2.hash @@ -69,7 +69,7 @@ class BlockIssuesForgingTestSuite extends BaseIntegrationTestSuite { } } - "EC-block doesn't come - then we start an alternative chain" in test { (d, _, _) => + "L2-251 EC-block doesn't come - then we start an alternative chain" in test { (d, _, _) => d.waitForCS[WaitForNewChain](s"Switched to alternative chain") { _ => } } } @@ -97,7 +97,7 @@ class BlockIssuesForgingTestSuite extends BaseIntegrationTestSuite { s.nodeChainInfo.lastBlock.hash shouldBe ecBadBlock2.hash } - step(s"Start a new epoch of otherMiner2 ${otherMiner2.address} with alternative chain ecBlock2") + step(s"L2-280 Start a new epoch of otherMiner2 ${otherMiner2.address} with alternative chain ecBlock2") d.advanceNewBlocks(otherMiner2.address) val ecBlock2 = d.createEcBlockBuilder("0-1", otherMiner2, ecBlock1).rewardPrevMiner().buildAndSetLogs() @@ -154,7 +154,7 @@ class BlockIssuesForgingTestSuite extends BaseIntegrationTestSuite { } } - "We mined before the alternative chain before and EC-block doesn't come - then we still wait for it" in withExtensionDomain() { d => + "L2-386 We mined before the alternative chain before and EC-block doesn't come - then we still wait for it" in withExtensionDomain() { d => step(s"Start a new epoch of otherMiner1 ${otherMiner1.address} with ecBlock1") d.advanceNewBlocks(otherMiner1.address) val ecBlock1 = d.createEcBlockBuilder("0", otherMiner1).buildAndSetLogs() @@ -219,7 +219,7 @@ class BlockIssuesForgingTestSuite extends BaseIntegrationTestSuite { } } - "We haven't mined the alternative chain before and EC-block doesn't come - then we wait for a new alternative chain" in + "L2-276 We haven't mined the alternative chain before and EC-block doesn't come - then we wait for a new alternative chain" in withExtensionDomain() { d => step(s"Start a new epoch of otherMiner1 ${otherMiner1.address} with ecBlock1") d.advanceNewBlocks(otherMiner1.address) diff --git a/src/test/scala/units/C2ETransfersTestSuite.scala b/src/test/scala/units/C2ETransfersTestSuite.scala index cc9b68dd..bd47fc64 100644 --- a/src/test/scala/units/C2ETransfersTestSuite.scala +++ b/src/test/scala/units/C2ETransfersTestSuite.scala @@ -15,11 +15,11 @@ class C2ETransfersTestSuite extends BaseIntegrationTestSuite { additionalBalances = List(AddrWithBalance(transferSenderAccount.toAddress)) ) - "Pass valid address with valid payment" in { + "L2-351 Pass valid address with valid payment" in { transferFuncTest(validTransferRecipient) should beRight } - "Deny invalid address" in forAll( + "L2-348 Deny invalid address" in forAll( Table( "invalid address" -> "message", "" -> "Address should have 40 characters", @@ -33,18 +33,20 @@ class C2ETransfersTestSuite extends BaseIntegrationTestSuite { transferFuncTest(address) should produce(message) } - "Deny invalid payment amount" in forAll( + "L2-358 Deny invalid payment amount" in forAll( Table( ("invalid payment amount", "initial queue size", "message"), (1, 0, "should be >= 1000000 for queue size of 1"), - (1_000_000, 1600, "should be >= 100000000 for queue size of 1601"), + (1_000_000, 160, "should be >= 10000000 for queue size of 161"), + (10_000_000, 1600, "should be >= 100000000 for queue size of 1601"), + (100_000_000, 3200, "should be >= 1000000000 for queue size of 3201"), (1_000_000_001, 6401, "Transfers denied for queue size of 6402") ) ) { case (transferAmount, initQueueSize, message) => transferFuncTest(validTransferRecipient, transferAmount, queueSize = initQueueSize) should produce(message) } - "Deny invalid asset" in forAll( + "L2-354 Deny invalid asset" in forAll( Table( "invalid token" -> "message", Asset.Waves -> "in the payment, got Waves", diff --git a/src/test/scala/units/E2CTransfersTestSuite.scala b/src/test/scala/units/E2CTransfersTestSuite.scala index 6881ccf5..110f7609 100644 --- a/src/test/scala/units/E2CTransfersTestSuite.scala +++ b/src/test/scala/units/E2CTransfersTestSuite.scala @@ -33,7 +33,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { additionalBalances = List(AddrWithBalance(transferReceiver.toAddress, defaultFees.chainContract.withdrawFee)) ) - "Multiple withdrawals" in { + "L2-288 Multiple withdrawals" in { val transferReceiver1 = transferReceiver val transferReceiver2 = TxHelpers.signer(2) val transfer1 = Bridge.ElSentNativeEvent(transferReceiver1.toAddress, 1) @@ -79,7 +79,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Can't get transferred tokens with index that is out of bounds" in forAll( + "L2-388 Can't get transferred tokens with index that is out of bounds" in forAll( Table( "index" -> "errorMessage", -1 -> "Transfer index in block should be nonnegative, got -1", @@ -102,7 +102,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Deny withdrawals with a non-positive amount" in forAll( + "L2-389 Deny withdrawals with a non-positive amount" in forAll( Table( "index", 0L, @@ -124,7 +124,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Can't get transferred tokens if the data is incorrect and able if it is correct" in withExtensionDomain() { d => + "L2-339 Can't get transferred tokens if the data is incorrect and able if it is correct" in withExtensionDomain() { d => step(s"Start new epoch with ecBlock") d.advanceNewBlocks(reliable.address) val ecBlock = d.createEcBlockBuilder("0", reliable).buildAndSetLogs(ecBlockLogs) @@ -143,7 +143,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Can't get transferred tokens twice" in { + "L2-273 Can't get transferred tokens twice" in { val settings = defaultSettings.copy( additionalBalances = List(AddrWithBalance(transferReceiver.toAddress, defaultFees.chainContract.withdrawFee * 2)) ) @@ -165,7 +165,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Ignores wrong events" in { + "L2-377 Ignores wrong events" in { val wrongEventDef: Event = new Event( "SentSomething", List[TypeReference[?]](new TypeReference[Bytes20](false) {}).asJava @@ -204,7 +204,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Fails on wrong data" in { + "L2-387 Fails on wrong data" in { val settings = defaultSettings.withEnabledElMining withExtensionDomain(settings) { d => step(s"Start new epoch with ecBlock1") @@ -220,7 +220,7 @@ class E2CTransfersTestSuite extends BaseIntegrationTestSuite { } } - "Can't get transferred tokens from a fork and can after the fork becomes a main chain" in { + "L2-308 Can't get transferred tokens from a fork and can after the fork becomes a main chain" in { val settings = defaultSettings.copy(initialMiners = List(reliable, malfunction)).withEnabledElMining withExtensionDomain(settings) { d => step(s"Start a new epoch of malfunction miner ${malfunction.address} with ecBlock1")