mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-26 13:15:16 +00:00
More relaxed parsing of RemoteKeystores to regain compatibility with version 1 (#4967)
This commit is contained in:
parent
5aeb5d9209
commit
e8572c0246
@ -699,14 +699,6 @@ proc readValue*(reader: var JsonReader, value: var RemoteKeystore)
|
||||
if remoteType.isSome:
|
||||
reader.raiseUnexpectedField("Multiple `type` fields found",
|
||||
"RemoteKeystore")
|
||||
if version.isNone:
|
||||
reader.raiseUnexpectedField(
|
||||
"The `type` field should be specified after the `version` field of the keystore",
|
||||
"RemoteKeystore")
|
||||
if version.get < 2:
|
||||
reader.raiseUnexpectedField(
|
||||
"The `type` field is valid only past version 2 of the remote keystore format",
|
||||
"RemoteKeystore")
|
||||
let remoteTypeValue = case reader.readValue(string).toLowerAscii()
|
||||
of "web3signer":
|
||||
RemoteSignerType.Web3Signer
|
||||
|
@ -36,7 +36,7 @@ suite "Remove keystore testing suite":
|
||||
check keystore.remotes[0].id == 0
|
||||
check keystore.remotes[0].pubkey.toHex == "8b9c875fbe539c6429c4fc304675062579ce47fb6b2ac6b6a1ba1188ca123a80affbfe381dbbc8e7f2437709a4c3325c"
|
||||
|
||||
for version in [3]:
|
||||
for version in [1, 3]:
|
||||
let remoteKeyStores = """{
|
||||
"version": """ & $version & """,
|
||||
"type": "web3signer",
|
||||
|
Loading…
x
Reference in New Issue
Block a user