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)
// reverse scriptHash to be consistent with other client
scriptHash, err := util.Uint160DecodeBytesBE(a.ScriptHash.BytesLE())
if err != nil {
scriptHash = a.ScriptHash
}
scriptHash := a.ScriptHash.Reverse()
return AccountState{
Version: a.Version,