diff --git a/x/observer/client/cli/tx_vote_blame.go b/x/observer/client/cli/tx_vote_blame.go index db4aadb1a0..79da0befa5 100644 --- a/x/observer/client/cli/tx_vote_blame.go +++ b/x/observer/client/cli/tx_vote_blame.go @@ -48,7 +48,7 @@ func CmdVoteBlame() *cobra.Command { if err != nil { return err } - blameNodes := types.ConvertNodes(nodes) + blameNodes := ConvertNodes(nodes) blameInfo := types.Blame{ Index: index, FailureReason: failureReason, diff --git a/x/observer/client/cli/utils.go b/x/observer/client/cli/utils.go new file mode 100644 index 0000000000..0c485781c5 --- /dev/null +++ b/x/observer/client/cli/utils.go @@ -0,0 +1,19 @@ +package cli + +import ( + "gitlab.com/thorchain/tss/go-tss/blame" + + "github.com/zeta-chain/node/x/observer/types" +) + +func ConvertNodes(n []blame.Node) (nodes []*types.Node) { + for _, node := range n { + var entry types.Node + entry.PubKey = node.Pubkey + entry.BlameSignature = node.BlameSignature + entry.BlameData = node.BlameData + + nodes = append(nodes, &entry) + } + return +} diff --git a/x/observer/types/utils_test.go b/x/observer/client/cli/utils_test.go similarity index 95% rename from x/observer/types/utils_test.go rename to x/observer/client/cli/utils_test.go index 9a379ac495..9973f101e9 100644 --- a/x/observer/types/utils_test.go +++ b/x/observer/client/cli/utils_test.go @@ -1,4 +1,4 @@ -package types_test +package cli import ( "testing" @@ -49,7 +49,7 @@ func TestConvertNodes(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - result := types.ConvertNodes(tt.input) + result := ConvertNodes(tt.input) require.Equal(t, tt.expected, result) }) } diff --git a/x/observer/types/utils.go b/x/observer/types/utils.go deleted file mode 100644 index 009b419168..0000000000 --- a/x/observer/types/utils.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -import "gitlab.com/thorchain/tss/go-tss/blame" - -func ConvertNodes(n []blame.Node) (nodes []*Node) { - for _, node := range n { - var entry Node - entry.PubKey = node.Pubkey - entry.BlameSignature = node.BlameSignature - entry.BlameData = node.BlameData - - nodes = append(nodes, &entry) - } - return -} diff --git a/zetaclient/zetacore/client_vote.go b/zetaclient/zetacore/client_vote.go index e631923964..9dcea8c2aa 100644 --- a/zetaclient/zetacore/client_vote.go +++ b/zetaclient/zetacore/client_vote.go @@ -10,6 +10,7 @@ import ( "github.com/zeta-chain/node/pkg/proofs" "github.com/zeta-chain/node/pkg/retry" "github.com/zeta-chain/node/x/crosschain/types" + observerclient "github.com/zeta-chain/node/x/observer/client/cli" observertypes "github.com/zeta-chain/node/x/observer/types" zctx "github.com/zeta-chain/node/zetaclient/context" ) @@ -109,7 +110,7 @@ func (c *Client) PostVoteBlameData( zetaBlame := observertypes.Blame{ Index: index, FailureReason: blame.FailReason, - Nodes: observertypes.ConvertNodes(blame.BlameNodes), + Nodes: observerclient.ConvertNodes(blame.BlameNodes), } msg := observertypes.NewMsgVoteBlameMsg(signerAddress, chainID, zetaBlame)