Skip to content

Commit

Permalink
chore: remove go-tss imports from observer/types
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Aug 30, 2024
1 parent 91c323d commit 78fca03
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
3 changes: 2 additions & 1 deletion x/observer/client/cli/tx_vote_blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"gitlab.com/thorchain/tss/go-tss/blame"

"github.com/zeta-chain/zetacore/x/observer/types"
"github.com/zeta-chain/zetacore/x/observer/utils"
)

func CmdVoteBlame() *cobra.Command {
Expand Down Expand Up @@ -48,7 +49,7 @@ func CmdVoteBlame() *cobra.Command {
if err != nil {
return err
}
blameNodes := types.ConvertNodes(nodes)
blameNodes := utils.ConvertNodes(nodes)
blameInfo := types.Blame{
Index: index,
FailureReason: failureReason,
Expand Down
15 changes: 0 additions & 15 deletions x/observer/types/utils.go

This file was deleted.

18 changes: 18 additions & 0 deletions x/observer/utils/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package utils

import (
"github.com/zeta-chain/zetacore/x/observer/types"
"gitlab.com/thorchain/tss/go-tss/blame"
)

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
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package types_test
package utils

import (
"testing"
Expand Down Expand Up @@ -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)
})
}
Expand Down
3 changes: 2 additions & 1 deletion zetaclient/zetacore/client_vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/zeta-chain/zetacore/pkg/retry"
"github.com/zeta-chain/zetacore/x/crosschain/types"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
observerutils "github.com/zeta-chain/zetacore/x/observer/utils"
zctx "github.com/zeta-chain/zetacore/zetaclient/context"
)

Expand Down Expand Up @@ -109,7 +110,7 @@ func (c *Client) PostVoteBlameData(
zetaBlame := observertypes.Blame{
Index: index,
FailureReason: blame.FailReason,
Nodes: observertypes.ConvertNodes(blame.BlameNodes),
Nodes: observerutils.ConvertNodes(blame.BlameNodes),
}
msg := observertypes.NewMsgVoteBlameMsg(signerAddress, chainID, zetaBlame)

Expand Down

0 comments on commit 78fca03

Please sign in to comment.