create struct Air Env
refactor out some to_strings
This commit is contained in:
@@ -45,3 +45,36 @@ test foo_4() {
|
||||
False
|
||||
}
|
||||
}
|
||||
|
||||
// type Seasons {
|
||||
// Winter
|
||||
// Spring
|
||||
// Summer
|
||||
// Fall
|
||||
// }
|
||||
|
||||
// fn is_cold(season, hour) {
|
||||
// when season is {
|
||||
// Winter | Fall ->
|
||||
// True
|
||||
// _ if hour >= 18 ->
|
||||
// True
|
||||
// _ ->
|
||||
// False
|
||||
// }
|
||||
// }
|
||||
|
||||
// test foo_5() {
|
||||
// !is_cold(Spring, 15) && is_cold(Summer, 22)
|
||||
// }
|
||||
|
||||
fn when_tuple(a: (Int, Int)) -> Int {
|
||||
when a is {
|
||||
(a, _b) ->
|
||||
a
|
||||
}
|
||||
}
|
||||
|
||||
test spend() {
|
||||
when_tuple((4, 1)) == 4
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"preamble": {
|
||||
"title": "aiken-lang/acceptance_test_048",
|
||||
"version": "0.0.0",
|
||||
"plutusVersion": "v2"
|
||||
},
|
||||
"validators": [
|
||||
{
|
||||
"title": "foo.spend",
|
||||
"datum": {
|
||||
"title": "a",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "b",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "586001000032323232323232323222253330063370e6464640046eb4c02c008dd69804800a5ef6c6010104000101010048020526163001001222533300800214984cc014c004c024008ccc00c00cc0280080055cd2b9b5573aaae7955cfaba157441",
|
||||
"hash": "7ecbfc3ae91c4d5ba3799b4d283e385d457c860cd22034d825379ae2"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"Data": {
|
||||
"title": "Data",
|
||||
"description": "Any Plutus data."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
fn when_tuple(a: (Int, Int)) -> Int {
|
||||
when a is {
|
||||
(a, b) ->
|
||||
a
|
||||
}
|
||||
}
|
||||
|
||||
validator {
|
||||
fn spend(a: Data, b: Data, c) -> Bool {
|
||||
when_tuple((4, 1)) == 4
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user