-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving the network setup to a base class
- Loading branch information
1 parent
c253e07
commit dfc14fe
Showing
3 changed files
with
96 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
consensus-client-it/src/test/scala/units/network/RewardTestSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package units.network | ||
|
||
import com.wavesplatform.common.utils.EitherExt2 | ||
import units.client.engine.model.BlockNumber | ||
|
||
class RewardTestSuite extends BaseItTestSuite { | ||
"L2-234 The reward for a previous epoch is in the first block withdrawals" in { | ||
val epoch1FirstEcBlock = eventually { | ||
ec1.engineApi.getBlockByNumber(BlockNumber.Number(1)).explicitGet().get | ||
} | ||
|
||
withClue("No reward for genesis block: ") { | ||
epoch1FirstEcBlock.withdrawals shouldBe empty | ||
} | ||
|
||
val epoch1FirstContractBlock = eventually { | ||
waves1.chainContract.getBlock(epoch1FirstEcBlock.hash).getOrElse(fail(s"No first block ${epoch1FirstEcBlock.hash} confirmation")) | ||
} | ||
|
||
val epoch1Number = epoch1FirstContractBlock.epoch | ||
val epoch2Number = epoch1Number + 1 | ||
|
||
log.info(s"Wait for next epoch #$epoch2Number") | ||
waves1.api.waitForHeight(epoch2Number) | ||
|
||
log.info(s"Wait for epoch #$epoch2Number data on chain contract") | ||
val epoch2FirstContractBlock = eventually { | ||
waves1.chainContract.getEpochFirstBlock(epoch2Number).get | ||
} | ||
|
||
val epoch2FirstEcBlock = ec1.engineApi | ||
.getBlockByHash(epoch2FirstContractBlock.hash) | ||
.explicitGet() | ||
.getOrElse(fail(s"Can't find ${epoch2FirstContractBlock.hash}")) | ||
|
||
epoch2FirstEcBlock.withdrawals should have length 1 | ||
|
||
withClue("Expected reward amount: ") { | ||
epoch2FirstEcBlock.withdrawals(0).amount shouldBe rewardAmount | ||
} | ||
|
||
withClue("Expected reward receiver: ") { | ||
epoch2FirstEcBlock.withdrawals(0).address shouldBe miner1RewardAddress | ||
} | ||
} | ||
} |
84 changes: 0 additions & 84 deletions
84
consensus-client-it/src/test/scala/units/network/reward/RewardTestSuite.scala
This file was deleted.
Oops, something went wrong.