fix: zero arg functions were grabbing extra dependencies they didn't need to

fix: Had the wrong conversion for constant maps to plutus data. Fixed to check for right conversion
This commit is contained in:
microproofs
2023-06-04 15:23:36 -04:00
parent cf6d04e95b
commit bfd2a50a6b
4 changed files with 84 additions and 11 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_082"
version = "0.0.0"
description = ""
[[dependencies]]
name = 'aiken-lang/stdlib'
version = 'main'
source = 'github'

View File

@@ -0,0 +1,29 @@
use aiken/list
use aiken/transaction/value.{Value}
test foldl_value_test1() {
let val1 = value.from_lovelace(1000000)
let val2 = value.from_lovelace(2000000)
let foo =
fn(i: Value, acc: (Value, Int)) {
let (v, int) = acc
(value.add(i, v), int + 1)
}
list.foldl([val1, val2], foo, (value.zero(), 0)) == (
value.from_lovelace(3000000),
2,
)
}
// test foldl_value_test2() {
// let val1 = value.from_lovelace(1000000)
// let val2 = value.from_lovelace(2000000)
// let foo =
// fn(i: Value, acc: (Value, Int)) {
// let (v, int) = acc
// (value.add(i, v), int + 1)
// }
// list.foldl([val1, val2], foo, (value.from_lovelace(0), 0)) == (
// value.from_lovelace(3000000),
// 2,
// )
// }