Skip to content

Commit 50ad96c

Browse files
committed
1.0.1 updates:
* add ts linting * include gs++ validation example
1 parent 9df4fb5 commit 50ad96c

File tree

9 files changed

+312
-168
lines changed

9 files changed

+312
-168
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.json": "jsonc"
4+
}
5+
}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ The following examples are provided in the examples directory:
3232

3333
## Change Log
3434

35+
### 1.0.1
36+
- add ts linting to the project
37+
- add example for using gs++ as validation source
38+
3539
### 1.0.0
3640
- ported validator from slpjs 0.21.3
3741
- store cached transactions as buffer instead of a string
38-
- Add max cache size parameters in ValidatorType1 constructor
42+
- add max cache size parameters in ValidatorType1 constructor
3943

4044

4145

lib/crypto.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import * as crypto from 'crypto';
1+
import * as crypto from "crypto";
22

33
export class Crypto {
4-
static hash256(message: Buffer): Buffer {
5-
let hash1 = crypto.createHash('sha256');
6-
let hash2 = crypto.createHash('sha256');
4+
public static hash256(message: Buffer): Buffer {
5+
const hash1 = crypto.createHash("sha256");
6+
const hash2 = crypto.createHash("sha256");
77
hash1.update(message);
88
hash2.update(hash1.digest());
99
return Buffer.from(hash2.digest().toJSON().data.reverse());

lib/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class Script {
55
OP_PUSHDATA1: 76,
66
OP_PUSHDATA2: 77,
77
OP_PUSHDATA4: 78,
8-
OP_1NEGATE : 79,
8+
OP_1NEGATE: 79,
99
OP_RETURN: 106,
1010
}
1111
}

lib/slp.ts

Lines changed: 194 additions & 158 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 87 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "slp-validate",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "SLP transaction validator",
55
"main": "index.js",
66
"files": [
@@ -29,6 +29,8 @@
2929
"grpc-slp-graphsearch-node": "^0.0.1",
3030
"browserify": "^16.2.2",
3131
"uglify-es": "^3.3.9",
32-
"mkdirp": "^0.5.1"
32+
"mkdirp": "^0.5.1",
33+
"typescript-tslint-plugin": "^0.5.4",
34+
"typescript": "^3.6.4"
3335
}
3436
}

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"sourceMap": true, /* Generates corresponding '.map' file. */
88
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
99
"strict": true, /* Enable all strict type-checking options. */
10-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
10+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
11+
"plugins": [
12+
{ "name": "typescript-tslint-plugin" }
13+
]
1114
}
1215
}

tslint.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// You can modify the configuration here with your own.
2+
// Make sure that your json is valid, and if you run into
3+
// other issues, try checking the console for errors.
4+
5+
{
6+
"extends": ["tslint:recommended"],
7+
"rules": {} // add additional rules and their configuration
8+
}

0 commit comments

Comments
 (0)