File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -155,20 +155,20 @@ export class ContractContext {
155
155
}
156
156
157
157
private isArc4 < T extends BaseContract > ( type : IConstructor < T > ) : boolean {
158
- // TODO: uncomment the following line once version puya-ts 1.0.0 is released
159
- // return (type as DeliberateAny as typeof BaseContract).isArc4 ?? false
160
-
161
158
const result = ( type as DeliberateAny as typeof BaseContract ) . isArc4
162
159
if ( result !== undefined && result !== null ) {
163
160
return result
164
161
}
162
+ // TODO: uncomment the following line once version puya-ts 1.0.0 is released and delete the rest of the function
163
+ // throw new internal.errors.CodeError('Cannot create a contract for class as it does not extend Contract or BaseContract')
164
+
165
165
const proto = Object . getPrototypeOf ( type )
166
166
if ( proto === BaseContract ) {
167
167
return false
168
168
} else if ( proto === Contract ) {
169
169
return true
170
- } else if ( proto === null ) {
171
- return false
170
+ } else if ( proto === Object || proto === null ) {
171
+ throw new internal . errors . CodeError ( 'Cannot create a contract for class as it does not extend Contract or BaseContract' )
172
172
}
173
173
return this . isArc4 ( proto )
174
174
}
You can’t perform that action at this time.
0 commit comments