diff --git a/types/tags.go b/types/tags.go index 5a94e9bde8..95a826fd78 100644 --- a/types/tags.go +++ b/types/tags.go @@ -21,8 +21,8 @@ func (t Tags) AppendTag(k string, v []byte) Tags { } // Append two lists of tags -func AppendTags(a, b Tags) Tags { - return append(a, b...) +func (t Tags) AppendTags(a Tags) Tags { + return append(t, a...) } // New variadic tags, must be k string, v []byte repeating diff --git a/types/tags_test.go b/types/tags_test.go index 84dc10b33d..4ef5561240 100644 --- a/types/tags_test.go +++ b/types/tags_test.go @@ -9,7 +9,7 @@ import ( func TestAppendTags(t *testing.T) { a := NewTags("a", []byte("1")) b := NewTags("b", []byte("2")) - c := AppendTags(a, b) + c := a.AppendTags(b) require.Equal(t, c, Tags{MakeTag("a", []byte("1")), MakeTag("b", []byte("2"))}) } diff --git a/x/bank/keeper.go b/x/bank/keeper.go index 8a73b964df..d23167c3c5 100644 --- a/x/bank/keeper.go +++ b/x/bank/keeper.go @@ -167,7 +167,7 @@ func sendCoins(ctx sdk.Context, am sdk.AccountMapper, fromAddr sdk.Address, toAd return nil, err } - return sdk.AppendTags(subTags, addTags), nil + return subTags.AppendTags(addTags), nil } // InputOutputCoins handles a list of inputs and outputs @@ -180,7 +180,7 @@ func inputOutputCoins(ctx sdk.Context, am sdk.AccountMapper, inputs []Input, out if err != nil { return nil, err } - allTags = sdk.AppendTags(allTags, tags) + allTags = allTags.AppendTags(tags) } for _, out := range outputs { @@ -188,7 +188,7 @@ func inputOutputCoins(ctx sdk.Context, am sdk.AccountMapper, inputs []Input, out if err != nil { return nil, err } - allTags = sdk.AppendTags(allTags, tags) + allTags = allTags.AppendTags(tags) } return allTags, nil