Get-balance returns the wrong balance
Description
Morley-client doesn't always return the correct balance for some addresses.
Steps to reproduce
Repro 1
Using the following address, from carthagenet: tz1PPPYChg5xXHpGzygnNkmzPd1hyVRMxvJf
The tezos-client and the RPC both return the following balance: 67644122642
.
However, the morley-client returns: 3219613202
GET http://carthage.testnet.tezos.serokell.team:8732/chains/main/blocks/head/context/contracts/tz1PPPYChg5xXHpGzygnNkmzPd1hyVRMxvJf/balance
"67644122642"
tezos-client get balance for tz1PPPYChg5xXHpGzygnNkmzPd1hyVRMxvJf
67644.122642 ꜩ
morley-client get-balance --addr tz1PPPYChg5xXHpGzygnNkmzPd1hyVRMxvJf
3219613202 μꜩ
I tried this with other addresses, and morley-client returns the correct number. I'm not sure which circumstances trigger this behaviour.
Repro 2
Using the following address: KT1Vw3Zt8JLdfZMvdRVdTfAaZmAAcUz7SHcA
Morley-client returns -0
, whereas tezos-client and the RPC return 0.
morley-client get-balance --addr KT1Vw3Zt8JLdfZMvdRVdTfAaZmAAcUz7SHcA
-0 μꜩ
Expected behaviour
I expected to get "67644122642" for the first address, and "0" for the second.
Actual behaviour
I got "3219613202" and "-0"
Environment
Branch: Master, HEAD (cfef7cfd)
Edited by Diogo Castro