From 5d486b0c6bdd44de894eeabec0755234f3fa3cd8 Mon Sep 17 00:00:00 2001 From: sean Date: Tue, 15 Nov 2022 14:33:57 +0100 Subject: [PATCH] Update primitive.go 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) --- primitive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/primitive.go b/primitive.go index 504ce1a..64fe7b7 100644 --- a/primitive.go +++ b/primitive.go @@ -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)