Skip to content

Commit 034c570

Browse files
authored
Node/Acct: Add parameter checks (wormhole-foundation#3907)
1 parent a566c3d commit 034c570

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

node/cmd/guardiand/node.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,10 @@ func runNode(cmd *cobra.Command, args []string) {
11511151

11521152
var accountantWormchainConn, accountantNttWormchainConn *wormconn.ClientConn
11531153
if *accountantContract != "" {
1154+
if *wormchainURL == "" {
1155+
logger.Fatal("if accountantContract is specified, wormchainURL is required", zap.String("component", "gacct"))
1156+
}
1157+
11541158
if *accountantKeyPath == "" {
11551159
logger.Fatal("if accountantContract is specified, accountantKeyPath is required", zap.String("component", "gacct"))
11561160
}
@@ -1183,6 +1187,10 @@ func runNode(cmd *cobra.Command, args []string) {
11831187

11841188
// If the NTT accountant is enabled, create a wormchain connection for it.
11851189
if *accountantNttContract != "" {
1190+
if *wormchainURL == "" {
1191+
logger.Fatal("if accountantNttContract is specified, wormchainURL is required", zap.String("component", "gacct"))
1192+
}
1193+
11861194
if *accountantNttKeyPath == "" {
11871195
logger.Fatal("if accountantNttContract is specified, accountantNttKeyPath is required", zap.String("component", "gacct"))
11881196
}

node/pkg/node/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func GuardianOptionAccountant(
147147
}
148148

149149
if websocket == "" {
150-
return errors.New("if accountantContract is specified, accountantWS is required")
150+
return errors.New("if either accountantContract or accountantNttContract is specified, accountantWS is required")
151151
}
152152
if contract != "" {
153153
if wormchainConn == nil {

0 commit comments

Comments
 (0)