Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
5ff5a00f
Unverified
Commit
5ff5a00f
authored
Dec 09, 2022
by
mergify[bot]
Committed by
GitHub
Dec 09, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4333 from ethereum-optimism/sc/cmn-options-fix
fix(cmn): BaseServiceV2 options parsing bug
parents
134c0b89
e23f60f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
cool-bears-return.md
.changeset/cool-bears-return.md
+5
-0
base-service-v2.ts
packages/common-ts/src/base-service/base-service-v2.ts
+1
-5
No files found.
.changeset/cool-bears-return.md
0 → 100644
View file @
5ff5a00f
---
'
@eth-optimism/common-ts'
:
patch
---
Fixes a bug in BaseServiceV2 where options were not being parsed correctly when passed into the constructor rather than via environment variables or command line arguments
packages/common-ts/src/base-service/base-service-v2.ts
View file @
5ff5a00f
...
@@ -281,17 +281,13 @@ export abstract class BaseServiceV2<
...
@@ -281,17 +281,13 @@ export abstract class BaseServiceV2<
// names into lower case for the validation step. We'll turn the names back into their original
// names into lower case for the validation step. We'll turn the names back into their original
// names when we're done.
// names when we're done.
const
cleaned
=
cleanEnv
<
TOptions
>
(
const
cleaned
=
cleanEnv
<
TOptions
>
(
{
...
config
.
env
,
...
config
.
args
},
{
...
config
.
env
,
...
config
.
args
,
...(
params
.
options
||
{})
},
Object
.
entries
(
params
.
optionsSpec
||
{}).
reduce
((
acc
,
[
key
,
val
])
=>
{
Object
.
entries
(
params
.
optionsSpec
||
{}).
reduce
((
acc
,
[
key
,
val
])
=>
{
acc
[
key
.
toLowerCase
()]
=
val
.
validator
({
acc
[
key
.
toLowerCase
()]
=
val
.
validator
({
desc
:
val
.
desc
,
desc
:
val
.
desc
,
default
:
val
.
default
,
default
:
val
.
default
,
})
})
return
acc
return
acc
},
{})
as
any
,
Object
.
entries
(
params
.
options
||
{}).
reduce
((
acc
,
[
key
,
val
])
=>
{
acc
[
key
.
toLowerCase
()]
=
val
return
acc
},
{})
as
any
},
{})
as
any
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment