Skip to content

Commit 75dd638

Browse files
committed
Update dependencies
1 parent 772eadc commit 75dd638

17 files changed

+1412
-2104
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
'class-methods-use-this': 0, // I don't like this rule
1717
'no-underscore-dangle': 0, // antlr4ts automatically uses this
1818
'no-param-reassign': 0, // Makes visitors returning the node object easier
19-
'lines-between-class-members': [ // Makes defining interfaces / abstract classes easier
19+
'@typescript-eslint/lines-between-class-members': [ // Makes defining interfaces / abstract classes easier
2020
'error',
2121
'always',
2222
{ exceptAfterSingleLine: true }
@@ -40,5 +40,6 @@ module.exports = {
4040
{ allowExpressions: true }
4141
],
4242
'max-classes-per-file': 0, // Multiple classes in one file are allowed (e.g. Errors)
43+
'@typescript-eslint/no-redeclare': 0, // I sometimes name variables an types the same
4344
},
4445
}

jest/log-on-fail-reporter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const chalk = require('chalk');
22
const { getConsoleOutput } = require('@jest/console');
3-
const DefaultReporter = require('@jest/reporters/build/default_reporter').default;
4-
const getResultHeader = require('@jest/reporters/build/get_result_header').default;
3+
const DefaultReporter = require('@jest/reporters/build/DefaultReporter').default;
4+
const getResultHeader = require('@jest/reporters/build/getResultHeader').default;
55

66
const TITLE_BULLET = chalk.bold('\u25cf ');
77

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
"examples"
77
],
88
"devDependencies": {
9-
"@types/jest": "^24.0.25",
10-
"@types/node": "^12.7.8",
11-
"@typescript-eslint/eslint-plugin": "^2.20.0",
12-
"@typescript-eslint/parser": "^2.20.0",
13-
"antlr4ts-cli": "^0.5.0-alpha.3",
9+
"@jest/reporters": "^26.6.2",
10+
"@types/node": "^14.14.28",
11+
"@typescript-eslint/eslint-plugin": "^4.15.1",
12+
"@typescript-eslint/parser": "^4.15.1",
13+
"antlr4ts-cli": "^0.5.0-alpha.4",
1414
"cashproof": "https://github.com/eyeofpython/cashproof",
15-
"chalk": "^3.0.0",
16-
"codecov": "^3.6.1",
17-
"eslint": "^6.8.0",
18-
"eslint-config-airbnb-typescript": "^7.0.0",
19-
"eslint-plugin-import": "^2.20.0",
20-
"jest": "^24.9.0",
21-
"lerna": "^3.16.0",
22-
"ts-jest": "^24.3.0",
23-
"ts-node": "^8.4.1",
24-
"typescript": "3.7.5"
15+
"chalk": "^4.1.0",
16+
"codecov": "^3.8.1",
17+
"eslint": "^7.20.0",
18+
"eslint-config-airbnb-typescript": "^12.3.1",
19+
"eslint-plugin-import": "^2.22.1",
20+
"jest": "^26.6.3",
21+
"lerna": "^3.22.1",
22+
"ts-jest": "^26.5.1",
23+
"ts-node": "^9.1.1",
24+
"typescript": "^4.1.5"
2525
},
2626
"scripts": {
2727
"test": "jest",

packages/cashc/package.json

+9-10
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,16 @@
4646
"test": "jest --config=../../jest.config.js packages/cashc"
4747
},
4848
"dependencies": {
49-
"@bitauth/libauth": "^1.17.2",
50-
"@types/semver": "^6.0.2",
51-
"antlr4ts": "^0.5.0-alpha.3",
52-
"commander": "^6.0.0",
53-
"semver": "^6.3.0"
49+
"@bitauth/libauth": "^1.18.0",
50+
"antlr4ts": "^0.5.0-alpha.4",
51+
"commander": "^7.1.0",
52+
"semver": "^7.3.4"
5453
},
5554
"devDependencies": {
56-
"delay": "^4.3.0",
57-
"eslint": "^6.6.0",
58-
"jest": "^24.9.0",
59-
"ts-jest": "^24.3.0",
60-
"typescript": "3.7.5"
55+
"@types/semver": "^7.3.4",
56+
"eslint": "^7.20.0",
57+
"jest": "^26.6.3",
58+
"ts-jest": "^26.5.1",
59+
"typescript": "^4.1.5"
6160
}
6261
}

