Add 'exported_data' test and revert 413a056
This commit is contained in:
parent
413a056c08
commit
70cdf3cb26
|
@ -296,17 +296,6 @@ impl Annotated<Schema> {
|
|||
description,
|
||||
annotated: data,
|
||||
}),
|
||||
|
||||
Annotated {
|
||||
title: Some(title),
|
||||
description,
|
||||
annotated: Schema::Data(None),
|
||||
} if title == "Data" => Ok(Annotated {
|
||||
title: Some(title),
|
||||
description,
|
||||
annotated: Data::AnyOf(vec![]),
|
||||
}),
|
||||
|
||||
_ => Err(Error::new(ErrorContext::ExpectedData, type_info)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -635,4 +635,35 @@ mod test {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exported_data() {
|
||||
assert_validator(
|
||||
r#"
|
||||
pub type Foo {
|
||||
foo: Data
|
||||
}
|
||||
|
||||
validator spend {
|
||||
fn(datum: Data, redeemer: Int, ctx: Void) {
|
||||
True
|
||||
}
|
||||
}
|
||||
"#,
|
||||
json!(
|
||||
{
|
||||
"title": "test_module.spend",
|
||||
"hash": "a3dbab684d90d19e6bab3a0b00a7290ff59fe637d14428859bf74376",
|
||||
"datum": {
|
||||
"title": "Data",
|
||||
"description": "Any Plutus data.",
|
||||
},
|
||||
"redeemer": {
|
||||
"dataType": "integer",
|
||||
},
|
||||
"compiledCode": "5840010000323232323232322232253330074a22930b1bad0013001001222533300600214984cc014c004c01c008ccc00c00cc0200080055cd2b9b5573eae855d101"
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue