diff --git a/tests/consensus_spec/test_fixture_fork_choice.nim b/tests/consensus_spec/test_fixture_fork_choice.nim index 163996b8f..4e1ab0066 100644 --- a/tests/consensus_spec/test_fixture_fork_choice.nim +++ b/tests/consensus_spec/test_fixture_fork_choice.nim @@ -19,7 +19,7 @@ import ../../beacon_chain/consensus_object_pools/[ blockchain_dag, block_clearance, block_quarantine, spec_cache], # Third-party - yaml, + yaml/tojson, # Test ../testutil, ../testdbutil, ./fixtures_utils, ./os_ops @@ -102,7 +102,7 @@ proc loadOps( IOError, KeyError, UnconsumedInput, ValueError, YamlConstructionError, YamlParserError].} = let stepsYAML = os_ops.readFile(path/"steps.yaml") - let steps = yaml.loadToJson(stepsYAML) + let steps = loadToJson(stepsYAML) result = @[] for step in steps[0]: diff --git a/tests/consensus_spec/test_fixture_kzg.nim b/tests/consensus_spec/test_fixture_kzg.nim index 8ce41b25c..238e27195 100644 --- a/tests/consensus_spec/test_fixture_kzg.nim +++ b/tests/consensus_spec/test_fixture_kzg.nim @@ -10,7 +10,7 @@ import std/json, - yaml, + yaml/tojson, kzg4844/kzg_ex, stew/byteutils, ../testutil, @@ -39,7 +39,7 @@ proc runBlobToKzgCommitmentTest(suiteName, suitePath, path: string) = let relativePathComponent = path.relativeTestPathComponent(suitePath) test "KZG - Blob to KZG commitment - " & relativePathComponent: let - data = yaml.loadToJson(os_ops.readFile(path/"data.yaml"))[0] + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] output = data["output"] blob = fromHex[131072](data["input"]["blob"].getStr) @@ -61,7 +61,7 @@ proc runVerifyKzgProofTest(suiteName, suitePath, path: string) = let relativePathComponent = path.relativeTestPathComponent(suitePath) test "KZG - Verify KZG proof - " & relativePathComponent: let - data = yaml.loadToJson(os_ops.readFile(path/"data.yaml"))[0] + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] output = data["output"] commitment = fromHex[48](data["input"]["commitment"].getStr) z = fromHex[32](data["input"]["z"].getStr) @@ -89,7 +89,7 @@ proc runVerifyBlobKzgProofTest(suiteName, suitePath, path: string) = let relativePathComponent = path.relativeTestPathComponent(suitePath) test "KZG - Verify blob KZG proof - " & relativePathComponent: let - data = yaml.loadToJson(os_ops.readFile(path/"data.yaml"))[0] + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] output = data["output"] blob = fromHex[131072](data["input"]["blob"].getStr) commitment = fromHex[48](data["input"]["commitment"].getStr) @@ -117,7 +117,7 @@ proc runVerifyBlobKzgProofBatchTest(suiteName, suitePath, path: string) = let relativePathComponent = path.relativeTestPathComponent(suitePath) test "KZG - Verify blob KZG proof batch - " & relativePathComponent: let - data = yaml.loadToJson(os_ops.readFile(path/"data.yaml"))[0] + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] output = data["output"] blobs = data["input"]["blobs"].mapIt(fromHex[131072](it.getStr)) commitments = data["input"]["commitments"].mapIt(fromHex[48](it.getStr)) @@ -146,7 +146,7 @@ proc runComputeKzgProofTest(suiteName, suitePath, path: string) = let relativePathComponent = path.relativeTestPathComponent(suitePath) test "KZG - Compute KZG proof - " & relativePathComponent: let - data = yaml.loadToJson(os_ops.readFile(path/"data.yaml"))[0] + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] output = data["output"] blob = fromHex[131072](data["input"]["blob"].getStr) z = fromHex[32](data["input"]["z"].getStr) @@ -174,7 +174,7 @@ proc runComputeBlobKzgProofTest(suiteName, suitePath, path: string) = let relativePathComponent = path.relativeTestPathComponent(suitePath) test "KZG - Compute blob KZG proof - " & relativePathComponent: let - data = yaml.loadToJson(os_ops.readFile(path/"data.yaml"))[0] + data = loadToJson(os_ops.readFile(path/"data.yaml"))[0] output = data["output"] blob = fromHex[131072](data["input"]["blob"].getStr) commitment = fromHex[48](data["input"]["commitment"].getStr) diff --git a/tests/consensus_spec/test_fixture_light_client_data_collection.nim b/tests/consensus_spec/test_fixture_light_client_data_collection.nim index 55e6271d1..e53ed7fe3 100644 --- a/tests/consensus_spec/test_fixture_light_client_data_collection.nim +++ b/tests/consensus_spec/test_fixture_light_client_data_collection.nim @@ -16,7 +16,7 @@ import chronicles, taskpools, # Third-party - yaml, + yaml/tojson, # Beacon chain internals ../../beacon_chain/beacon_chain_db, ../../beacon_chain/consensus_object_pools/[block_clearance, block_quarantine], @@ -88,7 +88,7 @@ proc loadSteps( loadForked(t, s, path, fork_digests) let stepsYAML = os_ops.readFile(path/"steps.yaml") - let steps = yaml.loadToJson(stepsYAML) + let steps = loadToJson(stepsYAML) result = @[] for step in steps[0]: diff --git a/tests/consensus_spec/test_fixture_light_client_sync.nim b/tests/consensus_spec/test_fixture_light_client_sync.nim index 6338bf08a..068d749e4 100644 --- a/tests/consensus_spec/test_fixture_light_client_sync.nim +++ b/tests/consensus_spec/test_fixture_light_client_sync.nim @@ -14,7 +14,7 @@ import # Status libraries stew/byteutils, # Third-party - yaml, + yaml, yaml/tojson, # Beacon chain internals ../../beacon_chain/spec/[forks, light_client_sync], # Test utilities @@ -59,7 +59,7 @@ proc loadSteps( ): seq[TestStep] {.raises: [ KeyError, ValueError, YamlConstructionError, YamlParserError].} = let stepsYAML = os_ops.readFile(path/"steps.yaml") - let steps = yaml.loadToJson(stepsYAML) + let steps = loadToJson(stepsYAML) result = @[] for step in steps[0]: diff --git a/tests/test_deposit_snapshots.nim b/tests/test_deposit_snapshots.nim index 350fa407d..d7b1df40f 100644 --- a/tests/test_deposit_snapshots.nim +++ b/tests/test_deposit_snapshots.nim @@ -12,7 +12,7 @@ import std/[json, os, random, sequtils, strutils, times], chronos, stew/base10, chronicles, unittest2, - yaml, + yaml/tojson, ../beacon_chain/beacon_chain_db, ../beacon_chain/spec/deposit_snapshots, ./consensus_spec/os_ops @@ -208,7 +208,7 @@ suite "EIP-4881": path: string ): seq[DepositTestCase] {.raises: [ IOError, KeyError, ValueError, YamlConstructionError, YamlParserError].} = - yaml.loadToJson(os_ops.readFile(path))[0].mapIt: + loadToJson(os_ops.readFile(path))[0].mapIt: DepositTestCase( deposit_data: DepositData( pubkey: ValidatorPubKey.fromHex( diff --git a/vendor/NimYAML b/vendor/NimYAML index ab3ff9fad..7721c955b 160000 --- a/vendor/NimYAML +++ b/vendor/NimYAML @@ -1 +1 @@ -Subproject commit ab3ff9fad45fa7e20d749d0a03a7567225f5dd4a +Subproject commit 7721c955b522f4893265bb36a6de4f8edef8b54b