From cca159bf8fd31d7356f648cc6908bcdae59a2ca7 Mon Sep 17 00:00:00 2001 From: Madhur Shrimal Date: Thu, 25 Apr 2024 17:13:37 -0700 Subject: [PATCH] address some comments --- node/plugin/cmd/main.go | 4 ++-- node/plugin/config.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/node/plugin/cmd/main.go b/node/plugin/cmd/main.go index 57cb496d03..f6af705c1d 100644 --- a/node/plugin/cmd/main.go +++ b/node/plugin/cmd/main.go @@ -132,10 +132,10 @@ func pluginOps(ctx *cli.Context) { } quorumIds, err := tx.GetRegisteredQuorumIdsForOperator(context.Background(), operatorID) if err != nil { - log.Printf("Error: failed to get quorum(s) for operatorID: %x, operator address: %x, error: %v", operatorID, sk.Address, err) + log.Printf("Error: failed to get quorum(s) for operatorID: %x, operator address: %x, error: %v", operatorID, operatorAddress.Hex(), err) return } - log.Printf("Info: operator ID: %x, operator address: %x, current quorums: %v", operatorID, operatorAddress, quorumIds) + log.Printf("Info: operator ID: %x, operator address: %x, current quorums: %v", operatorID, operatorAddress.Hex(), quorumIds) return } diff --git a/node/plugin/config.go b/node/plugin/config.go index b987b0f239..df3e9f1efa 100644 --- a/node/plugin/config.go +++ b/node/plugin/config.go @@ -150,7 +150,10 @@ func NewConfig(ctx *cli.Context) (*Config, error) { return nil, errors.New("unsupported operation type") } - if op != OperationListQuorums && len(ctx.GlobalString(EcdsaKeyFileFlag.Name)) == 0 && len(ctx.GlobalString(EcdsaKeyPasswordFlag.Name)) == 0 { + // ECDSA key is only required for opt-in, opt-out and update-socket operations + if (op == OperationOptIn || op == OperationOptOut || op == OperationUpdateSocket) && + len(ctx.GlobalString(EcdsaKeyFileFlag.Name)) == 0 && + len(ctx.GlobalString(EcdsaKeyPasswordFlag.Name)) == 0 { return nil, errors.New("opt-in, opt-out and update-socket operations require ECDSA key file and password") }