core: fix GetUtilityTokenBalance

The value stored in NEP5 tracker for GAS is Fixed8 already, so we need to
type-cast it, but not multiply by 10⁸ again.
This commit is contained in:
Roman Khimov 2020-05-27 22:55:40 +03:00
parent 7e586cc6ab
commit bf6525e54d

View file

@ -927,7 +927,7 @@ func (bc *Blockchain) GetNEP5Balances(acc util.Uint160) *state.NEP5Balances {
// GetUtilityTokenBalance returns utility token (GAS) balance for the acc.
func (bc *Blockchain) GetUtilityTokenBalance(acc util.Uint160) util.Fixed8 {
return util.Fixed8FromInt64(bc.GetNEP5Balances(acc).Trackers[bc.contracts.GAS.Hash].Balance)
return util.Fixed8(bc.GetNEP5Balances(acc).Trackers[bc.contracts.GAS.Hash].Balance)
}
// LastBatch returns last persisted storage batch.