feat: centralize some Cargo.toml configs at root and upgrade to edition 2024

This commit is contained in:
rvcas 2025-03-23 21:06:13 -04:00 committed by Lucas
parent 5f9b5ac781
commit 824431371e
92 changed files with 440 additions and 426 deletions

View File

@ -2,6 +2,21 @@
members = ["crates/*"]
resolver = "2"
[workspace.package]
description = "Cardano smart contract language and toolchain"
documentation = "https://aiken-lang.org"
version = "1.1.15"
edition = "2024"
repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
authors = [
"Lucas Rosa <x@rvcas.dev>",
"Kasey White <kwhitemsg@gmail.com>",
"KtorZ <matthias.benkort@gmail.com>",
]
rust-version = "1.85.0"
[workspace.metadata.release]
shared-version = true
tag-name = "v{{version}}"
@ -17,7 +32,12 @@ installers = ["shell", "powershell", "npm", "homebrew"]
# A GitHub repo to push Homebrew formulas to
tap = "aiken-lang/homebrew-tap"
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-musl",
"x86_64-pc-windows-msvc",
]
# The archive format to use for windows builds (defaults .zip)
windows-archive = ".tar.gz"
# The archive format to use for non-windows builds (defaults .tar.xz)

View File

@ -1,17 +1,15 @@
[package]
name = "aiken-lang"
description = "The Aiken compiler"
version = "1.1.15"
edition = "2021"
repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
authors = [
"Lucas Rosa <x@rvcas.dev>",
"Kasey White <kwhitemsg@gmail.com>",
"KtorZ <matthias.benkort@gmail.com>",
]
rust-version = "1.80.0"
version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
rust-version.workspace = true
build = "build.rs"
[dependencies]

View File

