From 050d003b270420bf8cbb2ccec99673daec3e2c63 Mon Sep 17 00:00:00 2001 From: rvcas Date: Tue, 21 May 2024 17:05:02 -0400 Subject: [PATCH] feat: use plutus version in convert command relates to #907 --- crates/aiken/src/cmd/blueprint/convert.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/aiken/src/cmd/blueprint/convert.rs b/crates/aiken/src/cmd/blueprint/convert.rs index 934e621f..09be5aab 100644 --- a/crates/aiken/src/cmd/blueprint/convert.rs +++ b/crates/aiken/src/cmd/blueprint/convert.rs @@ -69,6 +69,13 @@ pub fn exec( let blueprint: Blueprint = serde_json::from_reader(BufReader::new(blueprint)).into_diagnostic()?; + let opt_config = Config::load(&project_path).ok(); + + let cardano_cli_type = opt_config + .map(|config| config.plutus_version) + .unwrap_or_default() + .cardano_cli_type(); + // Perform the conversion let when_too_many = |known_validators| ProjectError::MoreThanOneValidatorFound { known_validators }; @@ -89,7 +96,7 @@ pub fn exec( let cbor_hex = hex::encode(double_cbor_bytes); Ok(json!({ - "type": "PlutusScriptV2", + "type": cardano_cli_type, "description": "Generated by Aiken", "cborHex": cbor_hex }))