aqua/npm/test/sample.aqua
2022-05-17 15:05:25 +03:00

45 lines
926 B
Plaintext

import "@fluencelabs/aqua-lib/builtin.aqua"
-- import "run-builtins.aqua"
data StructType:
numField: u32
arrField: []string
service OpString("op"):
identity(s: string) -> string
service OpNumber("op"):
identity(n: u32) -> u32
service OpStruct("op"):
identity(st: StructType) -> StructType
noop()
func parseBug():
stream: *string
if stream[0] != "FOO":
Op.noop()
func identityArgsAndReturn (structArg: StructType, stringArg: string, numberArg: u32) -> string, u32, StructType:
on HOST_PEER_ID:
sArg <- OpString.identity(stringArg)
nArg = OpNumber.identity (numberArg) + OpNumber.identity (numberArg)
stArg <- OpStruct.identity(structArg)
-- it could be used only on init_peer_id
<- sArg, nArg, stArg
service Ssss("ss"):
foo4: u64 -> u16
func aaa(a: u64) -> u16:
res <- Ssss.foo4(a)
<- res
func bar(callback: u32 -> u32):
callback(1)
func baz():
bar(aaa)