@btc-vision/btc-runtime 1.1.3 → 1.1.4
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
|
@@ -356,9 +356,6 @@ export abstract class DeployableOP_20 extends OP_NET implements IOP_20 {
|
|
|
356
356
|
|
|
357
357
|
protected _transferFrom(from: Address, to: Address, value: u256): boolean {
|
|
358
358
|
const spender = Blockchain.origin;
|
|
359
|
-
if (Blockchain.sender !== from) {
|
|
360
|
-
throw new Revert('Not caller.');
|
|
361
|
-
}
|
|
362
359
|
|
|
363
360
|
if (this.isSelf(spender)) throw new Revert('Can not transfer from self account');
|
|
364
361
|
|
|
@@ -33,6 +33,8 @@ export class BlockchainEnvironment {
|
|
|
33
33
|
private events: NetEvent[] = [];
|
|
34
34
|
private currentBlock: u256 = u256.Zero;
|
|
35
35
|
|
|
36
|
+
private _selfContract: Potential<OP_NET> = null;
|
|
37
|
+
|
|
36
38
|
constructor() {}
|
|
37
39
|
|
|
38
40
|
private _origin: PotentialAddress = null;
|
|
@@ -68,7 +70,11 @@ export class BlockchainEnvironment {
|
|
|
68
70
|
throw this.error('Contract is required');
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
if (!this._selfContract) {
|
|
74
|
+
this._selfContract = this._contract();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return this._selfContract as OP_NET;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
public set contract(contract: () => OP_NET) {
|
|
@@ -126,6 +132,8 @@ export class BlockchainEnvironment {
|
|
|
126
132
|
this._contractAddress = reader.readAddress();
|
|
127
133
|
|
|
128
134
|
this._timestamp = reader.readU64();
|
|
135
|
+
|
|
136
|
+
this.contract;
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
public call(destinationContract: Address, calldata: BytesWriter): BytesReader {
|