File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -155,20 +155,20 @@ export class ContractContext {
155155 }
156156
157157 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-
161158 const result = ( type as DeliberateAny as typeof BaseContract ) . isArc4
162159 if ( result !== undefined && result !== null ) {
163160 return result
164161 }
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+
165165 const proto = Object . getPrototypeOf ( type )
166166 if ( proto === BaseContract ) {
167167 return false
168168 } else if ( proto === Contract ) {
169169 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' )
172172 }
173173 return this . isArc4 ( proto )
174174 }
You can’t perform that action at this time.
0 commit comments