scryptlib
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -5,2 +5,3 @@ export declare abstract class ScryptType { | ||
private _asm; | ||
private _type; | ||
constructor(value: number | BigInt | boolean | string); | ||
@@ -7,0 +8,0 @@ get value(): number | BigInt | boolean | string; |
@@ -11,9 +11,7 @@ "use strict"; | ||
const [asm, scrType] = utils_1.literal2Asm(this._literal); | ||
if (this.constructor.name.toLowerCase() !== scrType.toLowerCase()) { | ||
throw new Error(`type mismatch ${scrType} for ${this.constructor.name}`); | ||
} | ||
this._type = scrType; | ||
this._asm = asm; | ||
} | ||
catch (error) { | ||
throw new Error(`constructor param for ${this.constructor.name} ${error.message}`); | ||
throw new Error(`can't get type from ${this._literal}, ${error.message}`); | ||
} | ||
@@ -166,6 +164,2 @@ } | ||
this._buf = Buffer.from(bytesVal, 'hex'); | ||
const LEN_MIN_BYTES = 156; | ||
if (this._buf.length <= LEN_MIN_BYTES) { | ||
throw new Error(`Invalid preimage string length, should be greater than ${LEN_MIN_BYTES} bytes`); | ||
} | ||
} | ||
@@ -172,0 +166,0 @@ getReader(buf) { |
@@ -109,3 +109,3 @@ "use strict"; | ||
} | ||
// SigHashType | ||
// SigHashPreimage | ||
m = /^SigHashPreimage\(b'([\da-fA-F]+)'\)$/.exec(l); | ||
@@ -112,0 +112,0 @@ if (m) { |
{ | ||
"name": "scryptlib", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "Javascript SDK for integration of Bitcoin SV Smart Contracts written in sCrypt language.", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58895
1294