parent
ad4840958c
commit
25ebdc2527
|
@ -968,6 +968,15 @@ impl Annotation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn data(location: Span) -> Self {
|
||||||
|
Annotation::Constructor {
|
||||||
|
name: "Data".to_string(),
|
||||||
|
module: None,
|
||||||
|
arguments: vec![],
|
||||||
|
location,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn is_logically_equal(&self, other: &Annotation) -> bool {
|
pub fn is_logically_equal(&self, other: &Annotation) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Annotation::Constructor {
|
Annotation::Constructor {
|
||||||
|
|
|
@ -1144,10 +1144,21 @@ impl<'a> Environment<'a> {
|
||||||
params,
|
params,
|
||||||
..
|
..
|
||||||
}) if kind.is_validator() => {
|
}) if kind.is_validator() => {
|
||||||
|
let default_annotation = |mut arg: UntypedArg| {
|
||||||
|
if arg.annotation.is_none() {
|
||||||
|
arg.annotation = Some(Annotation::data(arg.location));
|
||||||
|
|
||||||
|
arg
|
||||||
|
} else {
|
||||||
|
arg
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let temp_params: Vec<UntypedArg> = params
|
let temp_params: Vec<UntypedArg> = params
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.chain(fun.arguments.clone())
|
.chain(fun.arguments.clone())
|
||||||
|
.map(default_annotation)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
self.register_function(
|
self.register_function(
|
||||||
|
@ -1165,6 +1176,7 @@ impl<'a> Environment<'a> {
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.chain(other.arguments.clone())
|
.chain(other.arguments.clone())
|
||||||
|
.map(default_annotation)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
self.register_function(
|
self.register_function(
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# This file was generated by Aiken
|
||||||
|
# You typically do not need to edit this file
|
||||||
|
|
||||||
|
[[requirements]]
|
||||||
|
name = "aiken-lang/stdlib"
|
||||||
|
version = "1.7.0"
|
||||||
|
source = "github"
|
||||||
|
|
||||||
|
[[packages]]
|
||||||
|
name = "aiken-lang/stdlib"
|
||||||
|
version = "1.7.0"
|
||||||
|
requirements = []
|
||||||
|
source = "github"
|
||||||
|
|
||||||
|
[etags]
|
|
@ -0,0 +1,14 @@
|
||||||
|
name = "aiken-lang/acceptance_test_096"
|
||||||
|
version = "0.0.0"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
description = "Aiken contracts for project 'aiken-lang/096'"
|
||||||
|
|
||||||
|
[repository]
|
||||||
|
user = "aiken-lang"
|
||||||
|
project = "096"
|
||||||
|
platform = "github"
|
||||||
|
|
||||||
|
[[dependencies]]
|
||||||
|
name = "aiken-lang/stdlib"
|
||||||
|
version = "1.7.0"
|
||||||
|
source = "github"
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"preamble": {
|
||||||
|
"title": "aiken-lang/acceptance_test_096",
|
||||||
|
"description": "Aiken contracts for project 'aiken-lang/096'",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"plutusVersion": "v2",
|
||||||
|
"compiler": {
|
||||||
|
"name": "Aiken",
|
||||||
|
"version": "v1.0.24-alpha+ad48409"
|
||||||
|
},
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
|
"validators": [
|
||||||
|
{
|
||||||
|
"title": "foo.is_fourty_two",
|
||||||
|
"datum": {
|
||||||
|
"title": "dat",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/Data"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"redeemer": {
|
||||||
|
"title": "rdm",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/Data"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"compiledCode": "583c01000032222533300453330043375e004006266e3d22010b68656c6c6f20776f726c640048810b68656c6c6f20776f726c640014a029309b2b2b9a01",
|
||||||
|
"hash": "d1a4ef5efcf38bdca9dc8eec2684d3c2004390fa6fd1b5bed6faa488"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"definitions": {
|
||||||
|
"Data": {
|
||||||
|
"title": "Data",
|
||||||
|
"description": "Any Plutus data."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
use aiken/transaction.{ScriptContext}
|
||||||
|
|
||||||
|
validator {
|
||||||
|
fn is_fourty_two(dat, rdm, _ctx: ScriptContext) -> Bool {
|
||||||
|
rdm == dat && #"68656c6c6f20776f726c64" == #"68656c6c6f20776f726c64"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue