Fix ordering for ScriptInfo type

This commit is contained in:
microproofs 2024-08-15 13:26:51 -04:00 committed by KtorZ
parent b9456b5946
commit 953ee6b5d1
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
6 changed files with 43 additions and 128 deletions

View File

@ -429,14 +429,14 @@ impl TypedDataType {
constructors: vec![ constructors: vec![
RecordConstructor { RecordConstructor {
location: Span::empty(), location: Span::empty(),
name: "__Spend".to_string(), name: "__Mint".to_string(),
arguments: vec![], arguments: vec![],
doc: None, doc: None,
sugar: false, sugar: false,
}, },
RecordConstructor { RecordConstructor {
location: Span::empty(), location: Span::empty(),
name: "__Mint".to_string(), name: "__Spend".to_string(),
arguments: vec![], arguments: vec![],
doc: None, doc: None,
sugar: false, sugar: false,

View File

@ -665,24 +665,9 @@ pub fn prelude(id_gen: &IdGenerator) -> TypeInfo {
prelude.types_constructors.insert( prelude.types_constructors.insert(
SCRIPT_PURPOSE.to_string(), SCRIPT_PURPOSE.to_string(),
vec![ vec![
SCRIPT_PURPOSE_SPEND.to_string(),
SCRIPT_PURPOSE_MINT.to_string(), SCRIPT_PURPOSE_MINT.to_string(),
],
);
prelude.values.insert(
SCRIPT_PURPOSE_SPEND.to_string(), SCRIPT_PURPOSE_SPEND.to_string(),
ValueConstructor::public( ],
function(vec![data(), option(data())], script_purpose()),
ValueConstructorVariant::Record {
module: "".into(),
name: SCRIPT_PURPOSE_SPEND.to_string(),
field_map: None::<FieldMap>,
arity: 2,
location: Span::empty(),
constructors_count: SCRIPT_PURPOSES_COUNT,
},
),
); );
prelude.values.insert( prelude.values.insert(
@ -700,6 +685,21 @@ pub fn prelude(id_gen: &IdGenerator) -> TypeInfo {
), ),
); );
prelude.values.insert(
SCRIPT_PURPOSE_SPEND.to_string(),
ValueConstructor::public(
function(vec![data(), option(data())], script_purpose()),
ValueConstructorVariant::Record {
module: "".into(),
name: SCRIPT_PURPOSE_SPEND.to_string(),
field_map: None::<FieldMap>,
arity: 2,
location: Span::empty(),
constructors_count: SCRIPT_PURPOSES_COUNT,
},
),
);
prelude.types.insert( prelude.types.insert(
SCRIPT_PURPOSE.to_string(), SCRIPT_PURPOSE.to_string(),
TypeConstructor { TypeConstructor {

View File

@ -13,4 +13,4 @@ requirements = []
source = "github" source = "github"
[etags] [etags]
"aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1723583491, nanos_since_epoch = 208977000 }, "cdbbce58b61deb385e7ea787a2e0fc2dc8fe94db9999e0e6275bc9c70e5796be"] "aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1723741708, nanos_since_epoch = 340365000 }, "cdbbce58b61deb385e7ea787a2e0fc2dc8fe94db9999e0e6275bc9c70e5796be"]

View File

@ -1,5 +1,5 @@
[ [
{ 0: h'70{{ simple_spend.spend.hash }}' { 0: h'70{{ simple_spend.simple_spend_spend.hash }}'
, 1: 1000000000 , 1: 1000000000
, 2: [1, 24(h'd87980')] , 2: [1, 24(h'd87980')]
} }

View File

@ -23,7 +23,7 @@
{ 5: [[0, 0, 121([]), [1000000, 100000000]]] { 5: [[0, 0, 121([]), [1000000, 100000000]]]
, 7: [h'{{ simple_spend.spend.cbor }}'] , 7: [h'{{ simple_spend.simple_spend_spend.cbor }}']
}, },

File diff suppressed because one or more lines are too long