update eslint command

This commit is contained in:
Fred K. Schott
2019-12-17 08:51:20 -08:00
parent 2145c104fd
commit 1d3ddb5e85
3 changed files with 9 additions and 5 deletions

View File

@@ -20,6 +20,7 @@
"no-useless-constructor": 0,
"no-unused-vars": 0,
"no-prototype-builtins": 0,
"require-atomic-updates": 0
"require-atomic-updates": 0,
"no-dupe-class-members": 0
}
}

View File

@@ -65,7 +65,7 @@
"test": "TS_NODE_PROJECT=src/tsconfig.json nyc mocha --exit",
"test:watch": "TS_NODE_PROJECT=src/tsconfig.json mocha --watch --reporter dot",
"format": "prettier --write '{src,test}/**/*.ts'",
"lint": "eslint src/**/*.ts 'test/*-test.{ts,js}'",
"lint": "eslint 'src/**/*.ts' 'test/*-test.{ts,js}'",
"perf": "./scripts/perf_test.sh",
"start": "node scripts/http.js"
},

View File

@@ -142,15 +142,18 @@ export class Leaf extends Node {
public get hash(): string | void {
switch (this.type) {
case NodeType.ACCOUNT_STATE:
case NodeType.ACCOUNT_STATE: {
const leafPrefix = hashPrefix.LEAF_NODE.toString(16)
return sha512Half(leafPrefix + this.data + this.tag)
case NodeType.TRANSACTION_NO_METADATA:
}
case NodeType.TRANSACTION_NO_METADATA: {
const txIDPrefix = hashPrefix.TRANSACTION_ID.toString(16)
return sha512Half(txIDPrefix + this.data)
case NodeType.TRANSACTION_METADATA:
}
case NodeType.TRANSACTION_METADATA: {
const txNodePrefix = hashPrefix.TRANSACTION_NODE.toString(16)
return sha512Half(txNodePrefix + this.data + this.tag)
}
default:
throw new Error('Tried to hash a SHAMap node of unknown type.')
}