Update test to latest beacon LC test vectors (#1815)

This commit is contained in:
Kim De Mey 2023-10-11 15:44:23 +02:00 committed by GitHub
parent 00659bc181
commit 3444ffaf30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 21 deletions

View File

@ -39,13 +39,13 @@ suite "Beacon Light Client Content Encodings - Mainnet":
test "LightClientBootstrap": test "LightClientBootstrap":
const file = testVectorDir & "bootstrap.json" const file = testVectorDir & "bootstrap.json"
let res = readJsonType(file, JsonPortalContentTable) let res = readJsonType(file, seq[JsonPortalContent])
check res.isOk() check res.isOk()
let content = res.get() let contentList = res.value()
for k, v in content: for c in contentList:
let let
contentKeyEncoded = v.content_key.hexToSeqByte() contentKeyEncoded = c.content_key.hexToSeqByte()
contentValueEncoded = v.content_value.hexToSeqByte() contentValueEncoded = c.content_value.hexToSeqByte()
# Decode content and content key # Decode content and content key
let let
@ -74,13 +74,13 @@ suite "Beacon Light Client Content Encodings - Mainnet":
test "LightClientUpdates": test "LightClientUpdates":
const file = testVectorDir & "updates.json" const file = testVectorDir & "updates.json"
let res = readJsonType(file, JsonPortalContentTable) let res = readJsonType(file, seq[JsonPortalContent])
check res.isOk() check res.isOk()
let content = res.get() let contentList = res.value()
for k, v in content: for c in contentList:
let let
contentKeyEncoded = v.content_key.hexToSeqByte() contentKeyEncoded = c.content_key.hexToSeqByte()
contentValueEncoded = v.content_value.hexToSeqByte() contentValueEncoded = c.content_value.hexToSeqByte()
# Decode content and content key # Decode content and content key
let let
@ -113,13 +113,13 @@ suite "Beacon Light Client Content Encodings - Mainnet":
test "LightClientFinalityUpdate": test "LightClientFinalityUpdate":
const file = testVectorDir & "finality_update.json" const file = testVectorDir & "finality_update.json"
let res = readJsonType(file, JsonPortalContentTable) let res = readJsonType(file, seq[JsonPortalContent])
check res.isOk() check res.isOk()
let content = res.get() let contentList = res.value()
for k, v in content: for c in contentList:
let let
contentKeyEncoded = v.content_key.hexToSeqByte() contentKeyEncoded = c.content_key.hexToSeqByte()
contentValueEncoded = v.content_value.hexToSeqByte() contentValueEncoded = c.content_value.hexToSeqByte()
# Decode content and content key # Decode content and content key
let let
@ -147,13 +147,13 @@ suite "Beacon Light Client Content Encodings - Mainnet":
test "LightClientOptimisticUpdate": test "LightClientOptimisticUpdate":
const file = testVectorDir & "optimistic_update.json" const file = testVectorDir & "optimistic_update.json"
let res = readJsonType(file, JsonPortalContentTable) let res = readJsonType(file, seq[JsonPortalContent])
check res.isOk() check res.isOk()
let content = res.get() let contentList = res.value()
for k, v in content: for c in contentList:
let let
contentKeyEncoded = v.content_key.hexToSeqByte() contentKeyEncoded = c.content_key.hexToSeqByte()
contentValueEncoded = v.content_value.hexToSeqByte() contentValueEncoded = c.content_value.hexToSeqByte()
# Decode content and content key # Decode content and content key
let let

@ -1 +1 @@
Subproject commit cecc8767654e0b19d2bc55ae3a693d428774565c Subproject commit ae43c56eabd021406b8afb41f124d63e3cf5adf9