Add 'plutusVersion' to blueprints.
This commit is contained in:
parent
82a32a082b
commit
c0230a811f
|
@ -16,15 +16,28 @@ pub struct Blueprint<T: Default> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Preamble {
|
pub struct Preamble {
|
||||||
pub title: String,
|
pub title: String,
|
||||||
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
|
|
||||||
pub version: String,
|
pub version: String,
|
||||||
|
|
||||||
|
pub plutus_version: PlutusVersion,
|
||||||
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub license: Option<String>,
|
pub license: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub enum PlutusVersion {
|
||||||
|
V1,
|
||||||
|
V2,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub enum LookupResult<'a, T> {
|
pub enum LookupResult<'a, T> {
|
||||||
One(&'a T),
|
One(&'a T),
|
||||||
|
@ -112,6 +125,7 @@ impl From<&Config> for Preamble {
|
||||||
} else {
|
} else {
|
||||||
Some(config.description.clone())
|
Some(config.description.clone())
|
||||||
},
|
},
|
||||||
|
plutus_version: PlutusVersion::V2,
|
||||||
version: config.version.clone(),
|
version: config.version.clone(),
|
||||||
license: config.license.clone(),
|
license: config.license.clone(),
|
||||||
}
|
}
|
||||||
|
@ -130,6 +144,7 @@ mod test {
|
||||||
title: "Foo".to_string(),
|
title: "Foo".to_string(),
|
||||||
description: None,
|
description: None,
|
||||||
version: "1.0.0".to_string(),
|
version: "1.0.0".to_string(),
|
||||||
|
plutus_version: PlutusVersion::V2,
|
||||||
license: Some("Apache-2.0".to_string()),
|
license: Some("Apache-2.0".to_string()),
|
||||||
},
|
},
|
||||||
validators: vec![],
|
validators: vec![],
|
||||||
|
@ -140,6 +155,7 @@ mod test {
|
||||||
"preamble": {
|
"preamble": {
|
||||||
"title": "Foo",
|
"title": "Foo",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"plutusVersion": "v2",
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
"validators": []
|
"validators": []
|
||||||
|
@ -154,6 +170,7 @@ mod test {
|
||||||
title: "Foo".to_string(),
|
title: "Foo".to_string(),
|
||||||
description: Some("Lorem ipsum".to_string()),
|
description: Some("Lorem ipsum".to_string()),
|
||||||
version: "1.0.0".to_string(),
|
version: "1.0.0".to_string(),
|
||||||
|
plutus_version: PlutusVersion::V2,
|
||||||
license: None,
|
license: None,
|
||||||
},
|
},
|
||||||
validators: vec![],
|
validators: vec![],
|
||||||
|
@ -165,6 +182,7 @@ mod test {
|
||||||
"title": "Foo",
|
"title": "Foo",
|
||||||
"description": "Lorem ipsum",
|
"description": "Lorem ipsum",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"plutusVersion": "v2"
|
||||||
},
|
},
|
||||||
"validators": []
|
"validators": []
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
"preamble": {
|
"preamble": {
|
||||||
"title": "aiken-lang/hello_world",
|
"title": "aiken-lang/hello_world",
|
||||||
"description": "Aiken contracts for project 'aiken-lang/hello_world'",
|
"description": "Aiken contracts for project 'aiken-lang/hello_world'",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0",
|
||||||
|
"plutusVersion": "v2"
|
||||||
},
|
},
|
||||||
"validators": [
|
"validators": [
|
||||||
{
|
{
|
||||||
|
@ -39,8 +40,8 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"compiledCode": "58e10100003232323232323232222533300632323232533300a002100114a06464660026eb0cc010c014cc010c014019200048040dd7198021802804240006002002444a66601e00429404c8c94ccc038cdc78010018a5113330050050010033012003375c602000466e5cc8dcc8009bae330013002004480012410d48656c6c6f2c20576f726c64210022323330010014800000c888cccc030cdc3802001008119980200219b8000348008c0480040048c024dd50008a4c2c6002002444a66600e004293099802980098040011998018019804801000ab9a5736aae7955cfaba15745",
|
"compiledCode": "58dd0100003232323232323232222533300632323232533300a002100114a06464660026eb0cc010c014cc010c014019200048040dd7198021802804240006002002444a66601e00429404c8c94ccc038cdc78010018a5113330050050010033012003375c602000466e3cdd71980098010022400091010d48656c6c6f2c20576f726c64210022323330010014800000c888cccc030cdc3802001008119980200219b8000348008c0480040048c024dd50008a4c2c6002002444a66600e004293099802980098040011998018019804801000ab9a5736aae7955cfaba15745",
|
||||||
"hash": "287233442cf812fafd74ab135d665f110de89ac12775204ad741f220"
|
"hash": "46872294cadbacb2c3214086c0129ede75cf9f767e95a449f996685f"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue