From 670117f601b5e9ee32584347cc46d55258eb8733 Mon Sep 17 00:00:00 2001 From: tbjump Date: Thu, 8 Jun 2023 21:17:05 +0000 Subject: [PATCH] node/node: add GuardianOptionNoAccountant --- node/pkg/node/node.go | 9 +++++++++ node/pkg/node/node_test.go | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/node/pkg/node/node.go b/node/pkg/node/node.go index afd7a4113..a4aec0f55 100644 --- a/node/pkg/node/node.go +++ b/node/pkg/node/node.go @@ -85,6 +85,15 @@ func GuardianOptionP2P(p2pKey libp2p_crypto.PrivKey, networkId string, bootstrap }} } +func GuardianOptionNoAccountant() *GuardianOption { + return &GuardianOption{ + name: "accountant", + f: func(ctx context.Context, logger *zap.Logger, g *G) error { + logger.Info("acct: accountant is disabled", zap.String("component", "gacct")) + return nil + }} +} + // GuardianOptionAccountant configures the Accountant module. // Requires: wormchainConn func GuardianOptionAccountant(contract string, websocket string, enforcing bool, wormchainConn *wormconn.ClientConn) *GuardianOption { diff --git a/node/pkg/node/node_test.go b/node/pkg/node/node_test.go index d5bd3da54..03e4a4098 100644 --- a/node/pkg/node/node_test.go +++ b/node/pkg/node/node_test.go @@ -155,8 +155,8 @@ func mockGuardianRunnable(gs []*mockGuardian, mockGuardianIndex uint, obsDb mock guardianOptions := []*GuardianOption{ GuardianOptionDatabase(db), GuardianOptionWatchers(watcherConfigs, nil), - GuardianOptionAccountant("", "", false, nil), // effectively disable accountant - GuardianOptionGovernor(false), // disable governor + GuardianOptionNoAccountant(), // disable accountant + GuardianOptionGovernor(false), // disable governor GuardianOptionP2P(gs[mockGuardianIndex].p2pKey, networkID, bootstrapPeers, nodeName, false, p2pPort, func() string { return "" }), GuardianOptionPublicRpcSocket(publicSocketPath, common.GrpcLogDetailFull), GuardianOptionPublicrpcTcpService(publicRpc, common.GrpcLogDetailFull),