Misc Primitive Fixes
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
* Script Entity.
|
||||
*/
|
||||
export class Script {
|
||||
public readonly bytes: Uint8Array;
|
||||
protected readonly bytes: Uint8Array;
|
||||
|
||||
/**
|
||||
* Construct a new Script
|
||||
@@ -32,8 +32,8 @@ export class Script {
|
||||
*/
|
||||
public static from(script: Uint8Array | string) {
|
||||
return script instanceof Uint8Array
|
||||
? Script.fromBytes(script)
|
||||
: Script.fromHex(script);
|
||||
? this.fromBytes(script)
|
||||
: this.fromHex(script);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ export class Script {
|
||||
* @returns {Script} The created Script Entity.
|
||||
*/
|
||||
public static fromBytes(bytes: Uint8Array): Script {
|
||||
return new Script(bytes);
|
||||
return new this(bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ export class Script {
|
||||
}
|
||||
|
||||
// Return new Script Entity from the assembled bytecode.
|
||||
return new Script(assembleResult.bytecode);
|
||||
return new this(assembleResult.bytecode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ export class Script {
|
||||
const scriptBin = hexToBin(hex);
|
||||
|
||||
// Return new Script entity constructed from the binary.
|
||||
return new Script(scriptBin);
|
||||
return new this(scriptBin);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user