Skip to content

Commit 85a2b42

Browse files
committed
update to latest node snapshot
1 parent 5709160 commit 85a2b42

21 files changed

+103
-102
lines changed

.github/workflows/check-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747

4848
local-network:
4949
name: Run Local Network tests
50+
timeout-minutes: 10
5051
runs-on: ubuntu-latest
5152
steps:
5253
- uses: actions/checkout@v4

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git.uncommittedSignifier := Some("DIRTY")
99
inScope(Global)(
1010
Seq(
1111
onChangedBuildSource := ReloadOnSourceChanges,
12-
scalaVersion := "3.7.3",
12+
scalaVersion := "3.7.4",
1313
organization := "network.units",
1414
organizationName := "Units Network",
1515
resolvers ++= Seq(Resolver.sonatypeCentralSnapshots, Resolver.mavenLocal),

consensus-client-it/src/test/scala/com/wavesplatform/api/NodeHttpApi.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class NodeHttpApi(apiUri: Uri, backend: SttpBackend[Identity, ?], apiKeyValue: S
2626
extends IntegrationTestEventually
2727
with Matchers
2828
with ScorexLogging {
29-
def blockHeader(atHeight: Int)(implicit loggingOptions: LoggingOptions = LoggingOptions()): Option[BlockHeaderResponse] = {
29+
def blockHeader(atHeight: Height)(implicit loggingOptions: LoggingOptions = LoggingOptions()): Option[BlockHeaderResponse] = {
3030
if (loggingOptions.logRequest) log.debug(s"${loggingOptions.prefix} blockHeader($atHeight)")
3131
basicRequest
3232
.get(uri"$apiUri/blocks/headers/at/$atHeight")
@@ -45,7 +45,7 @@ class NodeHttpApi(apiUri: Uri, backend: SttpBackend[Identity, ?], apiKeyValue: S
4545
}
4646
}
4747

48-
def waitForHeight(atLeast: Int)(implicit loggingOptions: LoggingOptions = LoggingOptions()): Height = {
48+
def waitForHeight(atLeast: Height)(implicit loggingOptions: LoggingOptions = LoggingOptions()): Height = {
4949
if (loggingOptions.logCall) log.debug(s"${loggingOptions.prefix} waitForHeight($atLeast)")
5050
val subsequentLoggingOptions = loggingOptions.copy(logCall = false, logResult = false, logRequest = false)
5151
val currHeight = height()(using subsequentLoggingOptions)
@@ -258,7 +258,8 @@ object NodeHttpApi {
258258

259259
case class HeightResponse(height: Height)
260260
object HeightResponse {
261-
implicit val heightResponseFormat: OFormat[HeightResponse] = Json.format[HeightResponse]
261+
given Reads[Height] = Reads.IntReads.map(Height.apply)
262+
given OFormat[HeightResponse] = Json.format[HeightResponse]
262263
}
263264

264265
case class BroadcastResponse(id: String)
@@ -268,7 +269,8 @@ object NodeHttpApi {
268269

269270
case class TransactionInfoResponse(height: Height, applicationStatus: String)
270271
object TransactionInfoResponse {
271-
implicit val transactionInfoResponseFormat: OFormat[TransactionInfoResponse] = Json.format[TransactionInfoResponse]
272+
given Reads[Height] = Reads.IntReads.map(Height.apply)
273+
given OFormat[TransactionInfoResponse] = Json.format[TransactionInfoResponse]
272274
}
273275

274276
case class BalanceResponse(balance: Long)

consensus-client-it/src/test/scala/units/AssetRegistryTestSuite.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package units
22

3+
import com.wavesplatform.state.Height
4+
35
class AssetRegistryTestSuite extends BaseDockerTestSuite {
46
private val clRecipient = clRichAccount1
57
private val elSender = elRichAccount1
68

79
private val userAmount = 1
810
private val elAmount = UnitsConvert.toAtomic(userAmount, 18)
911

10-
private var activationEpoch = 0
12+
private var activationEpoch = Height(0)
1113

1214
"WAVES and issued asset are not registered before activation" in {
1315
standardBridge.isRegistered(TErc20Address, ignoreExceptions = true) shouldBe false

consensus-client-it/src/test/scala/units/C2ENativeTokenTransfersViaDepositsTestSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class C2ENativeTokenTransfersViaDepositsTestSuite extends BaseDockerTestSuite {
5757
waves1.api.broadcastAndWait(
5858
TxHelpers.dataEntry(
5959
chainContractAccount,
60-
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch)
60+
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch.toInt)
6161
)
6262
)
6363

consensus-client-it/src/test/scala/units/ManyTransfersTestSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class ManyTransfersTestSuite extends BaseDockerTestSuite {
183183
waves1.api.broadcastAndWait(
184184
TxHelpers.dataEntry(
185185
chainContractAccount,
186-
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch)
186+
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch.toInt)
187187
)
188188
)
189189

consensus-client-it/src/test/scala/units/MultipleTransfersViaDepositsTestSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class MultipleTransfersViaDepositsTestSuite extends BaseDockerTestSuite {
196196
waves1.api.broadcastAndWait(
197197
TxHelpers.dataEntry(
198198
chainContractAccount,
199-
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch)
199+
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch.toInt)
200200
)
201201
)
202202

consensus-client-it/src/test/scala/units/SyncingTestSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class SyncingTestSuite extends BaseDockerTestSuite {
6363

6464
step("Rollback CL")
6565
val elWaitHeight = ec1.web3j.ethBlockNumber().send().getBlockNumber.intValueExact() + 1
66-
waves1.api.rollback(Height(contractBlock.epoch - 1))
66+
waves1.api.rollback(contractBlock.epoch - 1)
6767

6868
step("Wait for EL blocks")
6969
eventually(Timeout(2.minutes), Interval(10.seconds)) {

consensus-client-it/src/test/scala/units/block/validation/AssetValidTestSuite.scala

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ import com.wavesplatform.common.utils.EitherExt2.explicitGet
66
import com.wavesplatform.lang.v1.compiler.Terms
77
import com.wavesplatform.transaction.TxHelpers
88
import com.wavesplatform.transaction.smart.InvokeScriptTransaction
9+
import org.scalatest.concurrent.PatienceConfiguration.{Interval, Timeout}
910
import units.*
1011
import units.client.contract.HasConsensusLayerDappTxHelpers.EmptyE2CTransfersRootHashHex
1112
import units.client.engine.model.EcBlock
1213
import units.el.*
1314
import units.eth.EthAddress
1415

16+
import scala.concurrent.duration.*
17+
1518
class AssetValidTestSuite extends BaseBlockValidationSuite {
1619
"Valid block: asset token, correct transfer" in {
1720
val balanceBefore = terc20.getBalance(elRecipient)
@@ -67,21 +70,15 @@ class AssetValidTestSuite extends BaseBlockValidationSuite {
6770
NetworkL2Block.signed(payload, actingMiner.privateKey).explicitGet()
6871
)
6972

70-
step("Assertion: Block exists on EC1")
71-
eventually {
72-
ec1.engineApi
73-
.getBlockByHash(simulatedBlockHash)
74-
.explicitGet()
75-
.getOrElse(fail(s"Block $simulatedBlockHash was not found on EC1"))
73+
step("Assertion: EL height grows")
74+
eventually(Timeout(30.seconds), Interval(2.seconds)) {
75+
val elBlockAfter = ec1.engineApi.getLastExecutionBlock().explicitGet()
76+
elBlockAfter.hash shouldBe simulatedBlockHash
7677
}
7778

7879
step("Assertion: Deposited transaction changes balances")
7980
val balanceAfter = terc20.getBalance(elRecipient)
8081
balanceAfter.longValue shouldBe (balanceBefore.longValue + elAssetTokenAmount.longValue)
81-
82-
step("Assertion: EL height grows")
83-
val elBlockAfter = ec1.engineApi.getLastExecutionBlock().explicitGet()
84-
elBlockAfter.hash shouldBe simulatedBlockHash
8582
}
8683

8784
override def beforeAll(): Unit = setupForAssetTokenTransfer()

consensus-client-it/src/test/scala/units/block/validation/BaseBlockValidationSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ trait BaseBlockValidationSuite extends BaseDockerTestSuite {
123123
waves1.api.broadcastAndWait(
124124
TxHelpers.dataEntry(
125125
chainContractAccount,
126-
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch)
126+
IntegerDataEntry("strictC2ETransfersActivationEpoch", activationEpoch.toInt)
127127
)
128128
)
129129

0 commit comments

Comments
 (0)