diff --git a/it/src/main/scala/com/wavesplatform/it/api/SyncHttpApi.scala b/it/src/main/scala/com/wavesplatform/it/api/SyncHttpApi.scala index f8c1edf8ff1..38b15672d1b 100644 --- a/it/src/main/scala/com/wavesplatform/it/api/SyncHttpApi.scala +++ b/it/src/main/scala/com/wavesplatform/it/api/SyncHttpApi.scala @@ -33,6 +33,12 @@ object SyncHttpApi extends Assertions{ def assertAssetBalance(acc: String, assetIdString: String, balance: Long): Unit = Await.result(async(n).assertAssetBalance(acc, assetIdString, balance), RequestAwaitTime) + def assetBalance(address: String, asset: String): AssetBalance = + Await.result(async(n).assetBalance(address, asset), RequestAwaitTime) + + def assetsBalance(address: String): FullAssetsInfo = + Await.result(async(n).assetsBalance(address), RequestAwaitTime) + def issue(sourceAddress: String, name: String, description: String, quantity: Long, decimals: Byte, reissuable: Boolean, fee: Long): Transaction = Await.result(async(n).issue(sourceAddress, name, description, quantity, decimals, reissuable, fee), RequestAwaitTime) diff --git a/it/src/test/scala/com/wavesplatform/it/transactions/BurnTransactionSuite2.scala b/it/src/test/scala/com/wavesplatform/it/transactions/BurnTransactionSuite2.scala index 0927d87eb98..f0b5d6a4a5a 100644 --- a/it/src/test/scala/com/wavesplatform/it/transactions/BurnTransactionSuite2.scala +++ b/it/src/test/scala/com/wavesplatform/it/transactions/BurnTransactionSuite2.scala @@ -17,11 +17,23 @@ class BurnTransactionSuite2 extends BaseTransactionSuite { notMiner.assertBalances(firstAddress, balance - defaultFee, effectiveBalance - defaultFee) notMiner.assertAssetBalance(firstAddress, issuedAssetId, defaultQuantity) + // burn half of the coins and check balance val burnId = sender.burn(firstAddress, issuedAssetId, defaultQuantity / 2, fee = defaultFee).id nodes.waitForHeightAraiseAndTxPresent(burnId) notMiner.assertBalances(firstAddress, balance - 2 * defaultFee, effectiveBalance - 2 * defaultFee) notMiner.assertAssetBalance(firstAddress, issuedAssetId, defaultQuantity / 2) + val assetOpt = notMiner.assetsBalance(firstAddress).balances.find(_.assetId == issuedAssetId) + assert(assetOpt.exists(_.balance == defaultQuantity / 2)) + + // burn the rest and check again + val burnIdRest = sender.burn(firstAddress, issuedAssetId, defaultQuantity / 2, fee = defaultFee).id + + nodes.waitForHeightAraiseAndTxPresent(burnIdRest) + notMiner.assertAssetBalance(firstAddress, issuedAssetId, 0) + + val assetOptRest = notMiner.assetsBalance(firstAddress).balances.find(_.assetId == issuedAssetId) + assert(assetOptRest.isEmpty) } }