Skip to content

Commit 67b726e

Browse files
authored
fix(config): correct signer flag (#2637)
Closes: #2603 Flags need to match the file structure for binding to work.
1 parent 75bade2 commit 67b726e

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

docs/learn/config.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,8 @@ signer:
817817
```
818818

819819
**Command-line Flag:**
820-
`--rollkit.signer.type <string>`
821-
_Example:_ `--rollkit.signer.type grpc`
820+
`--rollkit.signer.signer_type <string>`
821+
_Example:_ `--rollkit.signer.signer_type grpc`
822822
_Default:_ (Depends on application, often "file" or none if not an aggregator)
823823
_Constant:_ `FlagSignerType`
824824

@@ -836,8 +836,8 @@ signer:
836836
```
837837

838838
**Command-line Flag:**
839-
`--rollkit.signer.path <string>`
840-
_Example:_ `--rollkit.signer.path ./keys/mykey.pem`
839+
`--rollkit.signer.signer_path <string>`
840+
_Example:_ `--rollkit.signer.signer_path ./keys/mykey.pem`
841841
_Default:_ (Depends on application)
842842
_Constant:_ `FlagSignerPath`
843843

pkg/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ const (
105105
// Signer configuration flags
106106

107107
// FlagSignerType is a flag for specifying the signer type
108-
FlagSignerType = FlagPrefixEvnode + "signer.type"
108+
FlagSignerType = FlagPrefixEvnode + "signer.signer_type"
109109
// FlagSignerPath is a flag for specifying the signer path
110-
FlagSignerPath = FlagPrefixEvnode + "signer.path"
110+
FlagSignerPath = FlagPrefixEvnode + "signer.signer_path"
111111

112112
// FlagSignerPassphrase is a flag for specifying the signer passphrase
113113
//nolint:gosec

pkg/config/config_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ signer:
174174
"--rollkit.da.address", "http://flag-da:26657",
175175
"--rollkit.node.light", "true", // This is not in YAML, should be set from flag
176176
"--rollkit.rpc.address", "127.0.0.1:7332",
177+
"--evnode.signer.signer_path", "/path/to/signer",
177178
}
178179
cmd.SetArgs(flagArgs)
179180
err = cmd.ParseFlags(flagArgs)
@@ -199,8 +200,8 @@ signer:
199200
assert.Equal(t, DefaultConfig.DA.BlockTime.Duration, config.DA.BlockTime.Duration, "DABlockTime should remain as default")
200201

201202
// 5. Signer values should be set from flags
202-
assert.Equal(t, "file", config.Signer.SignerType, "SignerType should be set from flag")
203-
assert.Equal(t, "something/config", config.Signer.SignerPath, "SignerPath should be set from flag")
203+
assert.Equal(t, "file", config.Signer.SignerType, "SignerType should be gotten from config")
204+
assert.Equal(t, "/path/to/signer", config.Signer.SignerPath, "SignerPath should be set from flag")
204205

205206
assert.Equal(t, "127.0.0.1:7332", config.RPC.Address, "RPCAddress should be set from flag")
206207
}

0 commit comments

Comments
 (0)