2020-02-07 07:13:38 +00:00
|
|
|
import
|
2020-05-04 05:38:14 +00:00
|
|
|
os, strformat,
|
2020-06-03 13:52:02 +00:00
|
|
|
ssz/ssz_serialization,
|
2020-02-07 07:13:38 +00:00
|
|
|
beacon_node_types,
|
|
|
|
./spec/[crypto, datatypes, digest]
|
|
|
|
|
|
|
|
proc dump*(dir: string, v: AttestationData, validator: ValidatorPubKey) =
|
2020-05-04 05:38:14 +00:00
|
|
|
SSZ.saveFile(dir / &"att-{v.slot}-{v.index}-{shortLog(validator)}.ssz", v)
|
2020-02-07 07:13:38 +00:00
|
|
|
|
2020-05-11 18:08:52 +00:00
|
|
|
proc dump*(dir: string, v: SignedBeaconBlock, root: Eth2Digest) =
|
|
|
|
SSZ.saveFile(dir / &"block-{v.message.slot}-{shortLog(root)}.ssz", v)
|
|
|
|
|
2020-02-07 07:13:38 +00:00
|
|
|
proc dump*(dir: string, v: SignedBeaconBlock, blck: BlockRef) =
|
2020-05-11 18:08:52 +00:00
|
|
|
dump(dir, v, blck.root)
|
2020-02-07 07:13:38 +00:00
|
|
|
|
|
|
|
proc dump*(dir: string, v: HashedBeaconState, blck: BlockRef) =
|
|
|
|
SSZ.saveFile(
|
2020-05-04 05:38:14 +00:00
|
|
|
dir / &"state-{v.data.slot}-{shortLog(blck.root)}-{shortLog(v.root)}.ssz",
|
2020-02-07 07:13:38 +00:00
|
|
|
v.data)
|
2020-05-11 18:08:52 +00:00
|
|
|
|
2020-06-06 11:26:19 +00:00
|
|
|
proc dump*(dir: string, v: HashedBeaconState) =
|
|
|
|
SSZ.saveFile(
|
|
|
|
dir / &"state-{v.data.slot}-{shortLog(v.root)}.ssz",
|
|
|
|
v.data)
|