Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0320ac959b | |||
| dcef89b486 | |||
| 4957d01e9e | |||
| 9d76e6186a | |||
| ae3edac53e |
+9
-1
@@ -6,9 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- `Option.force_msg`
|
||||
### Changed
|
||||
### Removed
|
||||
|
||||
## [6.0.2] 2021-07-05
|
||||
### Changed
|
||||
- `List.from_to_step` now forbids non-positive step (this change does
|
||||
*not* alter the behavior of the previously deployed contracts)
|
||||
- Fixed leaking state between contracts
|
||||
|
||||
## [6.0.1] 2021-06-24
|
||||
### Changed
|
||||
- Fixed a bug in calldata encoding for contracts containing multiple contracts
|
||||
@@ -303,7 +310,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Simplify calldata creation - instead of passing a compiled contract, simply
|
||||
pass a (stubbed) contract string.
|
||||
|
||||
[Unreleased]: https://github.com/aeternity/aesophia/compare/v6.0.1...HEAD
|
||||
[Unreleased]: https://github.com/aeternity/aesophia/compare/v6.0.2...HEAD
|
||||
[6.0.2]: https://github.com/aeternity/aesophia/compare/v6.0.1...v6.0.2
|
||||
[6.0.1]: https://github.com/aeternity/aesophia/compare/v6.0.0...v6.0.1
|
||||
[6.0.0]: https://github.com/aeternity/aesophia/compare/v5.0.0...v6.0.0
|
||||
[5.0.0]: https://github.com/aeternity/aesophia/compare/v4.3.0...v5.0.0
|
||||
|
||||
+14
-4
@@ -362,7 +362,7 @@ namespace Chain =
|
||||
|
||||
#### tx_hash
|
||||
```
|
||||
Auth.tx_hash : option(Chain.tx)
|
||||
Auth.tx_hash : option(hash)
|
||||
```
|
||||
|
||||
Gets the transaction hash during authentication.
|
||||
@@ -824,7 +824,7 @@ payable contract Auction =
|
||||
stateful entrypoint sell(amount) =
|
||||
require(amount >= 0, "negative_amount")
|
||||
...
|
||||
|
||||
|
||||
main contract Market =
|
||||
type state = list(Auction)
|
||||
entrypoint init() = []
|
||||
@@ -876,7 +876,7 @@ payable contract interface Auction =
|
||||
entrypoint init : (int, string) => void
|
||||
stateful payable entrypoint buy : (int) => ()
|
||||
stateful entrypoint sell : (int) => ()
|
||||
|
||||
|
||||
main contract Market =
|
||||
type state = list(Auction)
|
||||
entrypoint init() = []
|
||||
@@ -1293,7 +1293,17 @@ Escapes `option` wrapping by providing default value for `None`.
|
||||
Option.force(o : option('a)) : 'a
|
||||
```
|
||||
|
||||
Forcefully escapes `option` wrapping assuming it is `Some`. Throws error on `None`.
|
||||
Forcefully escapes the `option` wrapping assuming it is `Some`.
|
||||
Aborts on `None`.
|
||||
|
||||
|
||||
#### force_msg
|
||||
```
|
||||
Option.force_msg(o : option('a), err : string) : 'a
|
||||
```
|
||||
|
||||
Forcefully escapes the `option` wrapping assuming it is `Some`.
|
||||
Aborts with `err` error message on `None`.
|
||||
|
||||
|
||||
#### contains
|
||||
|
||||
@@ -26,6 +26,12 @@ namespace Option =
|
||||
None => abort("Forced None value")
|
||||
Some(x) => x
|
||||
|
||||
/** Assume it is `Some` with custom error message
|
||||
*/
|
||||
function force_msg(o : option('a), err : string) : 'a = switch(o)
|
||||
None => abort(err)
|
||||
Some(x) => x
|
||||
|
||||
function contains(e : 'a, o : option('a)) = o == Some(e)
|
||||
|
||||
function on_elem(o : option('a), f : 'a => unit) : unit = match((), f, o)
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
{base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]}
|
||||
]}.
|
||||
|
||||
{relx, [{release, {aesophia, "6.0.1"},
|
||||
{relx, [{release, {aesophia, "6.0.2"},
|
||||
[aesophia, aebytecode, getopt]},
|
||||
|
||||
{dev_mode, true},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{application, aesophia,
|
||||
[{description, "Compiler for Aeternity Sophia language"},
|
||||
{vsn, "6.0.1"},
|
||||
{vsn, "6.0.2"},
|
||||
{registered, []},
|
||||
{applications,
|
||||
[kernel,
|
||||
|
||||
Reference in New Issue
Block a user