Node/Acct: Add parameter checks
This commit is contained in:
parent
a566c3d3bf
commit
18b52a3f24
|
@ -1151,6 +1151,10 @@ func runNode(cmd *cobra.Command, args []string) {
|
|||
|
||||
var accountantWormchainConn, accountantNttWormchainConn *wormconn.ClientConn
|
||||
if *accountantContract != "" {
|
||||
if *wormchainURL == "" {
|
||||
logger.Fatal("if accountantContract is specified, wormchainURL is required", zap.String("component", "gacct"))
|
||||
}
|
||||
|
||||
if *accountantKeyPath == "" {
|
||||
logger.Fatal("if accountantContract is specified, accountantKeyPath is required", zap.String("component", "gacct"))
|
||||
}
|
||||
|
@ -1183,6 +1187,10 @@ func runNode(cmd *cobra.Command, args []string) {
|
|||
|
||||
// If the NTT accountant is enabled, create a wormchain connection for it.
|
||||
if *accountantNttContract != "" {
|
||||
if *wormchainURL == "" {
|
||||
logger.Fatal("if accountantNttContract is specified, wormchainURL is required", zap.String("component", "gacct"))
|
||||
}
|
||||
|
||||
if *accountantNttKeyPath == "" {
|
||||
logger.Fatal("if accountantNttContract is specified, accountantNttKeyPath is required", zap.String("component", "gacct"))
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ func GuardianOptionAccountant(
|
|||
}
|
||||
|
||||
if websocket == "" {
|
||||
return errors.New("if accountantContract is specified, accountantWS is required")
|
||||
return errors.New("if either accountantContract or accountantNttContract is specified, accountantWS is required")
|
||||
}
|
||||
if contract != "" {
|
||||
if wormchainConn == nil {
|
||||
|
|
Loading…
Reference in New Issue