mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 13:56:23 +00:00
ee5d1c1467
* minimize imports, specially for spec - cuts 2/3 of ncli build time * ptr_arith->ptrops
17 lines
551 B
Nim
17 lines
551 B
Nim
import
|
|
confutils, chronicles,
|
|
../beacon_chain/spec/[crypto, datatypes],
|
|
../beacon_chain/[extras, state_transition, ssz]
|
|
|
|
cli do(pre: string, blck: string, post: string, verifyStateRoot = false):
|
|
let
|
|
stateX = SSZ.loadFile(pre, BeaconState)
|
|
blckX = SSZ.loadFile(blck, BeaconBlock)
|
|
flags = if verifyStateRoot: {skipValidation} else: {}
|
|
|
|
var stateY = HashedBeaconState(data: stateX, root: hash_tree_root(stateX))
|
|
if not state_transition(stateY, blckX, flags):
|
|
error "State transition failed"
|
|
|
|
SSZ.saveFile(post, stateY.data)
|