Skip to content
9 changes: 5 additions & 4 deletions gnovm/pkg/gnolang/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,11 @@ func (ml MapList) MarshalAmino() (MapListImage, error) {
}

func (ml *MapList) UnmarshalAmino(mlimg MapListImage) error {
for i, item := range mlimg.List {
if i == 0 {
for _, item := range mlimg.List {
if ml.Head == nil {
item.Prev = nil
ml.Head = item
ml.Tail = item
item.Prev = nil
} else {
item.Prev = ml.Tail
ml.Tail.Next = item
Expand All @@ -674,15 +674,16 @@ func (ml *MapList) UnmarshalAmino(mlimg MapListImage) error {
func (ml *MapList) Append(alloc *Allocator, key TypedValue) *MapListItem {
alloc.AllocateMapItem()
item := &MapListItem{
Prev: ml.Tail,
Next: nil,
Key: key,
// Value: undefined,
}
if ml.Head == nil {
item.Prev = nil
ml.Head = item
ml.Tail = item
} else {
item.Prev = ml.Tail
ml.Tail.Next = item
ml.Tail = item
}
Expand Down
Loading