Skip to content

Commit

Permalink
1.0.1 updates:
Browse files Browse the repository at this point in the history
* add ts linting
* include gs++ validation example
  • Loading branch information
jcramer committed Oct 28, 2019
1 parent 9df4fb5 commit 50ad96c
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 168 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.json": "jsonc"
}
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ The following examples are provided in the examples directory:

## Change Log

### 1.0.1
- add ts linting to the project
- add example for using gs++ as validation source

### 1.0.0
- ported validator from slpjs 0.21.3
- store cached transactions as buffer instead of a string
- Add max cache size parameters in ValidatorType1 constructor
- add max cache size parameters in ValidatorType1 constructor



Expand Down
8 changes: 4 additions & 4 deletions lib/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as crypto from 'crypto';
import * as crypto from "crypto";

export class Crypto {
static hash256(message: Buffer): Buffer {
let hash1 = crypto.createHash('sha256');
let hash2 = crypto.createHash('sha256');
public static hash256(message: Buffer): Buffer {
const hash1 = crypto.createHash("sha256");
const hash2 = crypto.createHash("sha256");
hash1.update(message);
hash2.update(hash1.digest());
return Buffer.from(hash2.digest().toJSON().data.reverse());
Expand Down
2 changes: 1 addition & 1 deletion lib/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class Script {
OP_PUSHDATA1: 76,
OP_PUSHDATA2: 77,
OP_PUSHDATA4: 78,
OP_1NEGATE : 79,
OP_1NEGATE: 79,
OP_RETURN: 106,
}
}
352 changes: 194 additions & 158 deletions lib/slp.ts

Large diffs are not rendered by default.

88 changes: 87 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slp-validate",
"version": "1.0.0",
"version": "1.0.1",
"description": "SLP transaction validator",
"main": "index.js",
"files": [
Expand Down Expand Up @@ -29,6 +29,8 @@
"grpc-slp-graphsearch-node": "^0.0.1",
"browserify": "^16.2.2",
"uglify-es": "^3.3.9",
"mkdirp": "^0.5.1"
"mkdirp": "^0.5.1",
"typescript-tslint-plugin": "^0.5.4",
"typescript": "^3.6.4"
}
}
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"sourceMap": true, /* Generates corresponding '.map' file. */
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"plugins": [
{ "name": "typescript-tslint-plugin" }
]
}
}
8 changes: 8 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// You can modify the configuration here with your own.
// Make sure that your json is valid, and if you run into
// other issues, try checking the console for errors.

{
"extends": ["tslint:recommended"],
"rules": {} // add additional rules and their configuration
}

0 comments on commit 50ad96c

Please sign in to comment.