-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarified why typestate requires ownership. Split the discusion of
assets into two pieces.
- Loading branch information
Showing
5 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,14 @@ | ||
States and Assets | ||
------------------ | ||
|
||
States can also be declared as ``asset`` s, which means the contract is an asset (see Part 4) only when in that state. | ||
For example, see an alternate definition of ``Wallet`` below, in which a ``Wallet`` is an ``asset`` only | ||
when it is ``Full``. | ||
|
||
:: | ||
|
||
contract Wallet { | ||
asset state Full; | ||
state Empty; | ||
} | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,8 @@ Obsidian Tutorial | |
ownership2 | ||
ownership3 | ||
ownership4 | ||
assets | ||
states1 | ||
states2 | ||
states3 | ||
assets | ||
states-assets |