Skip to content

Commit dd997c8

Browse files
committed
Remove non-erasable typescript syntax
1 parent f86f387 commit dd997c8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ const aPoint = (p: unknown) => (p instanceof Point ? p : err('Point expected'));
4848
export interface AffinePoint { x: bigint, y: bigint }
4949
/** Point in 3d xyz projective coordinates. 3d takes less inversions than 2d. */
5050
class Point {
51-
constructor(readonly px: bigint, readonly py: bigint, readonly pz: bigint) {
51+
readonly px: bigint;
52+
readonly py: bigint;
53+
readonly pz: bigint;
54+
constructor(px: bigint, py: bigint, pz: bigint) {
55+
this.px = px;
56+
this.py = py;
57+
this.pz = pz;
5258
Object.freeze(this);
5359
}
5460
/** Generator / base point */
@@ -228,7 +234,13 @@ const getPublicKey = (privKey: PrivKey, isCompressed = true): Bytes => {
228234
}
229235
/** ECDSA Signature class. Supports only compact 64-byte representation, not DER. */
230236
class Signature {
231-
constructor(readonly r: bigint, readonly s: bigint, readonly recovery?: number) {
237+
readonly r: bigint;
238+
readonly s: bigint;
239+
readonly recovery?: number;
240+
constructor(r: bigint, s: bigint, recovery?: number) {
241+
this.r = r;
242+
this.s = s;
243+
if (this.recovery != null) this.recovery = recovery;
232244
this.assertValidity(); // recovery bit is optional when
233245
Object.freeze(this);
234246
} // constructed outside.

0 commit comments

Comments
 (0)