fix: private type leaks

This commit is contained in:
rvcas 2024-08-08 18:51:29 -04:00 committed by KtorZ
parent 79840248c0
commit 00b8a39236
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
2 changed files with 25 additions and 25 deletions

View File

@ -415,7 +415,7 @@ mod tests {
assert_validator!(
r#"
/// On-chain state
type State {
pub type State {
/// The contestation period as a number of seconds
contestationPeriod: ContestationPeriod,
/// List of public key hashes of all participants
@ -424,20 +424,20 @@ mod tests {
}
/// A Hash digest for a given algorithm.
type Hash<alg> = ByteArray
pub type Hash<alg> = ByteArray
type Blake2b_256 { Blake2b_256 }
pub type Blake2b_256 { Blake2b_256 }
/// Whatever
type ContestationPeriod {
pub type ContestationPeriod {
/// A positive, non-zero number of seconds.
ContestationPeriod(Int)
}
type Party =
pub type Party =
ByteArray
type Input {
pub type Input {
CollectCom
Close
/// Abort a transaction
@ -470,12 +470,12 @@ mod tests {
fn generics() {
assert_validator!(
r#"
type Either<left, right> {
pub type Either<left, right> {
Left(left)
Right(right)
}
type Interval<a> {
pub type Interval<a> {
Finite(a)
Infinite
}
@ -493,8 +493,8 @@ mod tests {
fn free_vars() {
assert_validator!(
r#"
validator {
fn generics(redeemer: a, ctx: Void) {
validator generics {
spend(redeemer: a, ctx: Void) {
True
}
}
@ -506,11 +506,11 @@ mod tests {
fn list_2_tuples_as_list() {
assert_validator!(
r#"
type Dict<key, value> {
pub type Dict<key, value> {
inner: List<(ByteArray, value)>
}
type UUID { UUID }
pub type UUID { UUID }
validator list_2_tuples_as_list {
mint(redeemer: Dict<UUID, Int>, ctx: Void) {
@ -525,14 +525,14 @@ mod tests {
fn list_pairs_as_map() {
assert_validator!(
r#"
type Dict<key, value> {
pub type Dict<key, value> {
inner: List<Pair<ByteArray, value>>
}
type UUID { UUID }
pub type UUID { UUID }
validator {
fn list_pairs_as_map(redeemer: Dict<UUID, Int>, ctx: Void) {
validator list_pairs_as_map {
spend(redeemer: Dict<UUID, Int>, ctx: Void) {
True
}
}
@ -548,7 +548,7 @@ mod tests {
inner: List<(ByteArray, value)>
}
type UUID { UUID }
pub type UUID { UUID }
validator opaque_singleton_variants {
spend(redeemer: Dict<UUID, Int>, ctx: Void) {

View File

@ -3673,16 +3673,16 @@ fn when_bool_is_false() {
#[test]
fn when_tuple_deconstruction() {
let src = r#"
type Thing {
pub type Thing {
idx: Int,
}
type Datum {
pub type Datum {
A(Thing)
B
}
type RedSpend {
pub type RedSpend {
Spend(Int)
Buy
}
@ -4037,12 +4037,12 @@ fn when_tuple_empty_lists() {
#[test]
fn generic_validator_type_test() {
let src = r#"
type A<x> {
pub type A<x> {
NoA
SomeA(Void, x)
}
type B {
pub type B {
something: Void,
}
@ -5548,15 +5548,15 @@ fn list_clause_with_assign() {
#[test]
fn opaque_value_in_datum() {
let src = r#"
opaque type Value {
pub opaque type Value {
inner: Dict<Dict<Int>>
}
opaque type Dict<v> {
pub opaque type Dict<v> {
inner: List<Pair<ByteArray, v>>
}
type Dat {
pub type Dat {
c: Int,
a: Value
}