Skip to content

Commit

Permalink
node changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nitronit committed Jan 28, 2024
1 parent 063e0d2 commit 2e39f23
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/node/node_grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
This is the NodeGRPCServer. It is the GRPC server for the node.
*/

// TODO: Remove this as we want NodeGRPCServer to NodeGRPCServer
var _ proto.CosignerServer = &NodeGRPCServer{}

type NodeGRPCServer struct {

Check warning on line 23 in src/node/node_grpc_server.go

View workflow job for this annotation

GitHub Actions / lint

exported: type name will be used as node.NodeGRPCServer by other packages, and that stutters; consider calling this GRPCServer (revive)
Expand Down
2 changes: 0 additions & 2 deletions src/node/raft_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
"google.golang.org/grpc/reflection"
)

var _ ILeader = (*RaftStore)(nil)

const (
retainSnapshotCount = 2
)
Expand Down
2 changes: 2 additions & 0 deletions src/node/raft_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"github.com/stretchr/testify/require"
)

var _ node.ILeader = (*node.RaftStore)(nil)

// Test_StoreInMemOpenSingleNode tests that a command can be applied to the log
// stored in RAM.
func Test_StoreInMemOpenSingleNode(t *testing.T) {
Expand Down
3 changes: 0 additions & 3 deletions src/node/single_signer_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ import (
"time"

"github.com/strangelove-ventures/horcrux/src/config"
"github.com/strangelove-ventures/horcrux/src/connector"

"github.com/strangelove-ventures/horcrux/src/types"
)

var _ connector.IPrivValidator = &SingleSignerValidator{}

// SingleSignerValidator guards access to an underlying PrivValidator by using mutexes
// for each of the PrivValidator interface functions
type SingleSignerValidator struct {
Expand Down
3 changes: 3 additions & 0 deletions src/node/single_signer_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/strangelove-ventures/horcrux/src/config"
"github.com/strangelove-ventures/horcrux/src/connector"
"github.com/strangelove-ventures/horcrux/src/node"
"github.com/strangelove-ventures/horcrux/src/types"

Expand All @@ -27,6 +28,8 @@ const (
BitSize = 4096
)

var _ connector.IPrivValidator = &node.SingleSignerValidator{}

func TestSingleSignerValidator(t *testing.T) {
t.Skip("TODO: fix this test when run with 'make test'")

Expand Down
3 changes: 0 additions & 3 deletions src/node/threshold_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/strangelove-ventures/horcrux/src/cosigner"

"github.com/strangelove-ventures/horcrux/src/config"
"github.com/strangelove-ventures/horcrux/src/connector"
"github.com/strangelove-ventures/horcrux/src/metrics"

"github.com/strangelove-ventures/horcrux/src/types"
Expand All @@ -26,8 +25,6 @@ import (
"google.golang.org/grpc/status"
)

var _ connector.IPrivValidator = &ThresholdValidator{}

// TODO: Must be a better way to do this?
type nodecacheconfigs struct {
defaultGetNoncesInterval time.Duration
Expand Down
4 changes: 3 additions & 1 deletion src/node/threshold_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/strangelove-ventures/horcrux/src/config"
"github.com/strangelove-ventures/horcrux/src/connector"
"github.com/strangelove-ventures/horcrux/src/cosigner"
"github.com/strangelove-ventures/horcrux/src/cosigner/nodesecurity"
"github.com/strangelove-ventures/horcrux/src/node"
Expand All @@ -34,7 +35,8 @@ import (
)

var (
testConfig *config.RuntimeConfig // use this global config in tests
testConfig *config.RuntimeConfig // use this global config in tests
_ connector.IPrivValidator = &node.ThresholdValidator{}
)

const (
Expand Down

0 comments on commit 2e39f23

Please sign in to comment.