From 2e39f23ec0fb950b2c8bead92ea83bfcc6fc01fe Mon Sep 17 00:00:00 2001 From: r4f43l Date: Sun, 28 Jan 2024 22:17:17 +0100 Subject: [PATCH] node changes --- src/node/node_grpc_server.go | 1 + src/node/raft_store.go | 2 -- src/node/raft_store_test.go | 2 ++ src/node/single_signer_validator.go | 3 --- src/node/single_signer_validator_test.go | 3 +++ src/node/threshold_validator.go | 3 --- src/node/threshold_validator_test.go | 4 +++- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/node/node_grpc_server.go b/src/node/node_grpc_server.go index c5fa326a..a32bce2b 100644 --- a/src/node/node_grpc_server.go +++ b/src/node/node_grpc_server.go @@ -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 { diff --git a/src/node/raft_store.go b/src/node/raft_store.go index f46b4e10..65ab25b4 100644 --- a/src/node/raft_store.go +++ b/src/node/raft_store.go @@ -36,8 +36,6 @@ import ( "google.golang.org/grpc/reflection" ) -var _ ILeader = (*RaftStore)(nil) - const ( retainSnapshotCount = 2 ) diff --git a/src/node/raft_store_test.go b/src/node/raft_store_test.go index fec40cf7..b47bdb88 100644 --- a/src/node/raft_store_test.go +++ b/src/node/raft_store_test.go @@ -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) { diff --git a/src/node/single_signer_validator.go b/src/node/single_signer_validator.go index 60796e28..5b05e33a 100644 --- a/src/node/single_signer_validator.go +++ b/src/node/single_signer_validator.go @@ -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 { diff --git a/src/node/single_signer_validator_test.go b/src/node/single_signer_validator_test.go index 125bd52d..28bcadd8 100644 --- a/src/node/single_signer_validator_test.go +++ b/src/node/single_signer_validator_test.go @@ -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" @@ -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'") diff --git a/src/node/threshold_validator.go b/src/node/threshold_validator.go index a3f56956..cb93acfc 100644 --- a/src/node/threshold_validator.go +++ b/src/node/threshold_validator.go @@ -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" @@ -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 diff --git a/src/node/threshold_validator_test.go b/src/node/threshold_validator_test.go index 9f5a5612..22fd4fb6 100644 --- a/src/node/threshold_validator_test.go +++ b/src/node/threshold_validator_test.go @@ -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" @@ -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 (