packages/cashc/src/ast/Globals.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export enum TimeOp {
3737
export enum Class {
3838
OUTPUT_P2SH = 'OutputP2SH',
3939
OUTPUT_P2PKH = 'OutputP2PKH',
40-
OUTPUT_NULLDATA = 'OutputNullData'
40+
OUTPUT_NULLDATA = 'OutputNullData',
4141
}
4242

4343
export enum PreimageField {

packages/cashc/src/ast/Operator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export enum UnaryOperator {
22
NOT = '!',
33
NEGATE = '-',
44
SIZE = '.length',
5-
REVERSE = '.reverse()'
5+
REVERSE = '.reverse()',
66
}
77

88
export enum BinaryOperator {
@@ -21,5 +21,5 @@ export enum BinaryOperator {
2121
BIT_OR = '|',
2222
AND = '&&',
2323
OR = '||',
24-
SPLIT = '.split'
24+
SPLIT = '.split',
2525
}

packages/cashc/src/generation/GenerateTargetTraversal.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
Op,
3232
OpOrData,
3333
Script,
34-
toOps,
34+
ToOps,
3535
} from './Script';
3636
import { Data } from '../util';
3737
import { PreimageParts } from './preimage';
@@ -324,7 +324,7 @@ export default class GenerateTargetTraversal extends AstTraversal {
324324

325325
visitTimeOp(node: TimeOpNode): Node {
326326
node.expression = this.visit(node.expression);
327-
this.emit(toOps.fromTimeOp(node.timeOp));
327+
this.emit(ToOps.fromTimeOp(node.timeOp));
328328
this.popFromStack();
329329
return node;
330330
}
@@ -387,7 +387,7 @@ export default class GenerateTargetTraversal extends AstTraversal {
387387
this.popFromStack();
388388
}
389389

390-
this.emit(toOps.fromCast(node.expression.type as PrimitiveType, node.type));
390+
this.emit(ToOps.fromCast(node.expression.type as PrimitiveType, node.type));
391391
this.popFromStack();
392392
this.pushToStack('(value)');
393393
return node;
@@ -402,7 +402,7 @@ export default class GenerateTargetTraversal extends AstTraversal {
402402

403403
if (this.needsToVerifyCovenant(node)) this.verifyCovenant();
404404

405-
this.emit(toOps.fromFunction(node.identifier.name as GlobalFunction));
405+
this.emit(ToOps.fromFunction(node.identifier.name as GlobalFunction));
406406
this.popFromStack(node.parameters.length);
407407
this.pushToStack('(value)');
408408

@@ -550,7 +550,7 @@ export default class GenerateTargetTraversal extends AstTraversal {
550550
visitBinaryOp(node: BinaryOpNode): Node {
551551
node.left = this.visit(node.left);
552552
node.right = this.visit(node.right);
553-
this.emit(toOps.fromBinaryOp(
553+
this.emit(ToOps.fromBinaryOp(
554554
node.operator,
555555
resultingType(node.left.type, node.right.type) === PrimitiveType.INT,
556556
));
@@ -562,7 +562,7 @@ export default class GenerateTargetTraversal extends AstTraversal {
562562

563563
visitUnaryOp(node: UnaryOpNode): Node {
564564
node.expression = this.visit(node.expression);
565-
this.emit(toOps.fromUnaryOp(node.operator));
565+
this.emit(ToOps.fromUnaryOp(node.operator));
566566
this.popFromStack();
567567
this.pushToStack('(value)');
568568
return node;

packages/cashc/src/generation/Script.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type Op = number;
99
export type OpOrData = Op | Uint8Array;
1010
export type Script = OpOrData[];
1111

12-
export class toOps {
12+
export class ToOps {
1313
static fromTimeOp(op: TimeOp): Script {
1414
const mapping = {
1515
[TimeOp.CHECK_LOCKTIME]: [Op.OP_CHECKLOCKTIMEVERIFY, Op.OP_DROP],

packages/cashc/src/grammar/CashScriptLexer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated from src/grammar/CashScript.g4 by ANTLR 4.7.3-SNAPSHOT
1+
// Generated from src/grammar/CashScript.g4 by ANTLR 4.9.0-SNAPSHOT
22

33

44
import { ATN } from "antlr4ts/atn/ATN";

packages/cashc/src/grammar/CashScriptListener.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated from src/grammar/CashScript.g4 by ANTLR 4.7.3-SNAPSHOT
1+
// Generated from src/grammar/CashScript.g4 by ANTLR 4.9.0-SNAPSHOT
22

33

44
import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener";

packages/cashc/src/grammar/CashScriptParser.ts

+26-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated from src/grammar/CashScript.g4 by ANTLR 4.7.3-SNAPSHOT
1+
// Generated from src/grammar/CashScript.g4 by ANTLR 4.9.0-SNAPSHOT
22

33

44
import { ATN } from "antlr4ts/atn/ATN";
@@ -154,6 +154,10 @@ export class CashScriptParser extends Parser {
154154
// @Override
155155
public get serializedATN(): string { return CashScriptParser._serializedATN; }
156156

157+
protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException {
158+
return new FailedPredicateException(this, predicate, message);
159+
}
160+
157161
constructor(input: TokenStream) {
158162
super(input);
159163
this._interp = new ParserATNSimulator(CashScriptParser._ATN, this);
@@ -1180,7 +1184,7 @@ export class CashScriptParser extends Parser {
11801184
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
11811185
this.state = 230;
11821186
if (!(this.precpred(this._ctx, 13))) {
1183-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 13)");
1187+
throw this.createFailedPredicateException("this.precpred(this._ctx, 13)");
11841188
}
11851189
this.state = 231;
11861190
(_localctx as BinaryOpContext)._op = this._input.LT(1);
@@ -1207,7 +1211,7 @@ export class CashScriptParser extends Parser {
12071211
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
12081212
this.state = 233;
12091213
if (!(this.precpred(this._ctx, 12))) {
1210-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 12)");
1214+
throw this.createFailedPredicateException("this.precpred(this._ctx, 12)");
12111215
}
12121216
this.state = 234;
12131217
(_localctx as BinaryOpContext)._op = this._input.LT(1);
@@ -1234,7 +1238,7 @@ export class CashScriptParser extends Parser {
12341238
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
12351239
this.state = 236;
12361240
if (!(this.precpred(this._ctx, 11))) {
1237-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 11)");
1241+
throw this.createFailedPredicateException("this.precpred(this._ctx, 11)");
12381242
}
12391243
this.state = 237;
12401244
(_localctx as BinaryOpContext)._op = this._input.LT(1);
@@ -1261,7 +1265,7 @@ export class CashScriptParser extends Parser {
12611265
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
12621266
this.state = 239;
12631267
if (!(this.precpred(this._ctx, 10))) {
1264-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 10)");
1268+
throw this.createFailedPredicateException("this.precpred(this._ctx, 10)");
12651269
}
12661270
this.state = 240;
12671271
(_localctx as BinaryOpContext)._op = this._input.LT(1);
@@ -1288,7 +1292,7 @@ export class CashScriptParser extends Parser {
12881292
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
12891293
this.state = 242;
12901294
if (!(this.precpred(this._ctx, 9))) {
1291-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 9)");
1295+
throw this.createFailedPredicateException("this.precpred(this._ctx, 9)");
12921296
}
12931297
this.state = 243;
12941298
(_localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__33);
@@ -1304,7 +1308,7 @@ export class CashScriptParser extends Parser {
13041308
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
13051309
this.state = 245;
13061310
if (!(this.precpred(this._ctx, 8))) {
1307-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 8)");
1311+
throw this.createFailedPredicateException("this.precpred(this._ctx, 8)");
13081312
}
13091313
this.state = 246;
13101314
(_localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__3);
@@ -1320,7 +1324,7 @@ export class CashScriptParser extends Parser {
13201324
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
13211325
this.state = 248;
13221326
if (!(this.precpred(this._ctx, 7))) {
1323-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 7)");
1327+
throw this.createFailedPredicateException("this.precpred(this._ctx, 7)");
13241328
}
13251329
this.state = 249;
13261330
(_localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__34);
@@ -1336,7 +1340,7 @@ export class CashScriptParser extends Parser {
13361340
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
13371341
this.state = 251;
13381342
if (!(this.precpred(this._ctx, 6))) {
1339-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 6)");
1343+
throw this.createFailedPredicateException("this.precpred(this._ctx, 6)");
13401344
}
13411345
this.state = 252;
13421346
(_localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__35);
@@ -1352,7 +1356,7 @@ export class CashScriptParser extends Parser {
13521356
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
13531357
this.state = 254;
13541358
if (!(this.precpred(this._ctx, 5))) {
1355-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 5)");
1359+
throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");
13561360
}
13571361
this.state = 255;
13581362
(_localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__36);
@@ -1367,7 +1371,7 @@ export class CashScriptParser extends Parser {
13671371
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
13681372
this.state = 257;
13691373
if (!(this.precpred(this._ctx, 17))) {
1370-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 17)");
1374+
throw this.createFailedPredicateException("this.precpred(this._ctx, 17)");
13711375
}
13721376
this.state = 258;
13731377
this.match(CashScriptParser.T__21);
@@ -1384,7 +1388,7 @@ export class CashScriptParser extends Parser {
13841388
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
13851389
this.state = 261;
13861390
if (!(this.precpred(this._ctx, 16))) {
1387-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 16)");
1391+
throw this.createFailedPredicateException("this.precpred(this._ctx, 16)");
13881392
}
13891393
this.state = 262;
13901394
(_localctx as UnaryOpContext)._op = this._input.LT(1);
@@ -1409,7 +1413,7 @@ export class CashScriptParser extends Parser {
14091413
this.pushNewRecursionContext(_localctx, _startState, CashScriptParser.RULE_expression);
14101414
this.state = 263;
14111415
if (!(this.precpred(this._ctx, 14))) {
1412-
throw new FailedPredicateException(this, "this.precpred(this._ctx, 14)");
1416+
throw this.createFailedPredicateException("this.precpred(this._ctx, 14)");
14131417
}
14141418
this.state = 264;
14151419
(_localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__27);
@@ -2341,8 +2345,8 @@ export class RequireStatementContext extends ParserRuleContext {
23412345

23422346

23432347
export class IfStatementContext extends ParserRuleContext {
2344-
public _ifBlock: BlockContext;
2345-
public _elseBlock: BlockContext;
2348+
public _ifBlock!: BlockContext;
2349+
public _elseBlock!: BlockContext;
23462350
public expression(): ExpressionContext {
23472351
return this.getRuleContext(0, ExpressionContext);
23482352
}
@@ -2494,8 +2498,8 @@ export class ParenthesisedContext extends ExpressionContext {
24942498
}
24952499
}
24962500
export class CastContext extends ExpressionContext {
2497-
public _castable: ExpressionContext;
2498-
public _size: ExpressionContext;
2501+
public _castable!: ExpressionContext;
2502+
public _size!: ExpressionContext;
24992503
public typeName(): TypeNameContext {
25002504
return this.getRuleContext(0, TypeNameContext);
25012505
}
@@ -2593,7 +2597,7 @@ export class InstantiationContext extends ExpressionContext {
25932597
}
25942598
}
25952599
export class TupleIndexOpContext extends ExpressionContext {
2596-
public _index: Token;
2600+
public _index!: Token;
25972601
public expression(): ExpressionContext {
25982602
return this.getRuleContext(0, ExpressionContext);
25992603
}
@@ -2624,7 +2628,7 @@ export class TupleIndexOpContext extends ExpressionContext {
26242628
}
26252629
}
26262630
export class UnaryOpContext extends ExpressionContext {
2627-
public _op: Token;
2631+
public _op!: Token;
26282632
public expression(): ExpressionContext {
26292633
return this.getRuleContext(0, ExpressionContext);
26302634
}
@@ -2654,9 +2658,9 @@ export class UnaryOpContext extends ExpressionContext {
26542658
}
26552659
}
26562660
export class BinaryOpContext extends ExpressionContext {
2657-
public _left: ExpressionContext;
2658-
public _op: Token;
2659-
public _right: ExpressionContext;
2661+
public _left!: ExpressionContext;
2662+
public _op!: Token;
2663+
public _right!: ExpressionContext;
26602664
public expression(): ExpressionContext[];
26612665
public expression(i: number): ExpressionContext;
26622666
public expression(i?: number): ExpressionContext | ExpressionContext[] {

packages/cashc/src/grammar/CashScriptVisitor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated from src/grammar/CashScript.g4 by ANTLR 4.7.3-SNAPSHOT
1+
// Generated from src/grammar/CashScript.g4 by ANTLR 4.9.0-SNAPSHOT
22

33

44
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";

packages/cashc/test/test-util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function getSubdirectories(directory: string): string[] {
66
.filter((fn) => fs.statSync(path.join(directory, fn)).isDirectory());
77
}
88

9-
export function readCashFiles(directory: string): {fn: string, contents: string}[] {
9+
export function readCashFiles(directory: string): { fn: string, contents: string }[] {
1010
return fs.readdirSync(directory)
1111
.filter((fn) => fn.endsWith('.cash'))
1212
.map((fn) => ({ fn, contents: fs.readFileSync(path.join(directory, fn), { encoding: 'utf-8' }) }));

0 commit comments

Comments
 (0)