Skip to content

Commit

Permalink
Make copy of metadata map (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrel-b authored Aug 31, 2023
1 parent 52fd739 commit e6a0c24
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion service/multichain/reservoir/reservoir.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,12 @@ func (d *Provider) fetchReservoirMetadata(ctx context.Context, ti multichain.Cha
if err != nil {
return nil, err
}
meta := token.Metadata

meta := make(persist.TokenMetadata, len(token.Metadata))
for k, v := range token.Metadata {
meta[k] = v
}

if _, ok := util.FindFirstFieldFromMap(meta, "image", "image_url", "imageURL").(string); !ok {
meta["image_url"] = token.Image
}
Expand Down

0 comments on commit e6a0c24

Please sign in to comment.