sophia/test/contracts/funargs.aes
Hans Svensson 6d79d2d558
GH344 - Add builtin types in decoder (#345)
* Only use basic types in type_env

* Add builtin types to the calldata/result decoder for FATE
2021-09-30 19:11:00 +02:00

60 lines
1.2 KiB
Plaintext

include "String.aes"
contract FunctionArguments =
entrypoint sum(n : int, m: int) =
n + m
entrypoint append(xs : list(string)) =
switch(xs)
[] => ""
y :: ys => String.concat(y, append(ys))
entrypoint menot(b) =
!b
entrypoint bitsum(b : bits) =
Bits.sum(b)
record answer('a) = {label : string, result : 'a}
entrypoint read(a : answer(int)) =
a.result
entrypoint sjutton(b : bytes(17)) =
b
entrypoint sextiosju(b : bytes(67)) =
b
entrypoint trettiotva(b : bytes(32)) =
b
entrypoint find_oracle(o : oracle(int, bool)) =
true
entrypoint find_query(q : oracle_query(int, bool)) =
true
datatype colour() = Green | Yellow | Red | Pantone(int)
entrypoint traffic_light(c : colour) =
Red
entrypoint tuples(t : unit) =
t
entrypoint due(t : Chain.ttl) =
true
record singleton_r = { x : int }
entrypoint singleton_rec(r : singleton_r) =
r.x
entrypoint aens_name(n : AENS.name) = true
entrypoint aens_pointee(p : AENS.pointee) = true
entrypoint chain_ga_meta_tx(tx : Chain.ga_meta_tx) = true
entrypoint chain_paying_for_tx(tx : Chain.paying_for_tx) = true
entrypoint chain_base_tx(tx : Chain.base_tx) = true