Skip to content

Commit

Permalink
Update primitive.go
Browse files Browse the repository at this point in the history
We can't just ignore the policy id here. When two assets with different policies have the same name (eg default values like "Asset 1" or empty, this overwrites previously set values and returns wrong results)
  • Loading branch information
sean118 authored and echovl committed Nov 15, 2022
1 parent c2042aa commit 5d486b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion primitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ func (ma MultiAsset) String() string {
vMap := map[string]uint64{}
for _, pool := range ma.Keys() {
for _, assets := range ma.Get(pool).Keys() {
vMap[assets.String()] = uint64(ma.Get(pool).Get(assets))
key := fmt.Sprintf("%s %s", pool.String(), assets.String())
vMap[key] = uint64(ma.Get(pool).Get(assets))
}
}
return fmt.Sprintf("%+v", vMap)
Expand Down

0 comments on commit 5d486b0

Please sign in to comment.