fix: expect _ = ... not including the cast from data logic if the type is data and right hand has a type annotation

This commit is contained in:
microproofs
2023-06-23 18:39:12 -04:00
parent 226556bdd6
commit 8b3504e9a1
7 changed files with 106 additions and 5 deletions

View File

@@ -0,0 +1,13 @@
# This file was generated by Aiken
# You typically do not need to edit this file
[[requirements]]
name = "aiken-lang/stdlib"
version = "main"
source = "github"
[[packages]]
name = "aiken-lang/stdlib"
version = "main"
requirements = []
source = "github"

View File

@@ -0,0 +1,8 @@
name = "aiken-lang/acceptance_test_085"
version = "0.0.0"
description = ""
[[dependencies]]
name = 'aiken-lang/stdlib'
version = 'main'
source = 'github'

View File

@@ -0,0 +1,19 @@
pub type AssetClass {
policy: ByteArray,
name: ByteArray,
}
pub type DatumOrc {
oracle_parameters: OracleParametersd,
token_a_amount: Int,
token_b_amount: Int,
expiration_time: Int,
maturity_time: Int,
}
pub type OracleParametersd {
pool_nft_cs: AssetClass,
oracle_nft_cs: AssetClass,
token_a_cs: AssetClass,
token_b_cs: AssetClass,
}

View File

@@ -0,0 +1,44 @@
use other
pub type AssetClass {
policy: ByteArray,
name: ByteArray,
}
pub type DatumOrc1 {
oracle_parameters: OracleParametersd,
token_a_amount: Int,
token_b_amount: Int,
expiration_time: Int,
maturity_time: Int,
}
pub type OracleParametersd {
pool_nft_cs: AssetClass,
oracle_nft_cs: AssetClass,
token_a_cs: AssetClass,
token_b_cs: AssetClass,
}
test oracle1() {
let x: Data =
DatumOrc1 {
oracle_parameters: OracleParametersd {
pool_nft_cs: AssetClass { policy: #"", name: #"" },
oracle_nft_cs: AssetClass { policy: #"", name: #"" },
token_a_cs: AssetClass { policy: #"", name: #"" },
token_b_cs: AssetClass { policy: #"", name: #"" },
},
token_a_amount: 0,
token_b_amount: 0,
expiration_time: 0,
maturity_time: 0,
}
let y: Data = x
expect _: other.DatumOrc = y
// od == od
True
}