Skip to content

Commit 352b287

Browse files
committed
more fixes
1 parent 57f2abc commit 352b287

File tree

10 files changed

+68
-76
lines changed

10 files changed

+68
-76
lines changed

.github/workflows/check-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133

134134
run-integration-tests:
135135
name: Run integration tests
136-
needs: check-pr
136+
# needs: check-pr
137137
runs-on: ubuntu-latest
138138
steps:
139139
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

node-it/src/test/scala/com/wavesplatform/it/IntegrationSuiteWithThreeAddresses.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait IntegrationSuiteWithThreeAddresses extends BaseSuite {
2727

2828
withClue("beforeAll") {
2929
nodes.waitForHeightAriseAndTxPresent(
30-
sender.massTransfer(sender.keyPair, List(firstAddress, secondAddress, thirdAddress).map(MassTransferTransaction.Transfer(_, 100.waves)), 0).id
30+
sender.massTransfer(sender.keyPair, List(firstAddress, secondAddress, thirdAddress).map(MassTransferTransaction.Transfer(_, 100.waves)), 0.003.waves, version = 1.toByte).id
3131
)
3232
}
3333
}

node-it/src/test/scala/com/wavesplatform/it/sync/AmountAsStringSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import play.api.libs.json.{JsString, JsValue, Json}
2020

