mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 23:55:49 +00:00
Fix *U*Int64 parsing, add hardcore mode to ledger verifier.
This commit is contained in:
@@ -9,8 +9,17 @@ if (process.argc < 1) {
|
||||
var json = fs.readFileSync(process.argv[2], 'utf-8');
|
||||
var ledger = Ledger.from_json(JSON.parse(json));
|
||||
|
||||
// This will serialize each accountState object to binary and then back to json
|
||||
// before finally serializing for hashing. This is mostly for verifying that
|
||||
// ripple-libs binary codecs are working.
|
||||
// Must obviously go after process.argv[2] used to specify ledger json
|
||||
var hardcore = ~process.argv.indexOf('--hardcore')
|
||||
|
||||
console.log("Transaction hash in header: "+ledger.ledger_json.transaction_hash);
|
||||
console.log("Calculated transaction hash: "+ledger.calc_tx_hash().to_hex());
|
||||
|
||||
|
||||
|
||||
console.log("Account state hash in header: "+ledger.ledger_json.account_hash);
|
||||
console.log("Calculated account state hash: "+ledger.calc_account_hash().to_hex());
|
||||
hardcore && console.log("Standby, we are going hardcore!, this may take some time");
|
||||
console.log("Calculated account state hash: "+ledger.calc_account_hash(hardcore).to_hex());
|
||||
|
||||
Reference in New Issue
Block a user