Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3760. #3768

Merged
merged 3 commits into from
Jun 19, 2022
Merged

Fix #3760. #3768

merged 3 commits into from
Jun 19, 2022

Conversation

cheatfate
Copy link
Contributor

@cheatfate cheatfate commented Jun 16, 2022

Add test vectors for deserialization.
@etan-status etan-status linked an issue Jun 16, 2022 that may be closed by this pull request
@etan-status
Copy link
Contributor

GJ. What a crazy serialization format, packing JSON into string into JSON 😅

tests/test_keymanager_api.nim Show resolved Hide resolved
tests/test_keymanager_api.nim Show resolved Hide resolved
@@ -336,6 +336,206 @@ proc runTests {.async.} =
]
)

suite "Serialization/deserialization " & preset():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice tests! These kinds of tests would be useful for all the rest-json serialized types

@@ -1908,44 +1909,82 @@ proc writeValue*(writer: var JsonWriter[RestJson],
value: KeystoresAndSlashingProtection) {.
raises: [IOError, Defect].} =
writer.beginRecord()
writer.writeField("keystores", value.keystores)
let keystores =
block:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this with mapIt.

beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim Outdated Show resolved Hide resolved
@github-actions
Copy link

Unit Test Results

     12 files     849 suites   1h 8m 44s ⏱️
1 707 tests 1 655 ✔️   52 💤 0
9 924 runs  9 796 ✔️ 128 💤 0

Results for commit ca6ec0e.

@zah zah merged commit c4383e2 into unstable Jun 19, 2022
@zah zah deleted the keymanager-string branch June 19, 2022 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyManager API do not follows specification when importing keys.
4 participants