2121
class AmountAsStringSuite extends BaseFunSuite with ScorexLogging {
2222
override protected def nodeConfigs: Seq[Config] = Seq(
23-
Miners(3).quorum(0).overrides("waves.miner.micro-block-interval = 5s"), // when UTX is empty, retry building microblock in 2 seconds
23+
Miners(1).quorum(0).overrides("waves.miner.micro-block-interval = 5s"), // when UTX is empty, retry building microblock in 2 seconds
2424
NotMiner
2525
)
2626

node-it/src/test/scala/com/wavesplatform/it/sync/activation/FeatureActivationTestSuite.scala

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@ class FeatureActivationTestSuite extends BaseFreeSpec with ActivationStatusReque
1414
private val featureNum: Short = BlockchainFeatures.SmallerMinimalGeneratingBalance.id
1515
private val featureDescr = BlockchainFeatures.SmallerMinimalGeneratingBalance.description
1616

17-
override protected def nodeConfigs: Seq[Config] = {
18-
NodeConfigs.newBuilder
19-
.overrideBase(_.raw(s"""waves {
20-
| blockchain.custom.functionality {
21-
| pre-activated-features = {}
22-
| feature-check-blocks-period = $votingInterval
23-
| blocks-for-feature-activation = $blocksForActivation
24-
| }
25-
| features.supported = [$featureNum]
26-
| miner.quorum = 1
27-
|}""".stripMargin))
28-
.withDefault(2)
29-
.buildNonConflicting()
30-
}
17+
import NodeConfigs.*
18+
override protected def nodeConfigs: Seq[Config] =
19+
Seq(BiggestMiner, Miners(5)).map(_.overrides(s"""waves {
20+
| blockchain.custom.functionality {
21+
| pre-activated-features = {}
22+
| feature-check-blocks-period = $votingInterval
23+
| blocks-for-feature-activation = $blocksForActivation
24+
| }
25+
| features.supported = [$featureNum]
26+
| miner.quorum = 1
27+
|}""".stripMargin))
3128

3229
"supported blocks increased when voting starts" in {
3330
nodes.waitForHeight(Height(votingInterval * 2 / 3))

node-it/src/test/scala/com/wavesplatform/it/sync/activation/NotActivateFeatureTestSuite.scala

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,25 @@ class NotActivateFeatureTestSuite extends BaseFreeSpec with ActivationStatusRequ
1515
private val votingFeatureNum: Short = 1
1616
private val nonVotingFeatureNum: Short = 2
1717

18+
import NodeConfigs.*
1819
override protected def nodeConfigs: Seq[Config] =
19-
NodeConfigs.newBuilder
20-
.overrideBase(
21-
_.raw(
22-
s"""waves {
23-
| blockchain {
24-
| custom {
25-
| functionality {
26-
| pre-activated-features = {}
27-
| feature-check-blocks-period = $votingInterval
28-
| blocks-for-feature-activation = $blocksForActivation
29-
| }
30-
| }
31-
| }
32-
| features.supported=[$nonVotingFeatureNum]
33-
| miner.quorum = 1
34-
|}""".stripMargin
35-
)
20+
Seq(BiggestMiner, Miners(5)).map(
21+
_.overrides(
22+
s"""waves {
23+
| blockchain {
24+
| custom {
25+
| functionality {
26+
| pre-activated-features = {}
27+
| feature-check-blocks-period = $votingInterval
28+
| blocks-for-feature-activation = $blocksForActivation
29+
| }
30+
| }
31+
| }
32+
| features.supported=[$nonVotingFeatureNum]
33+
| miner.quorum = 1
34+
|}""".stripMargin
3635
)
37-
.withDefault(2)
38-
.buildNonConflicting()
36+
)
3937

4038
private var activationStatusInfoBefore = Seq.empty[FeatureActivationStatus]
4139
private var activationStatusInfoAfter = Seq.empty[FeatureActivationStatus]

node-it/src/test/scala/com/wavesplatform/it/sync/activation/VRFProtobufActivationSuite.scala

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.wavesplatform.common.utils.EitherExt2.*
88
import com.wavesplatform.crypto
99
import com.wavesplatform.features.BlockchainFeatures
1010
import com.wavesplatform.it.NodeConfigs
11-
import com.wavesplatform.it.NodeConfigs.Default
1211
import com.wavesplatform.it.api.SyncHttpApi.*
1312
import com.wavesplatform.it.api.TransactionInfo
1413
import com.wavesplatform.it.sync.*
@@ -20,15 +19,15 @@ import com.wavesplatform.transaction.assets.exchange.{AssetPair, Order}
2019
import scala.concurrent.duration.*
2120

2221
class VRFProtobufActivationSuite extends BaseTransactionSuite {
23-
val activationHeight = Height(9)
22+
val activationHeight = Height(10)
2423
val updateInterval = 3
25-
override protected def nodeConfigs: Seq[Config] =
26-
NodeConfigs
27-
.Builder(Default, 1, Seq.empty)
28-
.overrideBase(_.quorum(0))
29-
.overrideBase(_.preactivatedFeatures((BlockchainFeatures.BlockV5.id, activationHeight)))
30-
.overrideBase(_.raw(s"waves.blockchain.custom.functionality.min-asset-info-update-interval = $updateInterval"))
31-
.buildNonConflicting()
24+
import NodeConfigs.*
25+
override protected def nodeConfigs: Seq[Config] = Seq(
26+
BiggestMiner
27+
.quorum(0)
28+
.preactivatedFeatures((BlockchainFeatures.BlockV5.id, activationHeight))
29+
.overrides(s"waves.blockchain.custom.functionality.min-asset-info-update-interval = $updateInterval")
30+
)
3231

3332
private def senderAcc = firstKeyPair
3433
private def recipientAcc = secondKeyPair
@@ -47,8 +46,9 @@ class VRFProtobufActivationSuite extends BaseTransactionSuite {
4746
}
4847

4948
test("miner generates block v4 before activation") {
50-
val blockBeforeActivationHeight = sender.blockAt(sender.height)
51-
val blockHeaderBeforeActivationHeight = sender.blockHeaderAt(sender.height)
49+
val height = sender.height
50+
val blockBeforeActivationHeight = sender.blockAt(height)
51+
val blockHeaderBeforeActivationHeight = sender.blockHeaderAt(height)
5252
blockBeforeActivationHeight.version.get shouldBe Block.RewardBlockVersion
5353
blockHeaderBeforeActivationHeight.version.get shouldBe Block.RewardBlockVersion
5454
Base58.decode(blockBeforeActivationHeight.generationSignature.get).length shouldBe Block.GenerationSignatureLength
@@ -72,10 +72,11 @@ class VRFProtobufActivationSuite extends BaseTransactionSuite {
7272
}
7373

7474
test("only able to get block by signature (that is equal to id) before activation") {
75-
sender.blockById(sender.blockAt(sender.height).signature) shouldBe sender.blockAt(sender.height)
76-
sender.blockAt(sender.height).signature shouldBe sender.blockAt(sender.height).id
77-
Base58.decode(sender.blockAt(sender.height).signature).length shouldBe crypto.SignatureLength
78-
Base58.decode(sender.blockAt(sender.height).id).length shouldBe crypto.SignatureLength
75+
val height = sender.height
76+
sender.blockById(sender.blockAt(height).signature) shouldBe sender.blockAt(height)
77+
sender.blockAt(height).signature shouldBe sender.blockAt(height).id
78+
Base58.decode(sender.blockAt(height).signature).length shouldBe crypto.SignatureLength
79+
Base58.decode(sender.blockAt(height).id).length shouldBe crypto.SignatureLength
7980
}
8081

8182
test("not able to broadcast ExchangeTransaction with reversed buy/sell orders") {
@@ -108,8 +109,9 @@ class VRFProtobufActivationSuite extends BaseTransactionSuite {
108109
}
109110

110111
test("miner generates block v5 after activation") {
111-
val blockAtActivationHeight = sender.blockAt(sender.height)
112-
val blockHeaderAtActivationHeight = sender.blockHeaderAt(sender.height)
112+
val height = sender.height
113+
val blockAtActivationHeight = sender.blockAt(height)
114+
val blockHeaderAtActivationHeight = sender.blockHeaderAt(height)
113115
blockAtActivationHeight.version.get shouldBe Block.ProtoBlockVersion
114116
blockHeaderAtActivationHeight.version.get shouldBe Block.ProtoBlockVersion
115117

@@ -118,10 +120,11 @@ class VRFProtobufActivationSuite extends BaseTransactionSuite {
118120
}
119121

120122
test("only able to get block by id (that is not equal to signature) after activation") {
121-
sender.blockById(sender.blockAt(sender.height).id) shouldBe sender.blockAt(sender.height)
122-
sender.blockAt(sender.height).signature should not be sender.blockAt(sender.height).id
123-
Base58.decode(sender.blockAt(sender.height).signature).length shouldBe crypto.SignatureLength
124-
Base58.decode(sender.blockAt(sender.height).id).length shouldBe crypto.DigestLength
123+
val height = sender.height
124+
sender.blockById(sender.blockAt(height).id) shouldBe sender.blockAt(height)
125+
sender.blockAt(height).signature should not be sender.blockAt(height).id
126+
Base58.decode(sender.blockAt(height).signature).length shouldBe crypto.SignatureLength
127+
Base58.decode(sender.blockAt(height).id).length shouldBe crypto.DigestLength
125128
}
126129

127130
test("able to broadcast UpdateAssetInfoTransaction if interval's reached before activation") {

node-it/src/test/scala/com/wavesplatform/it/sync/smartcontract/EstimatorTestSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class EstimatorTestSuite extends BaseTransactionSuite with CancelAfterFailure {
1818
import NodeConfigs.*
1919

2020
override protected def nodeConfigs: Seq[Config] = Seq(
21-
BiggestMiner
21+
Miners(5)
2222
.quorum(0)
2323
.overrides(
2424
s"""

node-it/src/test/scala/com/wavesplatform/it/sync/smartcontract/freecall/InvokeExpressionGrpcSuite.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import com.typesafe.config.Config
55
import com.wavesplatform.account.AddressScheme
66
import com.wavesplatform.features.BlockchainFeatures.ContinuationTransaction
77
import com.wavesplatform.it.NodeConfigs
8-
import com.wavesplatform.it.NodeConfigs.Default
98
import com.wavesplatform.it.api.SyncGrpcApi.*
109
import com.wavesplatform.it.api.{PutDataResponse, StateChangesDetails}
1110
import com.wavesplatform.it.sync.grpc.GrpcBaseTransactionSuite
@@ -20,12 +19,10 @@ import com.wavesplatform.transaction.smart.InvokeExpressionTransaction
2019
import org.scalatest.{Assertion, CancelAfterFailure}
2120

2221
class InvokeExpressionGrpcSuite extends GrpcBaseTransactionSuite with CancelAfterFailure {
23-
override protected def nodeConfigs: Seq[Config] =
24-
NodeConfigs
25-
.Builder(Default, 1, Seq.empty)
26-
.overrideBase(_.quorum(0))
27-
.overrideBase(_.preactivatedFeatures((ContinuationTransaction.id, Height(1))))
28-
.buildNonConflicting()
22+
import NodeConfigs.*
23+
override protected def nodeConfigs: Seq[Config] = Seq(
24+
BiggestMiner.quorum(0).preactivatedFeatures((ContinuationTransaction.id, Height(1)))
25+
)
2926

3027
private val expr: ExprScript =
3128
TestCompiler(V6).compileFreeCall(

node-it/src/test/scala/com/wavesplatform/it/sync/smartcontract/freecall/InvokeExpressionSuite.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.wavesplatform.account.AddressScheme
44
import com.wavesplatform.api.http.ApiError.StateCheckFailed
55
import com.wavesplatform.features.BlockchainFeatures.ContinuationTransaction
66
import com.wavesplatform.it.NodeConfigs
7-
import com.wavesplatform.it.NodeConfigs.Default
87
import com.wavesplatform.it.api.SyncHttpApi.*
98
import com.wavesplatform.it.api.{PutDataResponse, StateChangesDetails, Transaction, TransactionInfo}
109
import com.wavesplatform.it.sync.invokeExpressionFee
@@ -16,12 +15,10 @@ import com.wavesplatform.state.Height
1615
import org.scalatest.{Assertion, CancelAfterFailure}
1716

1817
class InvokeExpressionSuite extends BaseTransactionSuite with CancelAfterFailure {
19-
override protected def nodeConfigs: Seq[Config] =
20-
NodeConfigs
21-
.Builder(Default, 1, Seq.empty)
22-
.overrideBase(_.quorum(0))
23-
.overrideBase(_.preactivatedFeatures((ContinuationTransaction.id, Height(0))))
24-
.buildNonConflicting()
18+
import NodeConfigs.*
19+
override protected def nodeConfigs: Seq[Config] = Seq(
20+
BiggestMiner.quorum(0).preactivatedFeatures((ContinuationTransaction.id, Height(0)))
21+
)
2522

2623
private val expr: ExprScript =
2724
TestCompiler(V6).compileFreeCall(

node-it/src/test/scala/com/wavesplatform/it/sync/transactions/SponsorshipSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class SponsorshipSuite extends BaseFreeSpec with IntegrationSuiteWithThreeAddres
171171

172172
val aliceTxs = sender.transactionsByAddress(aliceAddress, 100)
173173
aliceTxs.size shouldBe 5 // not 4, because there was one more transaction in IntegrationSuiteWithThreeAddresses class
174-
aliceTxs.count(tx => tx.sender.contains(aliceAddress) || tx.recipient.contains(aliceAddress)) shouldBe 5
174+
aliceTxs.count(tx => tx.sender.contains(aliceAddress) || tx.recipient.contains(aliceAddress)) shouldBe 4
175175
aliceTxs.map(_.id) should contain allElementsOf Seq(
176176
firstTransferTxToAlice,
177177
secondTransferTxToAlice,
@@ -181,13 +181,13 @@ class SponsorshipSuite extends BaseFreeSpec with IntegrationSuiteWithThreeAddres
181181

182182
val bobTxs = sender.transactionsByAddress(bobAddress, 100)
183183
bobTxs.size shouldBe 3
184-
bobTxs.count(tx => tx.sender.contains(bobAddress) || tx.recipient.contains(bobAddress)) shouldBe 3
184+
bobTxs.count(tx => tx.sender.contains(bobAddress) || tx.recipient.contains(bobAddress)) shouldBe 2
185185
bobTxs.map(_.id) should contain allElementsOf Seq(firstTransferTxCustomFeeAlice, secondTransferTxCustomFeeAlice)
186186
}
187187

188188
"check transactions by address" in {
189189
val minerTxs = sender.transactionsByAddress(miner.address, 100)
190-
minerTxs.size shouldBe 4
190+
minerTxs.size shouldBe 2
191191

192192
val sponsorTxs = sender.transactionsByAddress(sponsorAddress, 100)
193193
// 1 x transfer in IntegrationSuiteWithThreeAddresses
@@ -196,7 +196,7 @@ class SponsorshipSuite extends BaseFreeSpec with IntegrationSuiteWithThreeAddres
196196
// 2 x sponsor here: A-5, A-6
197197
// 2 x transfers with sponsored assets here: A-7, A-8
198198
sponsorTxs.size shouldBe 9
199-
sponsorTxs.count(tx => tx.sender.contains(sponsorAddress) || tx.recipient.contains(sponsorAddress)) shouldBe 7 // Without A-7, A-8
199+
sponsorTxs.count(tx => tx.sender.contains(sponsorAddress) || tx.recipient.contains(sponsorAddress)) shouldBe 6 // Without initial transfer, A-7, A-8
200200
sponsorTxs.map(_.id) should contain allElementsOf Seq(
201201
firstSponsorAssetId,
202202
secondSponsorAssetId,

0 commit comments

Comments
 (0)