Skip to content

Commit 6ff41cb

Browse files
agnxshTomi-3-0
authored andcommitted
fix tests
1 parent 5bbbd11 commit 6ff41cb

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

AllTests-mainnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,4 +1102,4 @@ AllTests-mainnet
11021102
+ negative epoch OK
11031103
+ non-number epoch OK
11041104
+ shorter root OK
1105-
```
1105+
```

beacon_chain/spec/forks.nim

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,31 @@ template Forky*(
632632
kind: static ConsensusFork): auto =
633633
kind.SignedBeaconBlock
634634

635+
# Workaround method used for tests that involve walking through
636+
# `nim-eth2-scnarios`fork dirs, to be removed once Fulu is
637+
# included in new release.
638+
template withAllButFulu*(
639+
x: typedesc[ConsensusFork], body: untyped): untyped =
640+
static: doAssert ConsensusFork.high == ConsensusFork.Fulu
641+
block:
642+
const consensusFork {.inject, used.} = ConsensusFork.Electra
643+
body
644+
block:
645+
const consensusFork {.inject, used.} = ConsensusFork.Deneb
646+
body
647+
block:
648+
const consensusFork {.inject, used.} = ConsensusFork.Capella
649+
body
650+
block:
651+
const consensusFork {.inject, used.} = ConsensusFork.Bellatrix
652+
body
653+
block:
654+
const consensusFork {.inject, used.} = ConsensusFork.Altair
655+
body
656+
block:
657+
const consensusFork {.inject, used.} = ConsensusFork.Phase0
658+
body
659+
635660
template withAll*(
636661
x: typedesc[ConsensusFork], body: untyped): untyped =
637662
static: doAssert ConsensusFork.high == ConsensusFork.Fulu

tests/consensus_spec/test_fixture_sanity_blocks.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ template runForkBlockTests(consensusFork: static ConsensusFork) =
114114
RandomDir, suiteName, path)
115115

116116
withAll(ConsensusFork):
117-
runForkBlockTests(consensusFork)
117+
runForkBlockTests(consensusFork)

0 commit comments

Comments
 (0)