Skip to content

Commit

Permalink
fix-balances-0.15.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Potanin committed Mar 10, 2019
1 parent 44f81e6 commit 42cbdf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ class WavesEnvironment(nByte: Byte, in: Coeval[Transaction :+: Order :+: CNil],
}
address <- blockchain.resolveAlias(aoa)
balance = blockchain.balance(address, maybeAssetId.map(ByteStr(_)))
safeBalance <- Either.cond(balance != 0L || blockchain.balance(address, None) == 0L, balance, "Balance of absent asset")
} yield safeBalance).left.map(_.toString)
} yield balance).left.map(_.toString)
}
override def transactionHeightById(id: Array[Byte]): Option[Long] =
blockchain.transactionHeight(ByteStr(id)).map(_.toLong)
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/com/wavesplatform/state/CommonSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CommonSpec extends FreeSpec with Matchers with WithDomain with Transaction
case (sender, initialBalance, assetId) =>
withDomain() { d =>
d.appendBlock(genesisBlock(nextTs, sender, initialBalance))
// d.portfolio(sender).balanceOf(Some(ByteStr(assetId))) shouldEqual 0L
d.portfolio(sender).balanceOf(Some(ByteStr(assetId))) shouldEqual 0L
}
}
}
Expand Down

0 comments on commit 42cbdf5

Please sign in to comment.