-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add implicit create methods to contracts which don't have an ex…
…plicit one
- Loading branch information
1 parent
32ac667
commit dc95de6
Showing
2 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { abimethod, Contract } from '@algorandfoundation/algorand-typescript' | ||
import { baremethod } from '@algorandfoundation/algorand-typescript/arc4' | ||
|
||
// @expect-error Non-abstract ARC4 contract has no methods which can be called to create the contract... | ||
export class CantCreate extends Contract { | ||
@baremethod({ allowActions: 'NoOp' }) | ||
public handleBare() {} | ||
} | ||
|
||
export abstract class CantCreateAbstract extends Contract { | ||
@baremethod({ allowActions: 'NoOp' }) | ||
public handleBare() {} | ||
} | ||
|
||
export abstract class NoBare extends Contract { | ||
@abimethod({ allowActions: 'NoOp' }) | ||
public handleNoop() {} | ||
} | ||
export abstract class NoNoOp extends Contract { | ||
@baremethod({ allowActions: 'UpdateApplication' }) | ||
public handleUpdate() {} | ||
} |