@ -17,7 +17,7 @@ use std::{
rc::Rc,
};
use uplc::machine::runtime::Compressable;
use vec1::{vec1, Vec1};
use vec1::{Vec1, vec1};
pub const BACKPASS_VARIABLE: &str = "_backpass";
pub const CAPTURE_VARIABLE: &str = "_capture";
@ -956,7 +956,7 @@ pub struct CallArg<A> {
impl CallArg<UntypedExpr> {
pub fn is_capture_hole(&self) -> bool {
match &self.value {
UntypedExpr::Var { ref name, .. } => name.contains(CAPTURE_VARIABLE),
UntypedExpr::Var { name, .. } => name.contains(CAPTURE_VARIABLE),
_ => false,
}
}

View File

@ -1,16 +1,15 @@
use crate::{
aiken_fn,
IdGenerator, aiken_fn,
ast::{
well_known, Annotation, ArgName, CallArg, DataType, DataTypeKey, Function,
FunctionAccessKey, ModuleKind, OnTestFailure, RecordConstructor, RecordConstructorArg,
Span, TypedArg, TypedDataType, TypedFunction, UnOp,
Annotation, ArgName, CallArg, DataType, DataTypeKey, Function, FunctionAccessKey,
ModuleKind, OnTestFailure, RecordConstructor, RecordConstructorArg, Span, TypedArg,
TypedDataType, TypedFunction, UnOp, well_known,
},
expr::TypedExpr,
tipo::{
fields::FieldMap, Type, TypeConstructor, TypeInfo, ValueConstructor,
ValueConstructorVariant,
Type, TypeConstructor, TypeInfo, ValueConstructor, ValueConstructorVariant,
fields::FieldMap,
},
IdGenerator,
};
use std::{collections::BTreeSet, sync::LazyLock};

View File

@ -9,17 +9,17 @@ pub(crate) use crate::{
},
parser::token::Base,
tipo::{
check_replaceable_opaque_type, convert_opaque_type, lookup_data_type_by_tipo,
ModuleValueConstructor, Type, TypeVar, ValueConstructor, ValueConstructorVariant,
check_replaceable_opaque_type, convert_opaque_type, lookup_data_type_by_tipo,
},
};
use indexmap::IndexMap;
use pallas_primitives::alonzo::{Constr, PlutusData};
use std::{fmt::Debug, rc::Rc};
use uplc::{
KeyValuePairs,
ast::Data,
machine::{runtime::convert_tag_to_constr, value::from_pallas_bigint},
KeyValuePairs,
};
use vec1::Vec1;
@ -1219,30 +1219,22 @@ impl UntypedExpr {
name: constructor.name.to_string(),
})
} else {
let arguments =
fields
let arguments = fields
.to_vec()
.into_iter()
.zip(constructor.arguments.iter())
.map(
|(
field,
RecordConstructorArg {
ref label,
ref tipo,
..
},
)| {
.map(|(field, RecordConstructorArg { label, tipo, .. })| {
UntypedExpr::do_reify_data(
generics, data_types, field, tipo,
)
.map(|value| CallArg {
.map(|value| {
CallArg {
label: label.clone(),
location: Span::empty(),
value,
}
})
})
},
)
.collect::<Result<Vec<_>, _>>()?;
Ok(UntypedExpr::Call {

View File

@ -1,20 +1,20 @@
use crate::{
ast::{
Annotation, ArgBy, ArgName, ArgVia, AssignmentKind, AssignmentPattern, BinOp,
ByteArrayFormatPreference, CallArg, CurveType, DataType, Definition, Function,
LogicalOpChainKind, ModuleConstant, Namespace, OnTestFailure, Pattern, RecordConstructor,
RecordConstructorArg, RecordUpdateSpread, Span, TraceKind, TypeAlias, TypedArg,
TypedValidator, UnOp, UnqualifiedImport, UntypedArg, UntypedArgVia, UntypedAssignmentKind,
UntypedClause, UntypedDefinition, UntypedFunction, UntypedIfBranch, UntypedModule,
UntypedPattern, UntypedRecordUpdateArg, Use, Validator, CAPTURE_VARIABLE,
ByteArrayFormatPreference, CAPTURE_VARIABLE, CallArg, CurveType, DataType, Definition,
Function, LogicalOpChainKind, ModuleConstant, Namespace, OnTestFailure, Pattern,
RecordConstructor, RecordConstructorArg, RecordUpdateSpread, Span, TraceKind, TypeAlias,
TypedArg, TypedValidator, UnOp, UnqualifiedImport, UntypedArg, UntypedArgVia,
UntypedAssignmentKind, UntypedClause, UntypedDefinition, UntypedFunction, UntypedIfBranch,
UntypedModule, UntypedPattern, UntypedRecordUpdateArg, Use, Validator,
},
docvec,
expr::{FnStyle, TypedExpr, UntypedExpr, DEFAULT_ERROR_STR, DEFAULT_TODO_STR},
expr::{DEFAULT_ERROR_STR, DEFAULT_TODO_STR, FnStyle, TypedExpr, UntypedExpr},
parser::{
extra::{Comment, ModuleExtra},
token::Base,
},
pretty::{break_, concat, flex_break, join, line, lines, nil, Document, Documentable},
pretty::{Document, Documentable, break_, concat, flex_break, join, line, lines, nil},
tipo::{self, Type},
};
use itertools::Itertools;
@ -84,7 +84,10 @@ impl<'comments> Formatter<'comments> {
// Pop comments that occur before a byte-index in the source, consuming
// and retaining any empty lines contained within.
fn pop_comments(&mut self, limit: usize) -> impl Iterator<Item = Option<&'comments str>> {
fn pop_comments(
&mut self,
limit: usize,
) -> impl Iterator<Item = Option<&'comments str>> + use<'comments> {
let (popped, rest, empty_lines) =
comments_before(self.comments, self.empty_lines, limit, true);
@ -2130,11 +2133,7 @@ impl<'a> Documentable<'a> for &'a ArgName {
}
fn pub_(public: bool) -> Document<'static> {
if public {
"pub ".to_doc()
} else {
nil()
}
if public { "pub ".to_doc() } else { nil() }
}
impl<'a> Documentable<'a> for &'a UnqualifiedImport {

View File

@ -8,13 +8,14 @@ pub mod tree;
use self::{
air::Air,
builder::{
AssignmentProperties, CodeGenSpecialFuncs, CycleFunctionNames, HoistableFunction, Variant,
cast_validator_args, convert_type_to_data, extract_constant, modify_cyclic_calls,
modify_self_calls, AssignmentProperties, CodeGenSpecialFuncs, CycleFunctionNames,
HoistableFunction, Variant,
modify_self_calls,
},
tree::{AirTree, TreePath},
};
use crate::{
IdGenerator,
ast::{
AssignmentKind, BinOp, Bls12_381Point, Curve, DataTypeKey, FunctionAccessKey, Pattern,
Span, TraceLevel, Tracing, TypedArg, TypedDataType, TypedFunction, TypedPattern,
@ -25,30 +26,29 @@ use crate::{
gen_uplc::{
air::ExpectLevel,
builder::{
erase_opaque_type_operations, get_generic_variant_name, get_line_columns_by_span,
get_src_code_by_span, known_data_to_type, monomorphize, wrap_validator_condition,
CodeGenFunction,
CodeGenFunction, erase_opaque_type_operations, get_generic_variant_name,
get_line_columns_by_span, get_src_code_by_span, known_data_to_type, monomorphize,
wrap_validator_condition,
},
},
line_numbers::LineNumbers,
plutus_version::PlutusVersion,
tipo::{
check_replaceable_opaque_type, convert_opaque_type, find_and_replace_generics,
get_arg_type_name, get_generic_id_and_type, lookup_data_type_by_tipo,
ModuleValueConstructor, PatternConstructor, Type, TypeInfo, ValueConstructor,
ValueConstructorVariant,
ValueConstructorVariant, check_replaceable_opaque_type, convert_opaque_type,
find_and_replace_generics, get_arg_type_name, get_generic_id_and_type,
lookup_data_type_by_tipo,
},
IdGenerator,
};
use builder::{
introduce_name, introduce_pattern, pop_pattern, softcast_data_to_type_otherwise,
unknown_data_to_type, DISCARDED,
DISCARDED, introduce_name, introduce_pattern, pop_pattern, softcast_data_to_type_otherwise,
unknown_data_to_type,
};
use decision_tree::{get_tipo_by_path, Assigned, CaseTest, DecisionTree, TreeGen};
use decision_tree::{Assigned, CaseTest, DecisionTree, TreeGen, get_tipo_by_path};
use indexmap::IndexMap;
use interner::AirInterner;
use itertools::Itertools;
use petgraph::{algo, Graph};
use petgraph::{Graph, algo};
use std::{collections::HashMap, rc::Rc};
use stick_break_set::{Builtins, TreeSet};
use tree::Fields;
@ -2451,7 +2451,7 @@ impl<'a> CodeGenerator<'a> {
let last_clause = if data_type
.as_ref()
.map_or(true, |d| d.constructors.len() != cases.len())
.is_none_or(|d| d.constructors.len() != cases.len())
{
*default.unwrap()
} else {

View File

@ -10,19 +10,19 @@ use crate::{
},
line_numbers::{LineColumn, LineNumbers},
tipo::{
check_replaceable_opaque_type, convert_opaque_type, find_and_replace_generics, Type,
ValueConstructor, ValueConstructorVariant,
Type, ValueConstructor, ValueConstructorVariant, check_replaceable_opaque_type,
convert_opaque_type, find_and_replace_generics,
},
};
use indexmap::IndexMap;
use itertools::{Itertools, Position};
use std::{ops::Deref, rc::Rc};
use uplc::{
KeyValuePairs, PlutusData,
ast::{Constant as UplcConstant, Data, Name, Term, Type as UplcType},
builder::{CONSTR_FIELDS_EXPOSER, CONSTR_INDEX_EXPOSER},
builtins::DefaultFunction,
machine::{runtime::Compressable, value::to_pallas_bigint},
KeyValuePairs, PlutusData,
};
pub type Variant = String;

View File

@ -7,7 +7,7 @@ use itertools::{Either, Itertools, Position};
use crate::{
ast::{DataTypeKey, Pattern, TypedClause, TypedDataType, TypedPattern},
expr::{lookup_data_type_by_tipo, Type, TypeVar, TypedExpr},
expr::{Type, TypeVar, TypedExpr, lookup_data_type_by_tipo},
};
use super::{interner::AirInterner, tree::AirTree};
@ -726,10 +726,12 @@ impl<'a, 'b> TreeGen<'a, 'b> {
// First step make sure all rows have same number of columns
// or something went wrong
assert!(matrix
assert!(
matrix
.rows
.iter()
.all(|row| { row.columns.len() == column_length }));
.all(|row| { row.columns.len() == column_length })
);
// Find which column has the most important pattern
let occurrence_col = highest_occurrence(&matrix, column_length);
@ -1367,6 +1369,7 @@ mod tester {
use indexmap::IndexMap;
use crate::{
IdGenerator,
ast::{
Definition, ModuleKind, Span, TraceLevel, Tracing, TypedModule, TypedPattern,
UntypedModule,
@ -1376,7 +1379,7 @@ mod tester {
gen_uplc::{decision_tree::TreeGen, interner::AirInterner},
parser,
tipo::error::{Error, Warning},
utils, IdGenerator,
utils,
};
fn parse(source_code: &str) -> UntypedModule {

View File

@ -1,6 +1,6 @@
use std::collections::HashMap;
use vec1::{vec1, Vec1};
use vec1::{Vec1, vec1};
#[derive(Clone)]
pub struct AirInterner {

View File

@ -6,7 +6,7 @@ use uplc::{builder::CONSTR_FIELDS_EXPOSER, builtins::DefaultFunction};
use crate::expr::Type;
use super::{
decision_tree::{get_tipo_by_path, CaseTest, Path},
decision_tree::{CaseTest, Path, get_tipo_by_path},
tree::AirTree,
};

View File

@ -1,6 +1,6 @@
use std::sync::{
atomic::{AtomicU64, Ordering},
Arc,
atomic::{AtomicU64, Ordering},
};
pub mod ast;

View File

@ -2,7 +2,7 @@ use super::Chain;
use crate::{
ast::CallArg,
expr::UntypedExpr,
parser::{token::Token, ParseError},
parser::{ParseError, token::Token},
};
use chumsky::prelude::*;

View File

@ -1,7 +1,7 @@
use super::Chain;
use crate::{
ast::well_known,
parser::{token::Token, ParseError},
parser::{ParseError, token::Token},
};
use chumsky::prelude::*;

View File

@ -1,7 +1,7 @@
use chumsky::prelude::*;
use super::Chain;
use crate::parser::{token::Token, ParseError};
use crate::parser::{ParseError, token::Token};
pub(crate) fn parser() -> impl Parser<Token, Chain, Error = ParseError> {
just(Token::Dot)

View File

@ -84,8 +84,8 @@ pub fn parser() -> impl Parser<Token, ast::UntypedDefinition, Error = ParseError
)
}
fn labeled_constructor_type_args(
) -> impl Parser<Token, Vec<ast::RecordConstructorArg<()>>, Error = ParseError> {
fn labeled_constructor_type_args()
-> impl Parser<Token, Vec<ast::RecordConstructorArg<()>>, Error = ParseError> {
select! {Token::Name {name} => name}
.then_ignore(just(Token::Colon))
.then(annotation())

View File

@ -4,7 +4,7 @@ use crate::{
expr::UntypedExpr,
parser::{
annotation,
chain::{call::parser as call, field_access, tuple_index::parser as tuple_index, Chain},
chain::{Chain, call::parser as call, field_access, tuple_index::parser as tuple_index},
error::ParseError,
expr::{self, bytearray, int as uint, list, string, tuple, var},
pattern,

View File

@ -9,7 +9,7 @@ use super::{
use crate::{
expr::UntypedExpr,
parser::{
chain::{call::parser as call, field_access, tuple_index::parser as tuple_index, Chain},
chain::{Chain, call::parser as call, field_access, tuple_index::parser as tuple_index},
error::ParseError,
token::Token,
},

View File

@ -1,5 +1,5 @@
use crate::{
ast::{well_known, TraceKind},
ast::{TraceKind, well_known},
expr::UntypedExpr,
parser::{
error::{ParseError, Pattern},

View File

@ -158,8 +158,8 @@ pub fn hex_string() -> impl Parser<
})
}
pub fn utf8_string(
) -> impl Parser<Token, (ast::ByteArrayFormatPreference, Vec<u8>), Error = ParseError> {
pub fn utf8_string()
-> impl Parser<Token, (ast::ByteArrayFormatPreference, Vec<u8>), Error = ParseError> {
select! {Token::ByteString {value} => value.into_bytes() }
.map(|token| (ast::ByteArrayFormatPreference::Utf8String, token))
}

View File

@ -1,5 +1,5 @@
use crate::{
ast::{well_known, UntypedPattern},
ast::{UntypedPattern, well_known},
parser::{error::ParseError, token::Token},
};
use chumsky::prelude::*;

View File

@ -4,7 +4,7 @@ use crate::{
format::Formatter,
gen_uplc::CodeGenerator,
plutus_version::PlutusVersion,
tipo::{convert_opaque_type, Type},
tipo::{Type, convert_opaque_type},
};
use cryptoxide::{blake2b::Blake2b, digest::Digest};
use indexmap::IndexMap;
@ -26,7 +26,7 @@ use uplc::{
ast::{Constant, Data, Name, NamedDeBruijn, Program, Term},
machine::{cost_model::ExBudget, eval_result::EvalResult},
};
use vec1::{vec1, Vec1};
use vec1::{Vec1, vec1};
#[derive(Debug, Clone, Copy)]
pub enum RunnableKind {
@ -531,7 +531,9 @@ impl Benchmark {
match prng.sample(&fuzzer) {
Ok(None) => {
panic!("A seeded PRNG returned 'None' which indicates a sampler is ill-formed and implemented wrongly; please contact library's authors.");
panic!(
"A seeded PRNG returned 'None' which indicates a sampler is ill-formed and implemented wrongly; please contact library's authors."
);
}
Ok(Some((new_prng, value))) => {
@ -689,8 +691,10 @@ impl Prng {
fn as_prng(cst: &PlutusData) -> Prng {
if let PlutusData::Constr(Constr { tag, fields, .. }) = cst {
if *tag == 121 + Prng::SEEDED {
if let [PlutusData::BoundedBytes(bytes), PlutusData::BoundedBytes(choices)] =
&fields[..]
if let [
PlutusData::BoundedBytes(bytes),
PlutusData::BoundedBytes(choices),
] = &fields[..]
{
return Prng::Seeded {
choices: choices.to_vec(),
@ -1124,21 +1128,17 @@ impl<U, T> TestResult<U, T> {
pub fn module(&self) -> &str {
match self {
TestResult::UnitTestResult(UnitTestResult { ref test, .. }) => test.module.as_str(),
TestResult::PropertyTestResult(PropertyTestResult { ref test, .. }) => {
test.module.as_str()
}
TestResult::BenchmarkResult(BenchmarkResult { ref bench, .. }) => bench.module.as_str(),
TestResult::UnitTestResult(UnitTestResult { test, .. }) => test.module.as_str(),
TestResult::PropertyTestResult(PropertyTestResult { test, .. }) => test.module.as_str(),
TestResult::BenchmarkResult(BenchmarkResult { bench, .. }) => bench.module.as_str(),
}
}
pub fn title(&self) -> &str {
match self {
TestResult::UnitTestResult(UnitTestResult { ref test, .. }) => test.name.as_str(),
TestResult::PropertyTestResult(PropertyTestResult { ref test, .. }) => {
test.name.as_str()
}
TestResult::BenchmarkResult(BenchmarkResult { ref bench, .. }) => bench.name.as_str(),
TestResult::UnitTestResult(UnitTestResult { test, .. }) => test.name.as_str(),
TestResult::PropertyTestResult(PropertyTestResult { test, .. }) => test.name.as_str(),
TestResult::BenchmarkResult(BenchmarkResult { bench, .. }) => bench.name.as_str(),
}
}
@ -1279,9 +1279,11 @@ impl TryFrom<TypedExpr> for Assertion<TypedExpr> {
final_else,
..
} => {
if let [IfBranch {
if let [
IfBranch {
condition, body, ..
}] = &branches[..]
},
] = &branches[..]
{
let then_is_true = match body {
TypedExpr::Var {

View File

@ -1,4 +1,5 @@
use crate::{
IdGenerator,
ast::{
Definition, ModuleKind, Pattern, TraceLevel, Tracing, TypedModule, UntypedModule,
UntypedPattern,
@ -7,7 +8,6 @@ use crate::{
expr::{CallArg, Span, TypedExpr},
parser,
tipo::error::{Error, UnifyErrorSituation, Warning},
IdGenerator,
};
use std::collections::HashMap;
@ -43,7 +43,9 @@ fn check_module(
let mut warnings = vec![];
if module.name == DEFAULT_MODULE_NAME {
panic!("passed extra modules with default name! Use 'parse_as' to define tests instead of 'parse'.");
panic!(
"passed extra modules with default name! Use 'parse_as' to define tests instead of 'parse'."
);
}
let typed_module = module
@ -2976,7 +2978,7 @@ fn correct_span_for_backpassing_args() {
let (warnings, _ast) = check(parse(source_code)).unwrap();
assert!(
matches!(&warnings[0], Warning::UnusedVariable { ref name, location } if name == "b" && location.start == 245 && location.end == 246)
matches!(&warnings[0], Warning::UnusedVariable { name, location } if name == "b" && location.start == 245 && location.end == 246)
);
}
@ -3407,7 +3409,7 @@ fn side_effects() {
assert!(warnings.is_empty(), "no warnings: {warnings:#?}");
if let Some(Definition::Fn(ref foo)) = ast.definitions().last() {
if let Some(Definition::Fn(foo)) = ast.definitions().last() {
if let TypedExpr::Sequence {
ref expressions, ..
} = foo.body

View File

@ -1,8 +1,8 @@
use self::{environment::Environment, pretty::Printer};
use crate::{
ast::{
well_known, Annotation, DataType, DataTypeKey, DefinitionLocation, ModuleKind, Span,
TypedDataType,
Annotation, DataType, DataTypeKey, DefinitionLocation, ModuleKind, Span, TypedDataType,
well_known,
},
tipo::fields::FieldMap,
};
@ -212,8 +212,8 @@ impl Type {
match self {
Type::App { module, name, .. } => Some((module.to_string(), name.to_string())),
Type::Fn { .. } => None,
Type::Var { ref tipo, .. } => match &*tipo.borrow() {
TypeVar::Link { ref tipo } => tipo.qualifier(),
Type::Var { tipo, .. } => match &*tipo.borrow() {
TypeVar::Link { tipo } => tipo.qualifier(),
_ => None,
},
Type::Tuple { .. } => Some((String::new(), "Tuple".to_string())),
@ -1109,11 +1109,13 @@ impl TypeVar {
Self::Link { tipo } => tipo.get_inner_types(),
Self::Unbound { .. } => vec![],
var => {
vec![Type::Var {
vec![
Type::Var {
tipo: RefCell::new(var.clone()).into(),
alias: None,
}
.into()]
.into(),
]
}
}
}

View File

@ -1,19 +1,19 @@
use super::{
error::{Error, Warning},
exhaustive::{simplify, Matrix, PatternStack},
hydrator::Hydrator,
AccessorsMap, RecordAccessor, Type, TypeConstructor, TypeInfo, TypeVar, ValueConstructor,
ValueConstructorVariant,
error::{Error, Warning},
exhaustive::{Matrix, PatternStack, simplify},
hydrator::Hydrator,
};
use crate::{
IdGenerator,
ast::{
self, Annotation, CallArg, DataType, Definition, Function, ModuleConstant, ModuleKind,
Namespace, RecordConstructor, RecordConstructorArg, Span, TypeAlias, TypedDefinition,
TypedFunction, TypedPattern, TypedValidator, UnqualifiedImport, UntypedArg,
UntypedDefinition, UntypedFunction, Use, Validator, PIPE_VARIABLE,
Namespace, PIPE_VARIABLE, RecordConstructor, RecordConstructorArg, Span, TypeAlias,
TypedDefinition, TypedFunction, TypedPattern, TypedValidator, UnqualifiedImport,
UntypedArg, UntypedDefinition, UntypedFunction, Use, Validator,
},
tipo::{fields::FieldMap, TypeAliasAnnotation},
IdGenerator,
tipo::{TypeAliasAnnotation, fields::FieldMap},
};
use std::{
collections::{HashMap, HashSet},
@ -1157,7 +1157,7 @@ impl<'a> Environment<'a> {
let first_error = unknowns.first().cloned();
unknowns.retain(|err| {
if let Error::UnknownType { ref name, .. } = err {
if let Error::UnknownType { name, .. } = err {
!type_definitions.contains(&Some(name))
} else {
false

View File

@ -1662,9 +1662,7 @@ pub enum Warning {
"I discovered an unused constructor: {}",
name.if_supports_color(Stderr, |s| s.default_color())
)]
#[diagnostic(help(
"No big deal, but you might want to remove it to get rid of that warning."
))]
#[diagnostic(help("No big deal, but you might want to remove it to get rid of that warning."))]
#[diagnostic(code("unused::constructor"))]
UnusedConstructor {
#[label("unused constructor")]
@ -1676,9 +1674,7 @@ pub enum Warning {
"I discovered an unused imported module: {}",
name.if_supports_color(Stderr, |s| s.default_color()),
)]
#[diagnostic(help(
"No big deal, but you might want to remove it to get rid of that warning."
))]
#[diagnostic(help("No big deal, but you might want to remove it to get rid of that warning."))]
#[diagnostic(code("unused::import::module"))]
UnusedImportedModule {
#[label("unused module")]
@ -1690,9 +1686,7 @@ pub enum Warning {
"I discovered an unused imported value: {}",
name.if_supports_color(Stderr, |s| s.default_color()),
)]
#[diagnostic(help(
"No big deal, but you might want to remove it to get rid of that warning."
))]
#[diagnostic(help("No big deal, but you might want to remove it to get rid of that warning."))]
#[diagnostic(code("unused:import::value"))]
UnusedImportedValueOrType {
#[label("unused import")]
@ -1867,7 +1861,9 @@ pub enum Warning {
},
#[error("I noticed a (compact) dynamic trace label which is not a string")]
#[diagnostic(help("Compiling with a compact trace-level, you are probably expecting compact traces although here, the entire label will need to be serialise *at runtime* which will add a significant overhead.\n\nAs a reminder, trace arguments are fully ignored in compact tracing. Hence, you probably want to put a cute little label here and move the current trace as argument!"))]
#[diagnostic(help(
"Compiling with a compact trace-level, you are probably expecting compact traces although here, the entire label will need to be serialise *at runtime* which will add a significant overhead.\n\nAs a reminder, trace arguments are fully ignored in compact tracing. Hence, you probably want to put a cute little label here and move the current trace as argument!"
))]
#[diagnostic(code("trace::label_is_not_string"))]
#[diagnostic(url("https://aiken-lang.org/language-tour/troubleshooting#traces"))]
CompactTraceLabelIsNotstring {

View File

@ -1,6 +1,6 @@
use crate::{
ast,
tipo::{self, environment::Environment, error::Error, Type},
tipo::{self, Type, environment::Environment, error::Error},
};
use itertools::Itertools;
use std::{collections::BTreeMap, iter, ops::Deref};
@ -407,11 +407,7 @@ impl Pattern {
.filter_map(|(index, p)| {
if index == 1 {
let tail = pretty_tail(p);
if tail == "[]" {
None
} else {
Some(tail)
}
if tail == "[]" { None } else { Some(tail) }
} else {
Some(p.pretty())
}

View File

@ -1,14 +1,15 @@
use super::{
RecordAccessor, Type, ValueConstructor, ValueConstructorVariant,
environment::{
assert_no_labeled_arguments, collapse_links, generalise, EntityKind, Environment,
EntityKind, Environment, assert_no_labeled_arguments, collapse_links, generalise,
},
error::{Error, Warning},
hydrator::Hydrator,
pattern::PatternTyper,
pipe::PipeTyper,
RecordAccessor, Type, ValueConstructor, ValueConstructorVariant,
};
use crate::{
IdGenerator,
ast::{
self, Annotation, ArgName, AssignmentKind, AssignmentPattern, BinOp, Bls12_381Point,
ByteArrayFormatPreference, CallArg, Curve, Function, IfBranch, LogicalOpChainKind,
@ -17,14 +18,13 @@ use crate::{
TypedValidator, UnOp, UntypedArg, UntypedAssignmentKind, UntypedClause, UntypedFunction,
UntypedIfBranch, UntypedPattern, UntypedRecordUpdateArg,
},
builtins::{from_default_function, BUILTIN},
builtins::{BUILTIN, from_default_function},
expr::{FnStyle, TypedExpr, UntypedExpr},
format,
parser::token::Base,
tipo::{
fields::FieldMap, DefaultFunction, ModuleKind, PatternConstructor, TypeConstructor, TypeVar,
DefaultFunction, ModuleKind, PatternConstructor, TypeConstructor, TypeVar, fields::FieldMap,
},
IdGenerator,
};
use std::{
cmp::Ordering,
@ -970,7 +970,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
location,
} => {
if let UntypedExpr::Var {
name: ref module,
name: module,
location: module_location,
} = container.as_ref()
{
@ -1091,7 +1091,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
container: ref type_container,
} if TypeConstructor::might_be(type_name) => {
if let UntypedExpr::Var {
name: ref module_name,
name: module_name,
location: module_location,
} = type_container.as_ref()
{

View File

@ -1,7 +1,7 @@
use super::{
Type, TypeConstructor,
environment::Environment,
error::{Error, Warning},
Type, TypeConstructor,
};
use crate::{ast::Annotation, tipo::Span};
use std::{collections::HashMap, rc::Rc};

View File

@ -1,11 +1,12 @@
use super::{
TypeInfo, ValueConstructor, ValueConstructorVariant,
environment::{EntityKind, Environment},
error::{Error, UnifyErrorSituation, Warning},
expr::ExprTyper,
hydrator::Hydrator,
TypeInfo, ValueConstructor, ValueConstructorVariant,
};
use crate::{
IdGenerator,
ast::{
Annotation, ArgBy, ArgName, ArgVia, DataType, Definition, Function, ModuleConstant,
ModuleKind, RecordConstructor, RecordConstructorArg, Tracing, TypeAlias, TypedArg,
@ -14,8 +15,7 @@ use crate::{
},
expr::{TypedExpr, UntypedAssignmentKind, UntypedExpr},
parser::token::Token,
tipo::{expr::infer_function, Span, Type, TypeVar},
IdGenerator,
tipo::{Span, Type, TypeVar, expr::infer_function},
};
use std::{
borrow::Borrow,
@ -758,8 +758,8 @@ where
.get_mut(&f.name)
.expect("Could not find preregistered type for test");
if let Type::Fn {
ref ret,
ref alias,
ret,
alias,
args: _,
} = scope.tipo.as_ref()
{

View File

@ -1,10 +1,10 @@
//! Type inference and checking of patterns used in case expressions
//! and variables bindings.
use super::{
environment::{assert_no_labeled_arguments, collapse_links, EntityKind, Environment},
PatternConstructor, Type, ValueConstructorVariant,
environment::{EntityKind, Environment, assert_no_labeled_arguments, collapse_links},
error::{Error, Warning},
hydrator::Hydrator,
PatternConstructor, Type, ValueConstructorVariant,
};
use crate::ast::{CallArg, Namespace, Pattern, Span, TypedPattern, UntypedPattern};
use itertools::Itertools;

View File

@ -1,10 +1,10 @@
use super::{
Type, ValueConstructor, ValueConstructorVariant,
error::{Error, UnifyErrorSituation},
expr::ExprTyper,
Type, ValueConstructor, ValueConstructorVariant,
};
use crate::{
ast::{AssignmentKind, CallArg, Pattern, Span, PIPE_VARIABLE},
ast::{AssignmentKind, CallArg, PIPE_VARIABLE, Pattern, Span},
expr::{TypedExpr, UntypedExpr},
};
use std::{ops::Deref, rc::Rc};

View File

@ -136,7 +136,7 @@ impl Printer {
fn type_var_doc<'a>(&mut self, typ: &TypeVar) -> Document<'a> {
match typ {
TypeVar::Link { tipo: ref typ, .. } => self.print(typ),
TypeVar::Link { tipo: typ, .. } => self.print(typ),
TypeVar::Generic { id, .. } => self.generic_type_var(*id),
TypeVar::Unbound { .. } => "?".to_doc(),
}

View File

@ -1,13 +1,14 @@
[package]
name = "aiken-lsp"
version = "1.1.15"
edition = "2021"
description = "Cardano smart contract language and toolchain"
repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
authors = ["Lucas Rosa <x@rvcas.dev>"]
rust-version = "1.70.0"
version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
rust-version.workspace = true
[dependencies]
crossbeam-channel = "0.5.7"

View File

@ -238,7 +238,7 @@ fn unknown_identifier(
) -> Vec<AnnotatedEdit> {
let mut edits = Vec::new();
if let Some(serde_json::Value::String(ref var_name)) = data {
if let Some(serde_json::Value::String(var_name)) = data {
for module in compiler.project.modules() {
if module.ast.has_definition(var_name) {
if let Some(edit) = parsed_document.import(&module, Some(var_name)) {
@ -263,7 +263,7 @@ fn unknown_constructor(
) -> Vec<AnnotatedEdit> {
let mut edits = Vec::new();
if let Some(serde_json::Value::String(ref constructor_name)) = data {
if let Some(serde_json::Value::String(constructor_name)) = data {
for module in compiler.project.modules() {
if module.ast.has_constructor(constructor_name) {
if let Some(edit) = parsed_document.import(&module, Some(constructor_name)) {
@ -316,7 +316,7 @@ fn unknown_module(
) -> Vec<AnnotatedEdit> {
let mut edits = Vec::new();
if let Some(serde_json::Value::String(ref module_name)) = data {
if let Some(serde_json::Value::String(module_name)) = data {
for module in compiler.project.modules() {
if module.name.ends_with(module_name) {
if let Some(edit) = parsed_document.import(&module, None) {
@ -336,7 +336,7 @@ fn unused_imports(
let mut edits = Vec::new();
for data in datas.iter().rev().flatten() {
if let serde_json::Value::String(ref args) = data {
if let serde_json::Value::String(args) = data {
let args = args.split(',').collect::<Vec<&str>>();
match args.as_slice() {
&[is_qualified, start] => {
@ -362,7 +362,7 @@ fn unused_imports(
fn utf8_byte_array_is_hex_string(diagnostic: &lsp_types::Diagnostic) -> Vec<AnnotatedEdit> {
let mut edits = Vec::new();
if let Some(serde_json::Value::String(ref value)) = diagnostic.data.as_ref() {
if let Some(serde_json::Value::String(value)) = diagnostic.data.as_ref() {
edits.push(AnnotatedEdit::SimpleEdit(
"Prefix with #".to_string(),
lsp_types::TextEdit {

View File

@ -5,8 +5,8 @@ use crate::{
quickfix,
quickfix::Quickfix,
utils::{
path_to_uri, span_to_lsp_range, text_edit_replace, uri_to_module_name,
COMPILING_PROGRESS_TOKEN, CREATE_COMPILING_PROGRESS_TOKEN,
COMPILING_PROGRESS_TOKEN, CREATE_COMPILING_PROGRESS_TOKEN, path_to_uri, span_to_lsp_range,
text_edit_replace, uri_to_module_name,
},
};
use aiken_lang::{
@ -25,6 +25,7 @@ use indoc::formatdoc;
use itertools::Itertools;
use lsp_server::{Connection, Message};
use lsp_types::{
DocumentFormattingParams, InitializeParams, TextEdit,
notification::{
DidChangeTextDocument, DidChangeWatchedFiles, DidCloseTextDocument, DidSaveTextDocument,
Notification, Progress, PublishDiagnostics, ShowMessage,
@ -33,7 +34,6 @@ use lsp_types::{
CodeActionRequest, Completion, Formatting, GotoDefinition, HoverRequest, Request,
WorkDoneProgressCreate,
},
DocumentFormattingParams, InitializeParams, TextEdit,
};
use miette::Diagnostic;
use std::{

View File

@ -1,5 +1,7 @@
use aiken_lang::{ast::Tracing, line_numbers::LineNumbers, test_framework::PropertyTest};
use aiken_project::{config::ProjectConfig, error::Error as ProjectError, module::CheckedModule, Project};
use aiken_project::{
Project, config::ProjectConfig, error::Error as ProjectError, module::CheckedModule,
};
use std::{collections::HashMap, path::PathBuf};
#[derive(Debug)]

View File

@ -1,7 +1,7 @@
use crate::error::Error;
use aiken_lang::{ast::Span, line_numbers::LineNumbers};
use itertools::Itertools;
use lsp_types::{notification::Notification, TextEdit};
use lsp_types::{TextEdit, notification::Notification};
use std::path::{Path, PathBuf};
use urlencoding::decode;

View File

@ -1,17 +1,15 @@
[package]
name = "aiken-project"
description = "Aiken project utilities"
version = "1.1.15"
edition = "2021"
repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
authors = [
"Lucas Rosa <x@rvcas.dev>",
"Kasey White <kwhitemsg@gmail.com>",
"KtorZ <matthias.benkort@gmail.com>",
]
rust-version = "1.80.0"
version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
rust-version.workspace = true
build = "build.rs"
[dependencies]

View File

@ -1,11 +1,11 @@
use crate::{
Annotated, Schema,
blueprint::{
parameter::Parameter,
schema::{Data, Declaration, Items},
},
Annotated, Schema,
};
use aiken_lang::tipo::{pretty::resolve_alias, Type, TypeAliasAnnotation, TypeVar};
use aiken_lang::tipo::{Type, TypeAliasAnnotation, TypeVar, pretty::resolve_alias};
use itertools::Itertools;
use serde::{
self,
@ -176,7 +176,7 @@ impl Definitions<Annotated<Schema>> {
dependencies.insert(src);
}
}
Declaration::Inline(ref schema) => traverse(src, schema, usage),
Declaration::Inline(schema) => traverse(src, schema, usage),
}
}
@ -260,16 +260,16 @@ impl Definitions<Annotated<Schema>> {
fn schema_to_data(schema: &mut Schema) {
let items = match schema {
Schema::Data(_) => None,
Schema::Pair(ref mut left, ref mut right) => {
Schema::Pair(left, right) => {
let left = swap_declaration(left);
let right = swap_declaration(right);
Some(Items::Many(vec![left, right]))
}
Schema::List(Items::One(ref mut item)) => {
Schema::List(Items::One(item)) => {
let item = swap_declaration(item);
Some(Items::One(item))
}
Schema::List(Items::Many(ref mut items)) => Some(Items::Many(
Schema::List(Items::Many(items)) => Some(Items::Many(
items.iter_mut().map(swap_declaration).collect(),
)),
Schema::Integer => {
@ -300,7 +300,7 @@ impl Definitions<Annotated<Schema>> {
}
for (_, entry) in self.inner.iter_mut() {
if let Some(ref mut annotated) = entry {
if let Some(annotated) = entry {
schema_to_data(&mut annotated.annotated);
}
}

View File

@ -6,7 +6,7 @@ pub mod schema;
pub mod validator;
use crate::{
config::{self, ProjectConfig, PlutusVersion},
config::{self, PlutusVersion, ProjectConfig},
module::CheckedModules,
};
use aiken_lang::gen_uplc::CodeGenerator;

View File

@ -5,8 +5,8 @@ use super::{
};
use std::{iter, ops::Deref};
use uplc::{
ast::{Constant, Data as UplcData},
PlutusData,
ast::{Constant, Data as UplcData},
};
#[derive(Debug, PartialEq, Eq, Clone, serde::Serialize, serde::Deserialize)]
@ -34,7 +34,7 @@ impl Parameter {
) -> Result<(), Error> {
let schema = match &self.schema {
Declaration::Inline(schema) => schema,
Declaration::Referenced(ref link) => {
Declaration::Referenced(link) => {
&definitions
.lookup(link)
.map(Ok)
@ -353,11 +353,13 @@ fn expect_data_constr(term: &Constant, index: usize) -> Result<Vec<Constant>, Er
Err(mismatch(
term,
Schema::Data(Data::AnyOf(vec![Constructor {
Schema::Data(Data::AnyOf(vec![
Constructor {
index,
fields: vec![],
}
.into()])),
.into(),
])),
))
}

View File

@ -1,10 +1,10 @@
use crate::{
blueprint::definitions::{Definitions, Reference},
CheckedModule,
blueprint::definitions::{Definitions, Reference},
};
use aiken_lang::{
ast::{Definition, TypedDataType, TypedDefinition},
tipo::{pretty, Type, TypeVar},
tipo::{Type, TypeVar, pretty},
};
use owo_colors::{OwoColorize, Stream::Stdout};
use serde::{
@ -1117,7 +1117,7 @@ Here's the types I followed and that led me to this problem:
pub mod tests {
use super::*;
use proptest::prelude::*;
use serde_json::{self, json, Value};
use serde_json::{self, Value, json};
pub fn assert_json(schema: &impl Serialize, expected: Value) {
assert_eq!(serde_json::to_value(schema).unwrap(), expected);
@ -1198,11 +1198,13 @@ pub mod tests {
#[test]
fn serialize_data_constr_1() {
let schema = Schema::Data(Data::AnyOf(vec![Constructor {
let schema = Schema::Data(Data::AnyOf(vec![
Constructor {
index: 0,
fields: vec![],
}
.into()]));
.into(),
]));
assert_json(
&schema,
json!({
@ -1363,14 +1365,16 @@ pub mod tests {
#[test]
fn deserialize_any_of() {
assert_eq!(
Data::AnyOf(vec![Constructor {
Data::AnyOf(vec![
Constructor {
index: 0,
fields: vec![
Declaration::Referenced(Reference::new("foo")).into(),
Declaration::Referenced(Reference::new("bar")).into()
],
}
.into()]),
.into()
]),
serde_json::from_value(json!({
"anyOf": [{
"index": 0,
@ -1391,14 +1395,16 @@ pub mod tests {
#[test]
fn deserialize_one_of() {
assert_eq!(
Data::AnyOf(vec![Constructor {
Data::AnyOf(vec![
Constructor {
index: 0,
fields: vec![
Declaration::Referenced(Reference::new("foo")).into(),
Declaration::Referenced(Reference::new("bar")).into()
],
}
.into()]),
.into()
]),
serde_json::from_value(json!({
"oneOf": [{
"index": 0,

View File

@ -7,17 +7,17 @@ use super::{
};
use crate::module::{CheckedModule, CheckedModules};
use aiken_lang::{
ast::{well_known, Annotation, TypedArg, TypedFunction, TypedValidator},
ast::{Annotation, TypedArg, TypedFunction, TypedValidator, well_known},
gen_uplc::CodeGenerator,
plutus_version::PlutusVersion,
tipo::{collapse_links, Type},
tipo::{Type, collapse_links},
};
use miette::NamedSource;
use serde;
use std::borrow::Borrow;
use uplc::{
ast::{Constant, SerializableProgram},
PlutusData,
ast::{Constant, SerializableProgram},
};
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
@ -245,8 +245,8 @@ impl Validator {
pub fn tipo_or_annotation<'a>(module: &'a CheckedModule, arg: &'a TypedArg) -> &'a Type {
match collapse_links(arg.tipo.clone()).borrow() {
Type::App {
module: ref module_name,
name: ref type_name,
module: module_name,
name: type_name,
..
} if module_name.is_empty() && &type_name[..] == "Data" => match arg.annotation {
Some(Annotation::Constructor { ref arguments, .. }) if !arguments.is_empty() => module
@ -301,7 +301,7 @@ impl Validator {
description: None,
annotated: schema.as_ref().clone(),
},
Declaration::Referenced(ref link) => definitions
Declaration::Referenced(link) => definitions
.lookup(link)
.map(|s| {
Ok(Annotated {
@ -1032,11 +1032,13 @@ mod tests {
let mut definitions = fixture_definitions();
definitions.insert(
&schema,
Schema::Data(Data::AnyOf(vec![Constructor {
Schema::Data(Data::AnyOf(vec![
Constructor {
index: 0,
fields: vec![Declaration::Referenced(Reference::new("Bool")).into()],
}
.into()]))
.into(),
]))
.into(),
);

View File

@ -1,5 +1,5 @@
use crate::{
error::TomlLoadingContext, github::repo::LatestRelease, package_name::PackageName, paths, Error,
Error, error::TomlLoadingContext, github::repo::LatestRelease, package_name::PackageName, paths,
};
use aiken_lang::{
ast::{Annotation, ByteArrayFormatPreference, ModuleConstant, Span, UntypedDefinition},
@ -11,9 +11,8 @@ use glob::glob;
use miette::NamedSource;
use semver::Version;
use serde::{
de,
Deserialize, Serialize, de,
ser::{self, SerializeSeq, SerializeStruct},
Deserialize, Serialize,
};
use std::{
collections::BTreeMap,

View File

@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
use tokio::time::Instant;
use crate::{
config::{ProjectConfig, Dependency},
config::{Dependency, ProjectConfig},
error::{Error, TomlLoadingContext},
package_name::PackageName,
paths,
@ -133,7 +133,11 @@ impl From<&Manifest> for LocalPackages {
}
}
pub fn download<T>(event_listener: &T, root_path: &Path, config: &ProjectConfig) -> Result<Manifest, Error>
pub fn download<T>(
event_listener: &T,
root_path: &Path,
config: &ProjectConfig,
) -> Result<Manifest, Error>
where
T: EventListener,
{

View File

@ -9,7 +9,7 @@ use std::{
};
use crate::{
config::{ProjectConfig, Dependency, Platform},
config::{Dependency, Platform, ProjectConfig},
error::{Error, TomlLoadingContext},
package_name::PackageName,
paths,

View File

@ -104,7 +104,11 @@ impl DocLink {
/// The documentation is built using template files located at the root of this crate.
/// With the documentation, we also build a client-side search index to ease navigation
/// across multiple modules.
pub fn generate_all(root: &Path, config: &ProjectConfig, modules: Vec<&CheckedModule>) -> Vec<DocFile> {
pub fn generate_all(
root: &Path,
config: &ProjectConfig,
modules: Vec<&CheckedModule>,
) -> Vec<DocFile> {
let timestamp = new_timestamp();
let modules_links = generate_modules_links(&modules);

View File

@ -78,10 +78,7 @@ impl LinkTree {
}
}
LinkTree::Leaf {
value: ref mut leaf,
..
} => {
LinkTree::Leaf { value: leaf, .. } => {
// In case we try to insert a module that already exists, there's nothing to do.
if module == leaf {
return;
@ -138,9 +135,7 @@ impl LinkTree {
}
LinkTree::Node {
ref mut prefix,
ref mut children,
..
prefix, children, ..
} => {
// When `module.starts_with(prefix)` is true, it means that the module being
// inserted belong to our sub-tree. We do not know *where* exactly though, so we
@ -274,8 +269,8 @@ impl LinkTree {
fn path(&self) -> &str {
match self {
LinkTree::Empty => "",
LinkTree::Leaf { ref value, .. } => value.as_str(),
LinkTree::Node { ref prefix, .. } => prefix.as_str(),
LinkTree::Leaf { value, .. } => value.as_str(),
LinkTree::Node { prefix, .. } => prefix.as_str(),
}
}
}

View File

@ -1,6 +1,6 @@
use crate::{
config::{ProjectConfig, Platform},
CheckedModule,
config::{Platform, ProjectConfig},
};
use aiken_lang::{ast::Span, line_numbers::LineNumbers};
use camino::{Utf8Component, Utf8Path};

View File

@ -432,12 +432,14 @@ impl Diagnostic for Error {
))),
Error::NoValidatorNotFound { known_validators } => Some(Box::new(hint_validators(
known_validators,
"Here's a list of all validators I've found in your project.\nPlease double-check this list against the options that you've provided."
"Here's a list of all validators I've found in your project.\nPlease double-check this list against the options that you've provided.",
))),
Error::MoreThanOneValidatorFound { known_validators } => Some(Box::new(hint_validators(
Error::MoreThanOneValidatorFound { known_validators } => {
Some(Box::new(hint_validators(
known_validators,
"Here's a list of matching validators I've found in your project.\nPlease narrow the selection using additional options.",
))),
)))
}
Error::Module(e) => e.help(),
}
}
@ -697,12 +699,10 @@ impl Diagnostic for Warning {
Warning::NoConfigurationForEnv { .. } => Some(Box::new(
"When configuration keys are missing for a target environment, no 'config' module will be created. This may lead to issues down the line.",
)),
Warning::SuspiciousTestMatch { test } => Some(Box::new(
format!(
Warning::SuspiciousTestMatch { test } => Some(Box::new(format!(
"Did you mean to match all tests within a specific module? Like so:\n\n╰─▶ {}",
format!("-m \"{test}.{{..}}\"").if_supports_color(Stderr, |s| s.bold()),
)
)),
))),
}
}
}
@ -827,11 +827,7 @@ fn hint_validators(known_validators: &BTreeSet<(String, String, bool)>, hint: &s
known_validators
.iter()
.map(|(module, validator, has_params)| {
let title = format!(
"{:>pad_module$} . {:<pad_validator$}",
module,
validator,
);
let title = format!("{:>pad_module$} . {:<pad_validator$}", module, validator,);
if *has_params {
title
.if_supports_color(Stderr, |s| s.bold())

View File

@ -1,4 +1,4 @@
use reqwest::{blocking::Client, header::USER_AGENT, Error};
use reqwest::{Error, blocking::Client, header::USER_AGENT};
use serde::Deserialize;
#[derive(Deserialize)]

View File

@ -21,9 +21,9 @@ mod tests;
use crate::{
blueprint::{
Blueprint,
definitions::Definitions,
schema::{Annotated, Schema},
Blueprint,
},
config::ProjectConfig,
error::{Error, Warning},
@ -31,6 +31,7 @@ use crate::{
telemetry::Event,
};
use aiken_lang::{
IdGenerator,
ast::{
self, DataTypeKey, Definition, FunctionAccessKey, ModuleKind, Tracing, TypedDataType,
TypedFunction, UntypedDefinition,
@ -42,7 +43,7 @@ use aiken_lang::{
line_numbers::LineNumbers,
test_framework::{RunnableKind, Test, TestResult},
tipo::{Type, TypeInfo},
utils, IdGenerator,
utils,
};
use export::Export;
use indexmap::IndexMap;
@ -60,8 +61,8 @@ use std::{
};
use telemetry::EventListener;
use uplc::{
ast::{Constant, Name, Program},
PlutusData,
ast::{Constant, Name, Program},
};
#[derive(Debug)]

View File

@ -1,5 +1,6 @@
use crate::{Error, Warning};
use aiken_lang::{
IdGenerator,
ast::{
DataType, DataTypeKey, Definition, Function, FunctionAccessKey, Located, ModuleKind,
Tracing, TypedDataType, TypedFunction, TypedModule, TypedValidator, UntypedModule,
@ -7,13 +8,12 @@ use aiken_lang::{
},
expr::TypedExpr,
line_numbers::LineNumbers,
parser::extra::{comments_before, Comment, ModuleExtra},
parser::extra::{Comment, ModuleExtra, comments_before},
tipo::TypeInfo,
IdGenerator,
};
use indexmap::IndexMap;
use miette::NamedSource;
use petgraph::{algo, graph::NodeIndex, Direction, Graph};
use petgraph::{Direction, Graph, algo, graph::NodeIndex};
use std::{
collections::{BTreeSet, HashMap},
io,

View File

@ -1,5 +1,5 @@
use owo_colors::{OwoColorize, Stream::Stdout};
use serde::{de::Visitor, Deserialize, Serialize};
use serde::{Deserialize, Serialize, de::Visitor};
use std::{
fmt::{self, Display},
str::FromStr,

View File

@ -36,11 +36,7 @@ pub fn ansi_len(s: &str) -> usize {
pub fn len_longest_line(zero: usize, s: &str) -> usize {
s.lines().fold(zero, |max, l| {
let n = ansi_len(l);
if n > max {
n
} else {
max
}
if n > max { n } else { max }
})
}
@ -154,11 +150,7 @@ pub fn pad_right(mut text: String, n: usize, delimiter: &str) -> String {
}
pub fn style_if(styled: bool, s: String, apply_style: fn(String) -> String) -> String {
if styled {
apply_style(s)
} else {
s
}
if styled { apply_style(s) } else { s }
}
pub fn multiline(max_len: usize, s: String) -> Vec<String> {

View File

@ -2,7 +2,7 @@ use aiken_lang::{
expr::UntypedExpr,
test_framework::{BenchmarkResult, PropertyTestResult, TestResult, UnitTestResult},
};
pub use json::{json_schema, Json};
pub use json::{Json, json_schema};
use std::{
collections::BTreeMap,
fmt::Display,

View File

@ -1,4 +1,4 @@
use super::{group_by_module, Event, EventListener};
use super::{Event, EventListener, group_by_module};
use aiken_lang::{
ast::OnTestFailure,
expr::UntypedExpr,
@ -76,10 +76,8 @@ impl EventListener for Json {
fn fmt_test_json(result: &TestResult<UntypedExpr, UntypedExpr>) -> serde_json::Value {
let on_test_failure = match result {
TestResult::UnitTestResult(UnitTestResult { ref test, .. }) => &test.on_test_failure,
TestResult::PropertyTestResult(PropertyTestResult { ref test, .. }) => {
&test.on_test_failure
}
TestResult::UnitTestResult(UnitTestResult { test, .. }) => &test.on_test_failure,
TestResult::PropertyTestResult(PropertyTestResult { test, .. }) => &test.on_test_failure,
TestResult::BenchmarkResult(_) => unreachable!("benchmark returned in JSON output"),
};

View File

@ -1,4 +1,4 @@
use super::{find_max_execution_units, group_by_module, DownloadSource, Event, EventListener};
use super::{DownloadSource, Event, EventListener, find_max_execution_units, group_by_module};
use crate::pretty;
use aiken_lang::{
ast::OnTestFailure,

View File

@ -5,6 +5,7 @@ mod test {
utils,
};
use aiken_lang::{
IdGenerator,
ast::{DataTypeKey, Definition, ModuleKind, TraceLevel, Tracing, TypedDataType},
builtins,
expr::UntypedExpr,
@ -14,7 +15,6 @@ mod test {
parser::{self, extra::ModuleExtra},
plutus_version::PlutusVersion,
test_framework::*,
IdGenerator,
};
use indexmap::IndexMap;
use indoc::indoc;
@ -246,12 +246,14 @@ mod test {
}
"#});
assert!(TestResult::PropertyTestResult::<(), _>(prop.run(
assert!(
TestResult::PropertyTestResult::<(), _>(prop.run(
42,
PropertyTest::DEFAULT_MAX_SUCCESS,
&PlutusVersion::default()
))
.is_success());
.is_success()
);
}
#[test]

View File

@ -5,6 +5,7 @@ use crate::{
utils,
};
use aiken_lang::{
IdGenerator,
ast::{
DataTypeKey, FunctionAccessKey, ModuleKind, TraceLevel, Tracing, TypedDataType,
TypedFunction,
@ -15,7 +16,6 @@ use aiken_lang::{
parser,
plutus_version::PlutusVersion,
tipo::TypeInfo,
IdGenerator,
};
use indexmap::IndexMap;
use std::{collections::HashMap, path::PathBuf};

View File

@ -1,4 +1,4 @@
use crate::{config::WorkspaceConfig, telemetry::EventTarget, Project};
use crate::{Project, config::WorkspaceConfig, telemetry::EventTarget};
use miette::{Diagnostic, IntoDiagnostic};
use notify::{Event, RecursiveMode, Watcher};
use owo_colors::{OwoColorize, Stream::Stderr};

View File

@ -1,17 +1,14 @@
[package]
name = "aiken"
description = "Cardano smart contract language and toolchain"
version = "1.1.15"
edition = "2021"
repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
authors = [
"Lucas Rosa <x@rvcas.dev>",
"Kasey White <kwhitemsg@gmail.com>",
"KtorZ <matthias.benkort@gmail.com>",
]
rust-version = "1.70.0"
version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
rust-version.workspace = true
[package.metadata.wix]
upgrade-guid = "288B160D-418A-4558-91B9-7C38CFD789C7"

View File

@ -84,7 +84,7 @@ pub fn exec(
) -> miette::Result<()> {
let mut rng = rand::thread_rng();
let seed = seed.unwrap_or_else(|| rng.gen());
let seed = seed.unwrap_or_else(|| rng.r#gen());
let result = with_project(
directory.as_deref(),

View File

@ -1,5 +1,5 @@
use aiken_project::{
blueprint::{error::Error as BlueprintError, Blueprint},
blueprint::{Blueprint, error::Error as BlueprintError},
error::Error as ProjectError,
};
use clap::ValueEnum;

View File

@ -118,8 +118,8 @@ pub fn exec(
}
#[allow(clippy::type_complexity)]
pub fn trace_filter_parser(
) -> MapValueParser<PossibleValuesParser, fn(String) -> fn(TraceLevel) -> Tracing> {
pub fn trace_filter_parser()
-> MapValueParser<PossibleValuesParser, fn(String) -> fn(TraceLevel) -> Tracing> {
PossibleValuesParser::new(["user-defined", "compiler-generated", "all"]).map(
|s: String| match s.as_str() {
"user-defined" => Tracing::UserDefined,

View File

@ -133,7 +133,7 @@ pub fn exec(
let mut rng = rand::thread_rng();
let seed = seed.unwrap_or_else(|| rng.gen());
let seed = seed.unwrap_or_else(|| rng.r#gen());
let result = if watch {
watch_project(directory.as_deref(), watch::default_filter, 500, |p| {

View File

@ -1,6 +1,6 @@
use crate::{cmd::Cmd as MainCmd, pretty};
use clap::{Command, Subcommand};
use clap_complete::{generate, Shell};
use clap_complete::{Shell, generate};
use std::{
fmt::{self, Display},
fs::{File, OpenOptions},

View File

@ -1,5 +1,5 @@
use aiken_project::{
config::{ProjectConfig, Dependency, Platform},
config::{Dependency, Platform, ProjectConfig},
error::Warning,
package_name::PackageName,
pretty,

View File

@ -1,8 +1,8 @@
use miette::IntoDiagnostic;
use owo_colors::{OwoColorize, Stream::Stderr};
use pallas_primitives::{
conway::{Redeemer, TransactionInput, TransactionOutput},
Fragment,
conway::{Redeemer, TransactionInput, TransactionOutput},
};
use pallas_traverse::{Era, MultiEraTx};
use std::{fmt, fs, path::PathBuf, process};

View File

@ -9,8 +9,8 @@ use uplc::{
ast::{FakeNamedDeBruijn, Name, NamedDeBruijn, Program, Term},
builtins::DefaultFunction,
machine::{
cost_model::{ExBudget, StepKind},
TERM_COUNT,
cost_model::{ExBudget, StepKind},
},
parser,
};

View File

@ -3,7 +3,7 @@ use std::path::PathBuf;
use uplc::ast::{DeBruijn, Name, NamedDeBruijn, Program};
use uplc::optimize::aiken_optimize_and_intern;
use super::{encode, Format};
use super::{Format, encode};
#[derive(clap::Args)]
/// Shrink / Optimize UPLC code using a variety of optimization steps

View File

@ -2,11 +2,11 @@ use aiken_project::{config, pretty};
#[cfg(not(target_os = "windows"))]
use cmd::completion;
use cmd::{
benchmark,
Cmd, benchmark,
blueprint::{self, address},
build, check, docs, export, fmt, lsp, new,
packages::{self, add},
tx, uplc, Cmd,
tx, uplc,
};
use owo_colors::OwoColorize;

View File

@ -1,13 +1,15 @@
[package]
name = "uplc"
version.workspace = true
edition.workspace = true
description = "Utilities for working with Untyped Plutus Core"
version = "1.1.15"
edition = "2021"
repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
license.workspace = true
authors = ["Lucas Rosa <x@rvcas.dev>", "Kasey White <kwhitemsg@gmail.com>"]
rust-version = "1.70.0"
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
rust-version.workspace = true
exclude = ["test_data/*"]
[dependencies]

View File

@ -3,9 +3,9 @@ use crate::{
debruijn::{self, Converter},
flat::Binder,
machine::{
cost_model::{initialize_cost_model, CostModel, ExBudget},
eval_result::EvalResult,
Machine,
cost_model::{CostModel, ExBudget, initialize_cost_model},
eval_result::EvalResult,
},
optimize::interner::CodeGenInterner,
};

View File

@ -799,7 +799,7 @@ mod tests {
use crate::{
ast::{Data, Name, NamedDeBruijn, Program, Term},
builder::Constant,
machine::{cost_model::ExBudget, Error},
machine::{Error, cost_model::ExBudget},
optimize::interner::CodeGenInterner,
};

View File

@ -7,11 +7,11 @@ use crate::{
};
use num_bigint::BigInt;
use pallas_codec::flat::{
Flat,
de::{self, Decode, Decoder},
en::{self, Encode, Encoder},
Flat,
};
use pallas_primitives::{conway::PlutusData, Fragment};
use pallas_primitives::{Fragment, conway::PlutusData};
use std::{collections::VecDeque, fmt::Debug, rc::Rc};
const BUILTIN_TAG_WIDTH: u32 = 7;

View File

@ -12,9 +12,9 @@ pub mod tx;
pub use pallas_codec::utils::KeyValuePairs;
pub use pallas_crypto::hash::Hash;
pub use pallas_primitives::{
Error, Fragment,
alonzo::{BigInt, Constr, PlutusData},
babbage::{PostAlonzoTransactionOutput, TransactionInput, TransactionOutput, Value},
Error, Fragment,
};
pub use tx::redeemer_tag_to_string;

View File

@ -1,4 +1,4 @@
use super::{cost_model::ExBudget, Error, Trace};
use super::{Error, Trace, cost_model::ExBudget};
use crate::ast::{Constant, NamedDeBruijn, Term};
#[derive(Debug)]

View File

@ -1,7 +1,7 @@
use super::{
Error, Trace, Value,
cost_model::{BuiltinCosts, ExBudget},
value::{from_pallas_bigint, to_pallas_bigint},
Error, Trace, Value,
};
use crate::{
ast::{Constant, Data, Type},
@ -1882,7 +1882,7 @@ pub static ANY_TAG: u64 = 102;
#[cfg(not(target_family = "wasm"))]
fn verify_ecdsa(public_key: &[u8], message: &[u8], signature: &[u8]) -> Result<Value, Error> {
use secp256k1::{ecdsa::Signature, Message, PublicKey, Secp256k1};
use secp256k1::{Message, PublicKey, Secp256k1, ecdsa::Signature};
let secp = Secp256k1::verification_only();
@ -1901,7 +1901,7 @@ fn verify_ecdsa(public_key: &[u8], message: &[u8], signature: &[u8]) -> Result<V
/// The message needs to be 32 bytes (ideally prehashed, but not a requirement).
#[cfg(not(target_family = "wasm"))]
fn verify_schnorr(public_key: &[u8], message: &[u8], signature: &[u8]) -> Result<Value, Error> {
use secp256k1::{schnorr::Signature, Message, Secp256k1, XOnlyPublicKey};
use secp256k1::{Message, Secp256k1, XOnlyPublicKey, schnorr::Signature};
let secp = Secp256k1::verification_only();

View File

@ -1,6 +1,6 @@
use super::{
runtime::{self, BuiltinRuntime},
Error,
runtime::{self, BuiltinRuntime},
};
use crate::{
ast::{Constant, NamedDeBruijn, Term, Type},
@ -480,7 +480,7 @@ pub fn to_pallas_bigint(n: &BigInt) -> conway::BigInt {
mod tests {
use crate::{
ast::Constant,
machine::value::{integer_log2, Value},
machine::value::{Value, integer_log2},
};
use num_bigint::BigInt;

View File

@ -2,7 +2,7 @@ use crate::{
ast::{Constant, Program, Term, Type},
flat::Binder,
machine::{
runtime::{convert_tag_to_constr, Compressable},
runtime::{Compressable, convert_tag_to_constr},
value::from_pallas_bigint,
},
};

View File

@ -1,15 +1,15 @@
use crate::{
PlutusData,
ast::{DeBruijn, Program},
machine::{cost_model::ExBudget, eval_result::EvalResult},
PlutusData,
};
use error::Error;
use pallas_primitives::{
Fragment,
conway::{
CostModels, ExUnits, MintedTx, Redeemer, Redeemers, RedeemersKey, TransactionInput,
TransactionOutput,
},
Fragment,
};
use pallas_traverse::{Era, MultiEraTx};
pub use phase_one::{eval_phase_one, redeemer_tag_to_string};

View File

@ -1,6 +1,6 @@
use crate::{
machine::{self, cost_model::ExBudget, Trace},
TransactionInput,
machine::{self, Trace, cost_model::ExBudget},
};
use pallas_primitives::conway::Language;

View File

@ -1,16 +1,16 @@
use super::{
script_context::{find_script, ResolvedInput, ScriptContext, SlotConfig, TxInfo},
to_plutus_data::ToPlutusData,
Error,
script_context::{ResolvedInput, ScriptContext, SlotConfig, TxInfo, find_script},
to_plutus_data::ToPlutusData,
};
use crate::{
PlutusData,
ast::{FakeNamedDeBruijn, NamedDeBruijn, Program},
machine::{cost_model::ExBudget, eval_result::EvalResult},
tx::{
phase_one::redeemer_tag_to_string,
script_context::{DataLookupTable, ScriptVersion, TxInfoV1, TxInfoV2, TxInfoV3},
},
PlutusData,
};
use pallas_codec::utils::Bytes;
use pallas_primitives::conway::{CostModel, CostModels, ExUnits, Language, MintedTx, Redeemer};

View File

@ -1,6 +1,6 @@
use super::{
error::Error,
script_context::{sort_voters, DataLookupTable, ResolvedInput, ScriptPurpose, ScriptVersion},
script_context::{DataLookupTable, ResolvedInput, ScriptPurpose, ScriptVersion, sort_voters},
};
use crate::tx::script_context::sort_reward_accounts;
use itertools::Itertools;

View File

@ -1,4 +1,4 @@
use super::{to_plutus_data::MintValue, Error};
use super::{Error, to_plutus_data::MintValue};
use crate::tx::iter_redeemers;
use itertools::Itertools;
use pallas_addresses::{Address, Network, StakePayload};
@ -1134,14 +1134,14 @@ mod tests {
use crate::{
ast::Data,
tx::{
ResolvedInput, SlotConfig,
script_context::{TxInfo, TxInfoV3},
to_plutus_data::ToPlutusData,
ResolvedInput, SlotConfig,
},
};
use pallas_primitives::{
conway::{ExUnits, PlutusData, Redeemer, RedeemerTag, TransactionInput, TransactionOutput},
Fragment,
conway::{ExUnits, PlutusData, Redeemer, RedeemerTag, TransactionInput, TransactionOutput},
};
use pallas_traverse::{Era, MultiEraTx};

View File

@ -1,9 +1,9 @@
use super::{eval_phase_two, ResolvedInput, SlotConfig};
use super::{ResolvedInput, SlotConfig, eval_phase_two};
use crate::machine::cost_model::ExBudget;
use pallas_codec::utils::MaybeIndefArray;
use pallas_primitives::{
conway::{CostModels, TransactionInput, TransactionOutput},
Fragment,
conway::{CostModels, TransactionInput, TransactionOutput},
};
use pallas_traverse::{Era, MultiEraTx};
@ -1001,7 +1001,8 @@ fn test_eval_4() {
.unwrap();
match multi_era_tx {
MultiEraTx::Conway(tx) => {
assert!(eval_phase_two(
assert!(
eval_phase_two(
&tx,
&utxos,
Some(&cost_mdl),
@ -1010,7 +1011,8 @@ fn test_eval_4() {
false,
|_| (),
)
.is_err());
.is_err()
);
}
_ => unreachable!(),
};
@ -1757,7 +1759,8 @@ fn eval_extraneous_redeemer() {
match multi_era_tx {
MultiEraTx::Conway(tx) => {
assert!(eval_phase_two(
assert!(
eval_phase_two(
&tx,
&utxos,
Some(&cost_mdl),
@ -1766,7 +1769,8 @@ fn eval_extraneous_redeemer() {
false,
|_| (),
)
.is_err());
.is_err()
);
}
_ => unreachable!(),
};

View File

@ -3,7 +3,7 @@ use super::script_context::{
};
use crate::{
ast::Data,
machine::runtime::{convert_constr_to_tag, ANY_TAG},
machine::runtime::{ANY_TAG, convert_constr_to_tag},
tx::script_context::from_alonzo_output,
};
use num_integer::Integer;

View File

@ -1,9 +1,9 @@
use num_bigint::ToBigInt;
use pallas_codec::utils::MaybeIndefArray;
use uplc::{
Constr, PlutusData,
ast::{Constant, Name, Term, Type},
parser::term,
Constr, PlutusData,
};
// Examples sourced from https://github.com/input-output-hk/plutus/issues/4751#issuecomment-1538377273

View File

@ -13,4 +13,4 @@ requirements = []
source = "github"
[etags]
"aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1735183696, nanos_since_epoch = 808235000 }, "25c8d0802b8266feca04b47933382c5dee3cadb422208a5d3810d9d2df108c2e"]
"aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1742778281, nanos_since_epoch = 899807000 }, "25c8d0802b8266feca04b47933382c5dee3cadb422208a5d3810d9d2df108c2e"]

View File

@ -6,7 +6,7 @@
"plutusVersion": "v3",
"compiler": {
"name": "Aiken",
"version": "v1.1.9+2217206"
"version": "v1.1.15+8c55971"
},
"license": "Apache-2.0"
},
@ -16,7 +16,7 @@
"datum": {
"title": "datum",
"schema": {
"$ref": "#/definitions/SpendTokenName"
"$ref": "#/definitions/multi~1SpendTokenName"
}
},
"redeemer": {
@ -33,8 +33,8 @@
}
}
],
"compiledCode": "59040a01010032323232323232232253330043232323232323232325323233300f300100613233223232325333015300830163754002264a66602c6010602e6ea80044c94ccc05cc028c060dd5003099b8732325333019300b301a37540022900009bad301e301b375400264a666032601660346ea8004530103d87a8000132330010013756603e60386ea8008894ccc078004530103d87a8000132333222533301f337220100062a66603e66e3c02000c4c050cc08cdd400125eb80530103d87a8000133006006001375c603a0026eb4c078004c088008c080004cc030014008dd7180e180c9baa0064800458dd7180d980c1baa00116301a301737546034602e6ea8c068c06cc05cdd5180d180b9baa0011632330010013758603400644a6660320022980103d87a80001332253330183375e601c60346ea80080204c034cc0700092f5c0266008008002603600260380026eacc060c064c064c064c064004c050dd5006180a800980a980b00098089baa0071533300f3002006132323253330123005001132325333017301a00200416375a603000260286ea802c54ccc048c01000454ccc054c050dd50058010b0b18091baa00a1323232323232325333017300a3018375402026464a66603266002008466e3c0600044c8c8cc004004014894ccc07c004528899199911299981019804004919b8f00100415333020323300100100d22533302500114a026644a6660486464a66604c66ebcc0acc0b0c0b0008cdd2a4008660546ea40252f5c0266ebcc070c0a0dd50008068a50302a0013026375400429444cc010010004c09c004c0a000454ccc080c0480084cc0180180045280b0b1bae301e001375a603e0026046004604200266e9520023301d375201497ae014a044646600200200644a66603e00229404cc894ccc078c0140085288998020020009bae302100130220013232333001001375a603c60366ea80492f5c0444a666036601c0042002266600600666e0000920013301f37526e50cdc58010020009bb3300d3019375460380082646600200200444a66603800229444cc894ccc06ccdc39bad301d002480044cc010010004528180f000980f80099299980b9804980c1baa00114bd6f7b63009bab301c30193754002660146eacc06c01001cdd6180d180d980d980d980d8019bac30190033758603000660306030002602e602e00260246ea8028dd7180a18089baa00716370e90011b874800088c8cc00400400c894ccc04c0045300103d87a800013233322253330143372200e0062a66602866e3c01c00c4c024cc060dd300125eb80530103d87a8000133006006001375c60240026eacc04c004c05c008c054004dd2a40004602000260146ea8004c034c03800cc030008c02c008c02c004c018dd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "3fe854a1171108b9af1e064ee47af2f81c9788104a6f49213dec8bb7"
"compiledCode": "590405010100229800aba2aba1aba0aab9faab9eaab9dab9a9bae00248888888966003300130043754013374a90004dc3a4001370e90012444464653001300937540032232330010010032259800800c530103d87a8000899192cc004cdc8802800c56600266e3c0140062601666024602000497ae08a60103d87a80004039133004004301400340386eb8c038004c04400500f4c03401a601a00491112cc004c01c01226466446644b3001300d3012375400513259800980698099baa0018acc004c038c04cdd500144cdc3cc004dd5980b980c180c180c180c0024dd7180b980a1baa0019bae301730143754004911192cc004c044c05cdd5000c5200089bad301b3018375400280b0c9660026022602e6ea8006298103d87a8000899198008009bab301c3019375400444b30010018a6103d87a8000899192cc004cdc8803000c56600266e3c0180062602e6603c603800497ae08a60103d87a80004069133004004302000340686eb8c068004c07400501b202c3300c00300224003164049164048602c60266ea8c058c04cdd5180b180b98099baa30163013375400516404464660020026eb0c054008896600200314c103d87a80008992cc004cdd7980b980a1baa001005898079980b000a5eb8226600600660300048090c058005014180a180a801980900098079baa003300e375400b159800980400244c8cc896600260160031323259800980b80140122c80a0dd6980a80098089baa0048acc004c0280062b3001301137540090028b20248b201e403c26464646644b3001300e3013375400f13259800998009bac3018301930193019301900423371e0260031332232330010010062259800800c528c4c8c9660026600e00c466e3c00400a2b300132330010010092259800800c528456600264b30013375e60426044604400266e95200433020375200897ae0899baf3021301e3754604200201114a080e0c074dd51810000c528c4cc008008c08400501b203c8acc004c050dd6980d80144cc010010c07c00e29410194590194590191bae3019001301c0014068646530010019bad301a301737540154bd702002222598009809801440063300100399b8000248006660366ea4dca19b8b002004001400c80b8dd9980c180a9baa30183758603000c66e95200233017375200e97ae08a50404c44646600200200644b30010018a508acc004c00cdd7180d800c528c4cc008008c070005016203289919800800801912cc00400629462b30013370e6eb4c058c0640052001899801001180d000c5282028405c8090c966002601860246ea8006297adef6c6089bab3016301337540028088cc01cdd5980a8008021bac30150023015301500130143014001300f3754006601c6ea8008dd7180898071baa0058b20184030300c300d001300c004452689b2b20041",
"hash": "2f904329815ffc78edc99e90ca907d86fdd0c8fa886b50bdd42f36fa"
},
{
"title": "multi.redeem.mint",
@ -52,8 +52,8 @@
}
}
],
"compiledCode": "59040a01010032323232323232232253330043232323232323232325323233300f300100613233223232325333015300830163754002264a66602c6010602e6ea80044c94ccc05cc028c060dd5003099b8732325333019300b301a37540022900009bad301e301b375400264a666032601660346ea8004530103d87a8000132330010013756603e60386ea8008894ccc078004530103d87a8000132333222533301f337220100062a66603e66e3c02000c4c050cc08cdd400125eb80530103d87a8000133006006001375c603a0026eb4c078004c088008c080004cc030014008dd7180e180c9baa0064800458dd7180d980c1baa00116301a301737546034602e6ea8c068c06cc05cdd5180d180b9baa0011632330010013758603400644a6660320022980103d87a80001332253330183375e601c60346ea80080204c034cc0700092f5c0266008008002603600260380026eacc060c064c064c064c064004c050dd5006180a800980a980b00098089baa0071533300f3002006132323253330123005001132325333017301a00200416375a603000260286ea802c54ccc048c01000454ccc054c050dd50058010b0b18091baa00a1323232323232325333017300a3018375402026464a66603266002008466e3c0600044c8c8cc004004014894ccc07c004528899199911299981019804004919b8f00100415333020323300100100d22533302500114a026644a6660486464a66604c66ebcc0acc0b0c0b0008cdd2a4008660546ea40252f5c0266ebcc070c0a0dd50008068a50302a0013026375400429444cc010010004c09c004c0a000454ccc080c0480084cc0180180045280b0b1bae301e001375a603e0026046004604200266e9520023301d375201497ae014a044646600200200644a66603e00229404cc894ccc078c0140085288998020020009bae302100130220013232333001001375a603c60366ea80492f5c0444a666036601c0042002266600600666e0000920013301f37526e50cdc58010020009bb3300d3019375460380082646600200200444a66603800229444cc894ccc06ccdc39bad301d002480044cc010010004528180f000980f80099299980b9804980c1baa00114bd6f7b63009bab301c30193754002660146eacc06c01001cdd6180d180d980d980d980d8019bac30190033758603000660306030002602e602e00260246ea8028dd7180a18089baa00716370e90011b874800088c8cc00400400c894ccc04c0045300103d87a800013233322253330143372200e0062a66602866e3c01c00c4c024cc060dd300125eb80530103d87a8000133006006001375c60240026eacc04c004c05c008c054004dd2a40004602000260146ea8004c034c03800cc030008c02c008c02c004c018dd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "3fe854a1171108b9af1e064ee47af2f81c9788104a6f49213dec8bb7"
"compiledCode": "590405010100229800aba2aba1aba0aab9faab9eaab9dab9a9bae00248888888966003300130043754013374a90004dc3a4001370e90012444464653001300937540032232330010010032259800800c530103d87a8000899192cc004cdc8802800c56600266e3c0140062601666024602000497ae08a60103d87a80004039133004004301400340386eb8c038004c04400500f4c03401a601a00491112cc004c01c01226466446644b3001300d3012375400513259800980698099baa0018acc004c038c04cdd500144cdc3cc004dd5980b980c180c180c180c0024dd7180b980a1baa0019bae301730143754004911192cc004c044c05cdd5000c5200089bad301b3018375400280b0c9660026022602e6ea8006298103d87a8000899198008009bab301c3019375400444b30010018a6103d87a8000899192cc004cdc8803000c56600266e3c0180062602e6603c603800497ae08a60103d87a80004069133004004302000340686eb8c068004c07400501b202c3300c00300224003164049164048602c60266ea8c058c04cdd5180b180b98099baa30163013375400516404464660020026eb0c054008896600200314c103d87a80008992cc004cdd7980b980a1baa001005898079980b000a5eb8226600600660300048090c058005014180a180a801980900098079baa003300e375400b159800980400244c8cc896600260160031323259800980b80140122c80a0dd6980a80098089baa0048acc004c0280062b3001301137540090028b20248b201e403c26464646644b3001300e3013375400f13259800998009bac3018301930193019301900423371e0260031332232330010010062259800800c528c4c8c9660026600e00c466e3c00400a2b300132330010010092259800800c528456600264b30013375e60426044604400266e95200433020375200897ae0899baf3021301e3754604200201114a080e0c074dd51810000c528c4cc008008c08400501b203c8acc004c050dd6980d80144cc010010c07c00e29410194590194590191bae3019001301c0014068646530010019bad301a301737540154bd702002222598009809801440063300100399b8000248006660366ea4dca19b8b002004001400c80b8dd9980c180a9baa30183758603000c66e95200233017375200e97ae08a50404c44646600200200644b30010018a508acc004c00cdd7180d800c528c4cc008008c070005016203289919800800801912cc00400629462b30013370e6eb4c058c0640052001899801001180d000c5282028405c8090c966002601860246ea8006297adef6c6089bab3016301337540028088cc01cdd5980a8008021bac30150023015301500130143014001300f3754006601c6ea8008dd7180898071baa0058b20184030300c300d001300c004452689b2b20041",
"hash": "2f904329815ffc78edc99e90ca907d86fdd0c8fa886b50bdd42f36fa"
},
{
"title": "multi.redeem.else",
@ -68,8 +68,8 @@
}
}
],
"compiledCode": "59040a01010032323232323232232253330043232323232323232325323233300f300100613233223232325333015300830163754002264a66602c6010602e6ea80044c94ccc05cc028c060dd5003099b8732325333019300b301a37540022900009bad301e301b375400264a666032601660346ea8004530103d87a8000132330010013756603e60386ea8008894ccc078004530103d87a8000132333222533301f337220100062a66603e66e3c02000c4c050cc08cdd400125eb80530103d87a8000133006006001375c603a0026eb4c078004c088008c080004cc030014008dd7180e180c9baa0064800458dd7180d980c1baa00116301a301737546034602e6ea8c068c06cc05cdd5180d180b9baa0011632330010013758603400644a6660320022980103d87a80001332253330183375e601c60346ea80080204c034cc0700092f5c0266008008002603600260380026eacc060c064c064c064c064004c050dd5006180a800980a980b00098089baa0071533300f3002006132323253330123005001132325333017301a00200416375a603000260286ea802c54ccc048c01000454ccc054c050dd50058010b0b18091baa00a1323232323232325333017300a3018375402026464a66603266002008466e3c0600044c8c8cc004004014894ccc07c004528899199911299981019804004919b8f00100415333020323300100100d22533302500114a026644a6660486464a66604c66ebcc0acc0b0c0b0008cdd2a4008660546ea40252f5c0266ebcc070c0a0dd50008068a50302a0013026375400429444cc010010004c09c004c0a000454ccc080c0480084cc0180180045280b0b1bae301e001375a603e0026046004604200266e9520023301d375201497ae014a044646600200200644a66603e00229404cc894ccc078c0140085288998020020009bae302100130220013232333001001375a603c60366ea80492f5c0444a666036601c0042002266600600666e0000920013301f37526e50cdc58010020009bb3300d3019375460380082646600200200444a66603800229444cc894ccc06ccdc39bad301d002480044cc010010004528180f000980f80099299980b9804980c1baa00114bd6f7b63009bab301c30193754002660146eacc06c01001cdd6180d180d980d980d980d8019bac30190033758603000660306030002602e602e00260246ea8028dd7180a18089baa00716370e90011b874800088c8cc00400400c894ccc04c0045300103d87a800013233322253330143372200e0062a66602866e3c01c00c4c024cc060dd300125eb80530103d87a8000133006006001375c60240026eacc04c004c05c008c054004dd2a40004602000260146ea8004c034c03800cc030008c02c008c02c004c018dd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "3fe854a1171108b9af1e064ee47af2f81c9788104a6f49213dec8bb7"
"compiledCode": "590405010100229800aba2aba1aba0aab9faab9eaab9dab9a9bae00248888888966003300130043754013374a90004dc3a4001370e90012444464653001300937540032232330010010032259800800c530103d87a8000899192cc004cdc8802800c56600266e3c0140062601666024602000497ae08a60103d87a80004039133004004301400340386eb8c038004c04400500f4c03401a601a00491112cc004c01c01226466446644b3001300d3012375400513259800980698099baa0018acc004c038c04cdd500144cdc3cc004dd5980b980c180c180c180c0024dd7180b980a1baa0019bae301730143754004911192cc004c044c05cdd5000c5200089bad301b3018375400280b0c9660026022602e6ea8006298103d87a8000899198008009bab301c3019375400444b30010018a6103d87a8000899192cc004cdc8803000c56600266e3c0180062602e6603c603800497ae08a60103d87a80004069133004004302000340686eb8c068004c07400501b202c3300c00300224003164049164048602c60266ea8c058c04cdd5180b180b98099baa30163013375400516404464660020026eb0c054008896600200314c103d87a80008992cc004cdd7980b980a1baa001005898079980b000a5eb8226600600660300048090c058005014180a180a801980900098079baa003300e375400b159800980400244c8cc896600260160031323259800980b80140122c80a0dd6980a80098089baa0048acc004c0280062b3001301137540090028b20248b201e403c26464646644b3001300e3013375400f13259800998009bac3018301930193019301900423371e0260031332232330010010062259800800c528c4c8c9660026600e00c466e3c00400a2b300132330010010092259800800c528456600264b30013375e60426044604400266e95200433020375200897ae0899baf3021301e3754604200201114a080e0c074dd51810000c528c4cc008008c08400501b203c8acc004c050dd6980d80144cc010010c07c00e29410194590194590191bae3019001301c0014068646530010019bad301a301737540154bd702002222598009809801440063300100399b8000248006660366ea4dca19b8b002004001400c80b8dd9980c180a9baa30183758603000c66e95200233017375200e97ae08a50404c44646600200200644b30010018a508acc004c00cdd7180d800c528c4cc008008c070005016203289919800800801912cc00400629462b30013370e6eb4c058c0640052001899801001180d000c5282028405c8090c966002601860246ea8006297adef6c6089bab3016301337540028088cc01cdd5980a8008021bac30150023015301500130143014001300f3754006601c6ea8008dd7180898071baa0058b20184030300c300d001300c004452689b2b20041",
"hash": "2f904329815ffc78edc99e90ca907d86fdd0c8fa886b50bdd42f36fa"
},
{
"title": "oneshot.gift_card.spend",
@ -99,8 +99,8 @@
}
}
],
"compiledCode": "5902730101003232323232323223222533300532323232323232323232532333010300500613233223232325333016300730173754002264a66602e601860306ea80044c8c94ccc070c07c0084c94ccc068cdc39bad301c002480044cdc780080c0a50375c60340022c603a002660160066eb8c070c064dd50008b1804980c1baa3009301837546036603860306ea8c06cc060dd50008b198039bac301a00223375e601260306ea8004014dd5980c980d180d180d180d000980a9baa00c3016001301630170013012375400e2a666020600200c2646464a66602660080022a66602c602a6ea802c0085854ccc04cc02000454ccc058c054dd50058010b0b18099baa00a1323232325333018301b00213232533301730083018375401e2a66602e601060306ea8cc0240148cdd79805980d1baa00101515333017300c00113371e00402a29405854ccc05ccdc3800a4002266e3c0080545281bad3018002375c602c0022c60320026600e6eacc060c064c064c064c06400800cdd6180b80098099baa00a375c602a60246ea801c58dc3a400044646600200200644a66602a0022980103d87a8000133225333014300500213374a90001980c00125eb804cc010010004c05c004c0600048c04c00488c94ccc03cc010c040dd50008a5eb7bdb1804dd5980a18089baa001323300100100322533301300114c103d87a800013233322253330143372200e0062a66602866e3c01c00c4cdd2a4000660306e980092f5c02980103d87a8000133006006001375c60240026eacc04c004c05c008c054004dc3a400460166ea8004c038c03c00cc034008c030008c030004c01cdd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "675eda685b40c32d3d2413fd2027d9f0cd7a07dcb3015fb70c5dc28d"
"compiledCode": "5902780101002229800aba2aba1aba0aab9faab9eaab9dab9a9bae00348888888966003300130043754013370e9001488c8cc00400400c896600200314c103d87a80008992cc004c010006266e9520003300b0014bd7044cc00c00cc0340090071805800a0129b874800122223232980098049baa00191192cc004c020c030dd5000c52f5bded8c1137566020601a6ea800500b1919800800801912cc0040062980103d87a8000899192cc004cdc8802800c56600266e3c014006266e9520003301230100024bd7045300103d87a80004039133004004301400340386eb8c038004c04400500f4c03401a601a00491112cc004c02401226466446644b3001300c3012375400513259800980798099baa0018992cc004c064006264b30013370e6eb4c0580052001899b8f375c602a00202714a080a0c0600062c80b0cc024dd5980b980c180c180c180c0021bae301730143754003164048602c60266ea8c058c04cdd5180b180b98099baa301630133754005164044660166eb0c0500048cdd7980a98091baa001003301430150033012001300f3754006601c6ea80162b3001300700489919912cc004c0280062b3001301137540090028b20248acc004c0300062b3001301137540090028b20248b201e403c26464b3001301500189919912cc004c034c04cdd5003c566002601a60266ea8cc038dd6180b802919baf3018301537540020371598009807800c4cdc7801008c52820248b20248acc004cdc3800a400313371e00402314a080910121bae3011001375a602400260280031640486600a6eacc04cc050c050c050c050004008c03cdd500198071baa002375c6022601c6ea80162c806100c0c030c034004c030011149a26cac8011",
"hash": "54b0903e563399968940db2ee9eda7f683f0a1d44752e65e4d2854e9"
},
{
"title": "oneshot.gift_card.mint",
@ -124,8 +124,8 @@
}
}
],
"compiledCode": "5902730101003232323232323223222533300532323232323232323232532333010300500613233223232325333016300730173754002264a66602e601860306ea80044c8c94ccc070c07c0084c94ccc068cdc39bad301c002480044cdc780080c0a50375c60340022c603a002660160066eb8c070c064dd50008b1804980c1baa3009301837546036603860306ea8c06cc060dd50008b198039bac301a00223375e601260306ea8004014dd5980c980d180d180d180d000980a9baa00c3016001301630170013012375400e2a666020600200c2646464a66602660080022a66602c602a6ea802c0085854ccc04cc02000454ccc058c054dd50058010b0b18099baa00a1323232325333018301b00213232533301730083018375401e2a66602e601060306ea8cc0240148cdd79805980d1baa00101515333017300c00113371e00402a29405854ccc05ccdc3800a4002266e3c0080545281bad3018002375c602c0022c60320026600e6eacc060c064c064c064c06400800cdd6180b80098099baa00a375c602a60246ea801c58dc3a400044646600200200644a66602a0022980103d87a8000133225333014300500213374a90001980c00125eb804cc010010004c05c004c0600048c04c00488c94ccc03cc010c040dd50008a5eb7bdb1804dd5980a18089baa001323300100100322533301300114c103d87a800013233322253330143372200e0062a66602866e3c01c00c4cdd2a4000660306e980092f5c02980103d87a8000133006006001375c60240026eacc04c004c05c008c054004dc3a400460166ea8004c038c03c00cc034008c030008c030004c01cdd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "675eda685b40c32d3d2413fd2027d9f0cd7a07dcb3015fb70c5dc28d"
"compiledCode": "5902780101002229800aba2aba1aba0aab9faab9eaab9dab9a9bae00348888888966003300130043754013370e9001488c8cc00400400c896600200314c103d87a80008992cc004c010006266e9520003300b0014bd7044cc00c00cc0340090071805800a0129b874800122223232980098049baa00191192cc004c020c030dd5000c52f5bded8c1137566020601a6ea800500b1919800800801912cc0040062980103d87a8000899192cc004cdc8802800c56600266e3c014006266e9520003301230100024bd7045300103d87a80004039133004004301400340386eb8c038004c04400500f4c03401a601a00491112cc004c02401226466446644b3001300c3012375400513259800980798099baa0018992cc004c064006264b30013370e6eb4c0580052001899b8f375c602a00202714a080a0c0600062c80b0cc024dd5980b980c180c180c180c0021bae301730143754003164048602c60266ea8c058c04cdd5180b180b98099baa301630133754005164044660166eb0c0500048cdd7980a98091baa001003301430150033012001300f3754006601c6ea80162b3001300700489919912cc004c0280062b3001301137540090028b20248acc004c0300062b3001301137540090028b20248b201e403c26464b3001301500189919912cc004c034c04cdd5003c566002601a60266ea8cc038dd6180b802919baf3018301537540020371598009807800c4cdc7801008c52820248b20248acc004cdc3800a400313371e00402314a080910121bae3011001375a602400260280031640486600a6eacc04cc050c050c050c050004008c03cdd500198071baa002375c6022601c6ea80162c806100c0c030c034004c030011149a26cac8011",
"hash": "54b0903e563399968940db2ee9eda7f683f0a1d44752e65e4d2854e9"
},
{
"title": "oneshot.gift_card.else",
@ -146,8 +146,8 @@
}
}
],
"compiledCode": "5902730101003232323232323223222533300532323232323232323232532333010300500613233223232325333016300730173754002264a66602e601860306ea80044c8c94ccc070c07c0084c94ccc068cdc39bad301c002480044cdc780080c0a50375c60340022c603a002660160066eb8c070c064dd50008b1804980c1baa3009301837546036603860306ea8c06cc060dd50008b198039bac301a00223375e601260306ea8004014dd5980c980d180d180d180d000980a9baa00c3016001301630170013012375400e2a666020600200c2646464a66602660080022a66602c602a6ea802c0085854ccc04cc02000454ccc058c054dd50058010b0b18099baa00a1323232325333018301b00213232533301730083018375401e2a66602e601060306ea8cc0240148cdd79805980d1baa00101515333017300c00113371e00402a29405854ccc05ccdc3800a4002266e3c0080545281bad3018002375c602c0022c60320026600e6eacc060c064c064c064c06400800cdd6180b80098099baa00a375c602a60246ea801c58dc3a400044646600200200644a66602a0022980103d87a8000133225333014300500213374a90001980c00125eb804cc010010004c05c004c0600048c04c00488c94ccc03cc010c040dd50008a5eb7bdb1804dd5980a18089baa001323300100100322533301300114c103d87a800013233322253330143372200e0062a66602866e3c01c00c4cdd2a4000660306e980092f5c02980103d87a8000133006006001375c60240026eacc04c004c05c008c054004dc3a400460166ea8004c038c03c00cc034008c030008c030004c01cdd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "675eda685b40c32d3d2413fd2027d9f0cd7a07dcb3015fb70c5dc28d"
"compiledCode": "5902780101002229800aba2aba1aba0aab9faab9eaab9dab9a9bae00348888888966003300130043754013370e9001488c8cc00400400c896600200314c103d87a80008992cc004c010006266e9520003300b0014bd7044cc00c00cc0340090071805800a0129b874800122223232980098049baa00191192cc004c020c030dd5000c52f5bded8c1137566020601a6ea800500b1919800800801912cc0040062980103d87a8000899192cc004cdc8802800c56600266e3c014006266e9520003301230100024bd7045300103d87a80004039133004004301400340386eb8c038004c04400500f4c03401a601a00491112cc004c02401226466446644b3001300c3012375400513259800980798099baa0018992cc004c064006264b30013370e6eb4c0580052001899b8f375c602a00202714a080a0c0600062c80b0cc024dd5980b980c180c180c180c0021bae301730143754003164048602c60266ea8c058c04cdd5180b180b98099baa301630133754005164044660166eb0c0500048cdd7980a98091baa001003301430150033012001300f3754006601c6ea80162b3001300700489919912cc004c0280062b3001301137540090028b20248acc004c0300062b3001301137540090028b20248b201e403c26464b3001301500189919912cc004c034c04cdd5003c566002601a60266ea8cc038dd6180b802919baf3018301537540020371598009807800c4cdc7801008c52820248b20248acc004cdc3800a400313371e00402314a080910121bae3011001375a602400260280031640486600a6eacc04cc050c050c050c050004008c03cdd500198071baa002375c6022601c6ea80162c806100c0c030c034004c030011149a26cac8011",
"hash": "54b0903e563399968940db2ee9eda7f683f0a1d44752e65e4d2854e9"
}
],
"definitions": {
@ -161,10 +161,6 @@
"Int": {
"dataType": "integer"
},
"SpendTokenName": {
"title": "SpendTokenName",
"dataType": "bytes"
},
"cardano/transaction/OutputReference": {
"title": "OutputReference",
"description": "An `OutputReference` is a unique reference to an output on-chain. The `output_index`\n corresponds to the position in the output list of the transaction (identified by its id)\n that produced that output",
@ -207,6 +203,10 @@
}
]
},
"multi/SpendTokenName": {
"title": "SpendTokenName",
"dataType": "bytes"
},
"oneshot/Action": {
"title": "Action",
"anyOf": [