@algorandfoundation/algorand-typescript-testing 1.0.0-beta.6 → 1.0.0-beta.8
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/index.mjs +8 -2
- package/index.mjs.map +1 -1
- package/package.json +3 -3
package/index.mjs
CHANGED
|
@@ -3577,6 +3577,12 @@ class ContractContext {
|
|
|
3577
3577
|
return txns;
|
|
3578
3578
|
}
|
|
3579
3579
|
isArc4(type) {
|
|
3580
|
+
const result = type.isArc4;
|
|
3581
|
+
if (result !== undefined && result !== null) {
|
|
3582
|
+
return result;
|
|
3583
|
+
}
|
|
3584
|
+
// TODO: uncomment the following line once version puya-ts 1.0.0 is released and delete the rest of the function
|
|
3585
|
+
// throw new internal.errors.CodeError('Cannot create a contract for class as it does not extend Contract or BaseContract')
|
|
3580
3586
|
const proto = Object.getPrototypeOf(type);
|
|
3581
3587
|
if (proto === BaseContract) {
|
|
3582
3588
|
return false;
|
|
@@ -3584,8 +3590,8 @@ class ContractContext {
|
|
|
3584
3590
|
else if (proto === Contract) {
|
|
3585
3591
|
return true;
|
|
3586
3592
|
}
|
|
3587
|
-
else if (proto === Object) {
|
|
3588
|
-
throw new
|
|
3593
|
+
else if (proto === Object || proto === null) {
|
|
3594
|
+
throw new internal.errors.CodeError('Cannot create a contract for class as it does not extend Contract or BaseContract');
|
|
3589
3595
|
}
|
|
3590
3596
|
return this.isArc4(proto);
|
|
3591
3597
|
}
|