rpc: refactor code of NewAccountState function

Simplified reversing of scriptHash
This commit is contained in:
Anna Shaleva 2020-02-15 19:23:11 +03:00 committed by AnnaShaleva
parent f310145612
commit b8715ddf11

View file

@ -45,10 +45,7 @@ func NewAccountState(a *state.Account) AccountState {
sort.Sort(balances) sort.Sort(balances)
// reverse scriptHash to be consistent with other client // reverse scriptHash to be consistent with other client
scriptHash, err := util.Uint160DecodeBytesBE(a.ScriptHash.BytesLE()) scriptHash := a.ScriptHash.Reverse()
if err != nil {
scriptHash = a.ScriptHash
}
return AccountState{ return AccountState{
Version: a.Version, Version: a.Version,