Skip to content

Commit

Permalink
fix: private type leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas authored and KtorZ committed Aug 25, 2024
1 parent 7984024 commit 00b8a39
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
34 changes: 17 additions & 17 deletions crates/aiken-project/src/blueprint/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
}
Expand All @@ -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) {
Expand All @@ -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
}
}
Expand All @@ -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) {
Expand Down
16 changes: 8 additions & 8 deletions crates/aiken-project/src/tests/gen_uplc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 00b8a39

Please sign in to comment.