@algorandfoundation/algorand-typescript-testing 1.0.0-beta.6 → 1.0.0-beta.7

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 CHANGED
@@ -3577,6 +3577,12 @@ class ContractContext {
3577
3577
  return txns;
3578
3578
  }
3579
3579
  isArc4(type) {
3580
+ // TODO: uncomment the following line once version puya-ts 1.0.0 is released
3581
+ // return (type as DeliberateAny as typeof BaseContract).isArc4 ?? false
3582
+ const result = type.isArc4;
3583
+ if (result !== undefined && result !== null) {
3584
+ return result;
3585
+ }
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 Error('Cannot create a contract for class as it does not extend Contract or BaseContract');
3593
+ else if (proto === null) {
3594
+ return false;
3589
3595
  }
3590
3596
  return this.isArc4(proto);
3591
3597
  }