rm ncli_signing_root

This commit is contained in:
Dustin Brody 2019-12-16 19:31:01 +01:00 committed by zah
parent c824416f56
commit 79893cd241
4 changed files with 1 additions and 38 deletions

View File

@ -21,7 +21,6 @@ TOOLS := \
deposit_contract \
ncli_hash_tree_root \
ncli_pretty \
ncli_signing_root \
ncli_transition \
process_dashboard
TOOLS_DIRS := \

1
ncli/.gitignore vendored
View File

@ -1,4 +1,3 @@
ncli_pretty
ncli_signing_root
ncli_hash_tree_root
ncli_transition

View File

@ -5,7 +5,7 @@
# Tools
* transition: Perform state transition given a pre-state and a block to apply (both in SSZ format)
* signing_root/hash_tree_root: Print tree root of an SSZ object
* hash_tree_root: Print tree root of an SSZ object
* pretty: Pretty-print SSZ object as JSON
# Building

View File

@ -1,35 +0,0 @@
import
confutils, os, strutils, chronicles, json_serialization,
nimcrypto/utils,
../beacon_chain/spec/[crypto, datatypes, digest],
../beacon_chain/[ssz]
# TODO turn into arguments
cli do(kind: string, file: string):
template printit(t: untyped) {.dirty.} =
let v =
if cmpIgnoreCase(ext, ".ssz") == 0:
SSZ.loadFile(file, t)
elif cmpIgnoreCase(ext, ".json") == 0:
JSON.loadFile(file, t)
else:
echo "Unknown file type: ", ext
quit 1
echo signing_root(v).data.toHex(true)
let ext = splitFile(file).ext
case kind
of "attester_slashing": printit(AttesterSlashing)
of "attestation": printit(Attestation)
of "block": printit(BeaconBlock)
of "block_body": printit(BeaconBlockBody)
of "block_header": printit(BeaconBlockHeader)
of "deposit": printit(Deposit)
of "deposit_data": printit(DepositData)
of "eth1_data": printit(Eth1Data)
of "state": printit(BeaconState)
of "proposer_slashing": printit(ProposerSlashing)
of "voluntary_exit": printit(VoluntaryExit)