-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): better example test and contract
- Loading branch information
Showing
2 changed files
with
25 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
@compiler >= 6 | ||
|
||
main contract Example = | ||
entrypoint example(x : int) = x | ||
type state = option(int) | ||
|
||
datatype event = SetXEvent(address, int) | ||
entrypoint init() : state = None | ||
|
||
stateful entrypoint set(x : int) : unit = | ||
Chain.event(SetXEvent(Call.caller, x)) | ||
put(Some(x)) | ||
|
||
entrypoint get() : option(int) = state |
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