From 3444ffaf30431147d6e9c00a8c6b3ca8164a7f5b Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Wed, 11 Oct 2023 15:44:23 +0200 Subject: [PATCH] Update test to latest beacon LC test vectors (#1815) --- .../test_beacon_light_client_content.nim | 40 +++++++++---------- vendor/portal-spec-tests | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim index 899f3332e..2c2f46c01 100644 --- a/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim +++ b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim @@ -39,13 +39,13 @@ suite "Beacon Light Client Content Encodings - Mainnet": test "LightClientBootstrap": const file = testVectorDir & "bootstrap.json" - let res = readJsonType(file, JsonPortalContentTable) + let res = readJsonType(file, seq[JsonPortalContent]) check res.isOk() - let content = res.get() - for k, v in content: + let contentList = res.value() + for c in contentList: let - contentKeyEncoded = v.content_key.hexToSeqByte() - contentValueEncoded = v.content_value.hexToSeqByte() + contentKeyEncoded = c.content_key.hexToSeqByte() + contentValueEncoded = c.content_value.hexToSeqByte() # Decode content and content key let @@ -74,13 +74,13 @@ suite "Beacon Light Client Content Encodings - Mainnet": test "LightClientUpdates": const file = testVectorDir & "updates.json" - let res = readJsonType(file, JsonPortalContentTable) + let res = readJsonType(file, seq[JsonPortalContent]) check res.isOk() - let content = res.get() - for k, v in content: + let contentList = res.value() + for c in contentList: let - contentKeyEncoded = v.content_key.hexToSeqByte() - contentValueEncoded = v.content_value.hexToSeqByte() + contentKeyEncoded = c.content_key.hexToSeqByte() + contentValueEncoded = c.content_value.hexToSeqByte() # Decode content and content key let @@ -113,13 +113,13 @@ suite "Beacon Light Client Content Encodings - Mainnet": test "LightClientFinalityUpdate": const file = testVectorDir & "finality_update.json" - let res = readJsonType(file, JsonPortalContentTable) + let res = readJsonType(file, seq[JsonPortalContent]) check res.isOk() - let content = res.get() - for k, v in content: + let contentList = res.value() + for c in contentList: let - contentKeyEncoded = v.content_key.hexToSeqByte() - contentValueEncoded = v.content_value.hexToSeqByte() + contentKeyEncoded = c.content_key.hexToSeqByte() + contentValueEncoded = c.content_value.hexToSeqByte() # Decode content and content key let @@ -147,13 +147,13 @@ suite "Beacon Light Client Content Encodings - Mainnet": test "LightClientOptimisticUpdate": const file = testVectorDir & "optimistic_update.json" - let res = readJsonType(file, JsonPortalContentTable) + let res = readJsonType(file, seq[JsonPortalContent]) check res.isOk() - let content = res.get() - for k, v in content: + let contentList = res.value() + for c in contentList: let - contentKeyEncoded = v.content_key.hexToSeqByte() - contentValueEncoded = v.content_value.hexToSeqByte() + contentKeyEncoded = c.content_key.hexToSeqByte() + contentValueEncoded = c.content_value.hexToSeqByte() # Decode content and content key let diff --git a/vendor/portal-spec-tests b/vendor/portal-spec-tests index cecc87676..ae43c56ea 160000 --- a/vendor/portal-spec-tests +++ b/vendor/portal-spec-tests @@ -1 +1 @@ -Subproject commit cecc8767654e0b19d2bc55ae3a693d428774565c +Subproject commit ae43c56eabd021406b8afb41f124d63e3cf5adf9