From feab6543e571a9f0d12576d4ef473b3223587c82 Mon Sep 17 00:00:00 2001 From: Joe Bowman Date: Thu, 17 Aug 2023 22:38:59 +0400 Subject: [PATCH] remove unused method (#535) Co-authored-by: Alex Johnson --- x/interchainstaking/types/receipt.go | 11 ----- x/interchainstaking/types/receipt_test.go | 52 ----------------------- 2 files changed, 63 deletions(-) delete mode 100644 x/interchainstaking/types/receipt.go delete mode 100644 x/interchainstaking/types/receipt_test.go diff --git a/x/interchainstaking/types/receipt.go b/x/interchainstaking/types/receipt.go deleted file mode 100644 index 2ec2b96e7..000000000 --- a/x/interchainstaking/types/receipt.go +++ /dev/null @@ -1,11 +0,0 @@ -package types - -import abcitypes "github.com/tendermint/tendermint/abci/types" - -func AttributesToMap(attrs []abcitypes.EventAttribute) map[string]string { - out := make(map[string]string) - for _, attr := range attrs { - out[string(attr.Key)] = string(attr.Value) - } - return out -} diff --git a/x/interchainstaking/types/receipt_test.go b/x/interchainstaking/types/receipt_test.go deleted file mode 100644 index 282c1e628..000000000 --- a/x/interchainstaking/types/receipt_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package types_test - -import ( - "strconv" - "testing" - - "github.com/stretchr/testify/require" - abcitypes "github.com/tendermint/tendermint/abci/types" - - "github.com/ingenuity-build/quicksilver/x/interchainstaking/types" -) - -func TestAttributesToMap(t *testing.T) { - tests := []struct { - name string - events []abcitypes.EventAttribute - want map[string]string - }{ - { - name: "parse valid", - events: []abcitypes.EventAttribute{ - { - Key: []byte("sender"), - Value: []byte("sender"), - Index: false, - }, - { - Key: []byte("recipient"), - Value: []byte("recipient"), - Index: false, - }, - { - Key: []byte("amount"), - Value: []byte(strconv.Itoa(100)), - Index: false, - }, - }, - want: map[string]string{ - "sender": "sender", - "recipient": "recipient", - "amount": strconv.Itoa(100), - }, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - actual := types.AttributesToMap(tc.events) - require.Equal(t, tc.want, actual) - }) - } -}