diff --git a/Cargo.toml b/Cargo.toml index c6d0fd0..2f85e43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "aiken-jna-wrapper" -version = "0.5.0" -authors = ["satran004", "matiwinnetou"] +version = "0.6.0" edition = "2021" +authors = ["satran004", "matiwinnetou"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -10,21 +10,21 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -aiken = "1.0.19-alpha" -uplc = "1.0.19-alpha" -aiken-lang = "1.0.19-alpha" +uplc = "1.1.2" +aiken-lang = "1.1.2" -pallas-addresses = "0.18.2" -pallas-codec = "0.18.2" -pallas-crypto = "0.18.2" -pallas-primitives = "0.18.2" -pallas-traverse = "0.18.2" +pallas-addresses = "0.30.1" +pallas-codec = { version = "0.30.1", features = ["num-bigint"] } +pallas-crypto = "0.30.1" +pallas-primitives = "0.30.1" +pallas-traverse = "0.30.1" ffi-support = "0.4.4" -jni = "0.20.0" +jni = "0.21.1" hex = "0.4.3" -minicbor = "0.19.1" -serde = { version = "1.0.95", features = ["derive"] } -serde_json = { version = "1.0.95" } -anyhow = "1.0.75" +minicbor = "0.20.0" +serde = { version = "1.0.210", features = ["derive"] } +serde_json = { version = "1.0.128" } +anyhow = "1.0.89" + diff --git a/src/lib.rs b/src/lib.rs index 32450a3..51d794d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,6 @@ extern crate core; +extern crate serde; +extern crate anyhow; mod transaction; diff --git a/src/transaction.rs b/src/transaction.rs index b0e6265..bf2ce65 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -1,6 +1,9 @@ -use pallas_primitives::babbage::CostMdls; +extern crate uplc; +extern crate pallas_primitives; + +use pallas_primitives::conway::CostMdls; use pallas_primitives::{ - babbage::{TransactionInput, TransactionOutput}, + conway::{TransactionInput, TransactionOutput}, Fragment, }; use pallas_traverse::{Era, MultiEraTx}; @@ -23,9 +26,9 @@ pub fn eval_phase_two( let tx_bytes: &[u8] = tx_bytes.as_slice(); - let tx: MultiEraTx = MultiEraTx::decode(Era::Babbage, &tx_bytes) - .or_else(|_| MultiEraTx::decode(Era::Alonzo, &tx_bytes)) - .map_err(|err| anyhow!(format!("PALLAS: {:?}", err)))?; + let tx = MultiEraTx::decode_for_era(Era::Conway, tx_bytes) + .or_else(|_| MultiEraTx::decode_for_era(Era::Babbage, tx_bytes)) + .or_else(|_| MultiEraTx::decode_for_era(Era::Alonzo, tx_bytes))?; let inputs_bytes: Vec = hex::decode(inputs).map_err(|err| anyhow!(format!("HEX: {:?}", err)))?; let outputs_bytes: Vec = hex::decode(outputs).map_err(|err| anyhow!(format!("HEX: {:?}", err)))?; @@ -51,9 +54,9 @@ pub fn eval_phase_two( let cost_mdls = CostMdls::decode_fragment(cost_mdls_bytes).map_err(|err| anyhow!(format!("PALLAS: {:?}", err)))?; - if let Some(tx_babbage) = tx.as_babbage() { + if let Some(tx_conway) = tx.as_conway() { let redeemers = tx::eval_phase_two( - tx_babbage, + tx_conway, &resolved_inputs, Some(&cost_mdls), Some(&ex_budget),