Skip to content

Commit

Permalink
Guardian should be able to set disableHeartbeatVerify
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Jun 27, 2024
1 parent f579657 commit dc10374
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions node/pkg/node/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func GuardianOptionP2P(p2pKey libp2p_crypto.PrivKey, networkId, bootstrapPeers,
g.obsvReqSendC.readC,
g.acct,
g.gov,
disableHeartbeatVerify,
components,
ibcFeaturesFunc,
(g.gatewayRelayer != nil), // gatewayRelayerEnabled,
Expand Down
4 changes: 3 additions & 1 deletion node/pkg/p2p/run_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type (
// WithChainGovernorStatusListener is optional and can be set with `WithChainGovernorStatusListener`.
signedGovSt chan *gossipv1.SignedChainGovernorStatus

// disableHeartbeatVerify is optional and can be set with `WithDisableHeartbeatVerify`.
// disableHeartbeatVerify is optional and can be set with `WithDisableHeartbeatVerify` or `WithGuardianOptions`.
disableHeartbeatVerify bool

// The following options are guardian specific. Set with `WithGuardianOptions`.
Expand Down Expand Up @@ -154,6 +154,7 @@ func WithGuardianOptions(
obsvReqSendC <-chan *gossipv1.ObservationRequest,
acct *accountant.Accountant,
gov *governor.ChainGovernor,
disableHeartbeatVerify bool,
components *Components,
ibcFeaturesFunc func() string,
gatewayRelayerEnabled bool,
Expand All @@ -174,6 +175,7 @@ func WithGuardianOptions(
p.obsvReqSendC = obsvReqSendC
p.acct = acct
p.gov = gov
p.disableHeartbeatVerify = disableHeartbeatVerify
p.components = components
p.ibcFeaturesFunc = ibcFeaturesFunc
p.gatewayRelayerEnabled = gatewayRelayerEnabled
Expand Down
2 changes: 2 additions & 0 deletions node/pkg/p2p/run_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func TestRunParamsWithGuardianOptions(t *testing.T) {

acct := &accountant.Accountant{}
gov := &governor.ChainGovernor{}
disableHeartbeatVerify := false
components := &Components{}
ibcFeaturesFunc := func() string { return "Hello, World!" }
gatewayRelayerEnabled := true
Expand Down Expand Up @@ -175,6 +176,7 @@ func TestRunParamsWithGuardianOptions(t *testing.T) {
obsvReqSendC,
acct,
gov,
disableHeartbeatVerify,
components,
ibcFeaturesFunc,
gatewayRelayerEnabled,
Expand Down
1 change: 1 addition & 0 deletions node/pkg/p2p/watermark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func startGuardian(t *testing.T, ctx context.Context, g *G) {
g.obsvReqSendC,
g.acct,
g.gov,
g.disableHeartbeatVerify,
g.components,
nil, //g.ibcFeaturesFunc,
false, // gateway relayer enabled
Expand Down

0 comments on commit dc10374

Please sign in to comment.