@btc-vision/btc-runtime 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btc-vision/btc-runtime",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "scripts": {},
@@ -20,6 +20,9 @@ export class OP_NET implements IBTC {
20
20
  public onDeployment(_calldata: Calldata): void {
21
21
  }
22
22
 
23
+ public onExecutionStarted(): void {
24
+ }
25
+
23
26
  public onExecutionCompleted(): void {
24
27
  }
25
28
 
@@ -17,6 +17,9 @@ export function execute(calldataLength: u32): u32 {
17
17
 
18
18
  const calldata: Calldata = new BytesReader(Uint8Array.wrap(calldataBuffer));
19
19
  const selector: Selector = calldata.readSelector();
20
+
21
+ Blockchain.contract.onExecutionStarted();
22
+
20
23
  const result: BytesWriter = Blockchain.contract.execute(selector, calldata);
21
24
 
22
25
  Blockchain.contract.onExecutionCompleted();
@@ -40,6 +43,7 @@ export function onDeploy(calldataLength: u32): u32 {
40
43
 
41
44
  const calldata: Calldata = new BytesReader(Uint8Array.wrap(calldataBuffer));
42
45
 
46
+ Blockchain.contract.onExecutionStarted();
43
47
  Blockchain.contract.onDeployment(calldata);
44
48
  Blockchain.contract.onExecutionCompleted();
45
49
 
@@ -35,7 +35,7 @@ export class StoredAddressArray {
35
35
  constructor(public pointer: u16, public subPointer: Uint8Array) {
36
36
  assert(
37
37
  subPointer.length <= 30,
38
- `You must pass a 30 bytes sub-pointer. (AddressArray, got ${this.subPointer.length})`,
38
+ `You must pass a 30 bytes sub-pointer. (AddressArray, got ${subPointer.length})`,
39
39
  );
40
40
 
41
41
  // Construct base pointer as a 32-byte array