context: read item key in LE

Hi, neo-project/neo#938.
This commit is contained in:
Roman Khimov 2021-07-23 12:41:09 +03:00
parent efb67a0ea3
commit 6103da8d10

View file

@ -168,7 +168,7 @@ func (c ParameterContext) MarshalJSON() ([]byte, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
items["0x"+u.StringBE()] = data items["0x"+u.StringLE()] = data
} }
pc := &paramContext{ pc := &paramContext{
Type: c.Type, Type: c.Type,
@ -200,7 +200,7 @@ func (c *ParameterContext) UnmarshalJSON(data []byte) error {
} }
items := make(map[util.Uint160]*Item, len(pc.Items)) items := make(map[util.Uint160]*Item, len(pc.Items))
for h := range pc.Items { for h := range pc.Items {
u, err := util.Uint160DecodeStringBE(strings.TrimPrefix(h, "0x")) u, err := util.Uint160DecodeStringLE(strings.TrimPrefix(h, "0x"))
if err != nil { if err != nil {
return err return err
} }