Skip to content

Commit

Permalink
Merge pull request #1339 from wavesplatform/make-test-ng-insensitive
Browse files Browse the repository at this point in the history
make-test-ng-insensitive
  • Loading branch information
alexeykiselev authored Jul 24, 2018
2 parents 9b9c23c + f210ddb commit 43f7e2d
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class SponsorshipSuite extends FreeSpec with NodesFromDocker with Matchers with
"alice transfer sponsored asset to bob using sponsored fee" in {
val transferTxCustomFeeAlice = alice.transfer(alice.address, bob.address, 10 * Token, SmallFee, Some(sponsorAssetId), Some(sponsorAssetId)).id
nodes.waitForHeightAriseAndTxPresent(transferTxCustomFeeAlice)
nodes.waitForHeightArise()

assert(!transferTxCustomFeeAlice.isEmpty)
miner.assertAssetBalance(alice.address, sponsorAssetId, sponsorAssetTotal / 2 - SmallFee - 10 * Token)
miner.assertAssetBalance(bob.address, sponsorAssetId, 10 * Token)
Expand Down Expand Up @@ -241,6 +243,8 @@ class SponsorshipSuite extends FreeSpec with NodesFromDocker with Matchers with

val transferTxCustomFeeAlice = alice.transfer(alice.address, bob.address, 1.waves, TinyFee, None, Some(sponsorAssetId)).id
nodes.waitForHeightAriseAndTxPresent(transferTxCustomFeeAlice)
nodes.waitForHeightArise()

val wavesFee = Sponsorship.FeeUnit * TinyFee / TinyFee
sponsor.assertBalances(sponsor.address, sponsoredBalance._1 - wavesFee, sponsoredBalance._2 - wavesFee)
sponsor.assertAssetBalance(sponsor.address, sponsorAssetId, sponsorAssetBalance + TinyFee)
Expand All @@ -255,6 +259,8 @@ class SponsorshipSuite extends FreeSpec with NodesFromDocker with Matchers with
"change sponsorship fee in active sponsored asset" in {
val setAssetSponsoredTx = sponsor.sponsorAsset(sponsor.address, sponsorAssetId, fee = issueFee, baseFee = LargeFee).id
nodes.waitForHeightAriseAndTxPresent(setAssetSponsoredTx)
nodes.waitForHeightArise()

assert(!setAssetSponsoredTx.isEmpty)
val assetInfo = alice.assetsBalance(alice.address).balances.filter(_.assetId == sponsorAssetId).head
assetInfo.minSponsoredAssetFee shouldBe Some(LargeFee)
Expand All @@ -281,6 +287,8 @@ class SponsorshipSuite extends FreeSpec with NodesFromDocker with Matchers with
val transferTxCustomFeeAlice = alice.transfer(alice.address, bob.address, 1.waves, LargeFee, None, Some(sponsorAssetId)).id
nodes.waitForHeightAriseAndTxPresent(transferTxCustomFeeAlice)
val wavesFee = Sponsorship.FeeUnit * LargeFee / LargeFee
nodes.waitForHeightArise()

sponsor.assertBalances(sponsor.address, sponsoredBalance._1 - wavesFee, sponsoredBalance._2 - wavesFee)
sponsor.assertAssetBalance(sponsor.address, sponsorAssetId, sponsorAssetBalance + LargeFee)
alice.assertAssetBalance(alice.address, sponsorAssetId, aliceAssetBalance - LargeFee)
Expand Down Expand Up @@ -313,13 +321,15 @@ class SponsorshipSuite extends FreeSpec with NodesFromDocker with Matchers with

val sponsorAssetId2Reissue = sponsor.reissue(sponsor.address, sponsorAssetId2, sponsorAssetTotal, true, issueFee).id
nodes.waitForHeightAriseAndTxPresent(sponsorAssetId2Reissue)

val assetInfoAfterReissue = sponsor.assetsDetails(sponsorAssetId2)
assetInfoAfterReissue.minSponsoredAssetFee shouldBe Some(Token)
assetInfoAfterReissue.quantity shouldBe sponsorAssetTotal / 2 + sponsorAssetTotal
assetInfoAfterReissue.reissuable shouldBe true

val aliceTransferWaves = alice.transfer(alice.address, bob.address, transferAmount, SmallFee, None, Some(sponsorAssetId2)).id
nodes.waitForHeightAriseAndTxPresent(aliceTransferWaves)
nodes.waitForHeightArise()

val totalWavesFee = Sponsorship.FeeUnit * SmallFee / Token + issueFee + sponsorFee + burnFee + minFee + issueFee
miner.assertBalances(miner.address, minerBalance._1 + totalWavesFee)
Expand All @@ -339,11 +349,12 @@ class SponsorshipSuite extends FreeSpec with NodesFromDocker with Matchers with
val transferTxToAlice =
miner.transfer(miner.address, alice.address, sponsorAssetTotal / 2, SmallFee, Some(minersSpondorAssetId), Some(minersSpondorAssetId)).id
nodes.waitForHeightAriseAndTxPresent(transferTxToAlice)
nodes.waitForHeightArise()

miner.assertBalances(miner.address, minerBalance._1)
val aliceSponsoredTransferWaves = alice.transfer(alice.address, bob.address, transferAmount, SmallFee, None, Some(minersSpondorAssetId)).id
nodes.waitForHeightAriseAndTxPresent(aliceSponsoredTransferWaves)
nodes.waitForHeightAriseAndTxPresent(aliceSponsoredTransferWaves)
nodes.waitForHeightArise()

miner.assertBalances(miner.address, minerBalance._1)
miner.assertAssetBalance(miner.address, minersSpondorAssetId, sponsorAssetTotal / 2 + SmallFee)
Expand Down

0 comments on commit 43f7e2d

Please sign in to comment.