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 47a0609 commit ac5787b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion x/observer/client/cli/tx_vote_blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 19 additions & 0 deletions x/observer/client/cli/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cli

import (
"gitlab.com/thorchain/tss/go-tss/blame"

"github.com/zeta-chain/zetacore/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
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package types_test
package cli

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
15 changes: 0 additions & 15 deletions x/observer/types/utils.go

This file was deleted.

3 changes: 2 additions & 1 deletion zetaclient/zetacore/client_vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/zeta-chain/zetacore/pkg/proofs"
"github.com/zeta-chain/zetacore/pkg/retry"
"github.com/zeta-chain/zetacore/x/crosschain/types"
observerclient "github.com/zeta-chain/zetacore/x/observer/client/cli"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
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: observerclient.ConvertNodes(blame.BlameNodes),
}
msg := observertypes.NewMsgVoteBlameMsg(signerAddress, chainID, zetaBlame)

Expand Down

0 comments on commit ac5787b

Please sign in to comment.