reduce code repetition in `test_toblindedblock` (#6453)
Use `withAll` to generate the tests for various blinded block types instead of copy pasting them for every fork.
This commit is contained in:
parent
292c2b6de7
commit
c373e3ab35
|
@ -88,10 +88,10 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
|
||||||
OK: 1/1 Fail: 0/1 Skip: 0/1
|
OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||||
## Blinded block conversions
|
## Blinded block conversions
|
||||||
```diff
|
```diff
|
||||||
+ Bellatrix toSignedBlindedBlock OK
|
+ Bellatrix toSignedBlindedBeaconBlock OK
|
||||||
+ Capella toSignedBlindedBlock OK
|
+ Capella toSignedBlindedBeaconBlock OK
|
||||||
+ Deneb toSignedBlindedBlock OK
|
+ Deneb toSignedBlindedBeaconBlock OK
|
||||||
+ Electra toSignedBlindedBlock OK
|
+ Electra toSignedBlindedBeaconBlock OK
|
||||||
```
|
```
|
||||||
OK: 4/4 Fail: 0/4 Skip: 0/4
|
OK: 4/4 Fail: 0/4 Skip: 0/4
|
||||||
## Block pool altair processing [Preset: mainnet]
|
## Block pool altair processing [Preset: mainnet]
|
||||||
|
|
|
@ -116,28 +116,16 @@ template deneb_steps() =
|
||||||
do_check
|
do_check
|
||||||
|
|
||||||
suite "Blinded block conversions":
|
suite "Blinded block conversions":
|
||||||
test "Bellatrix toSignedBlindedBlock":
|
withAll(ConsensusFork):
|
||||||
var b = default(bellatrix.SignedBeaconBlock)
|
when consensusFork >= ConsensusFork.Bellatrix:
|
||||||
do_check
|
test $consensusFork & " toSignedBlindedBeaconBlock":
|
||||||
bellatrix_steps
|
var b = default(consensusFork.SignedBeaconBlock)
|
||||||
|
do_check
|
||||||
test "Capella toSignedBlindedBlock":
|
bellatrix_steps
|
||||||
var b = default(capella.SignedBeaconBlock)
|
when consensusFork >= ConsensusFork.Capella:
|
||||||
do_check
|
capella_steps
|
||||||
bellatrix_steps
|
when consensusFork >= ConsensusFork.Deneb:
|
||||||
capella_steps
|
deneb_steps
|
||||||
|
when consensusFork >= ConsensusFork.Electra:
|
||||||
test "Deneb toSignedBlindedBlock":
|
debugComment "add electra_steps"
|
||||||
var b = default(deneb.SignedBeaconBlock)
|
static: doAssert consensusFork.high == ConsensusFork.Electra
|
||||||
do_check
|
|
||||||
bellatrix_steps
|
|
||||||
capella_steps
|
|
||||||
deneb_steps
|
|
||||||
|
|
||||||
test "Electra toSignedBlindedBlock":
|
|
||||||
var b = default(electra.SignedBeaconBlock)
|
|
||||||
do_check
|
|
||||||
bellatrix_steps
|
|
||||||
capella_steps
|
|
||||||
deneb_steps
|
|
||||||
debugComment "add electra_steps"
|
|
||||||
|
|
Loading…
Reference in New Issue