util: add Uint160.Reverse()

This commit is contained in:
Evgenii Stratonikov 2019-12-03 16:07:15 +03:00
parent 9e04e61533
commit 09b295d727
2 changed files with 18 additions and 0 deletions

View file

@ -94,3 +94,12 @@ func TestUInt160String(t *testing.T) {
assert.Equal(t, hexStr, val.String())
assert.Equal(t, hexRevStr, val.StringLE())
}
func TestUint160_Reverse(t *testing.T) {
hexStr := "b28427088a3729b2536d10122960394e8be6721f"
val, err := Uint160DecodeStringBE(hexStr)
require.NoError(t, err)
assert.Equal(t, hexStr, val.Reverse().StringLE())
assert.Equal(t, val, val.Reverse().Reverse())
}