Skip to content

Commit

Permalink
Merge pull request #108 from sidan-lab/feature-update/uplc
Browse files Browse the repository at this point in the history
Feature update/uplc
  • Loading branch information
twwu123 authored Dec 16, 2024
2 parents bf5d5bd + 1498cdb commit 5a020c4
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 158 deletions.
109 changes: 27 additions & 82 deletions packages/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
version = "0.9.11"
version = "0.9.12"
resolver = "2"
members = [
"sidan-csl-rs",
Expand Down
6 changes: 3 additions & 3 deletions packages/sidan-csl-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sidan-csl-rs"
version = "0.9.11"
version = "0.9.12"
edition = "2021"
license = "Apache-2.0"
description = "Wrapper around the cardano-serialization-lib for easier transaction building, heavily inspired by cardano-cli APIs"
Expand All @@ -22,7 +22,7 @@ schemars = "0.8.8"
[target.'cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))'.dependencies]
# uplc = { version = "=1.0.26-alpha", default-features = false, features = ["native-secp256k1"] }
# uplc = "=1.0.26-alpha"
uplc = "=1.1.7"
uplc = "=1.1.9"
wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] }
rand_os = "0.1"
noop_proc_macro = "0.3.0"
Expand All @@ -34,7 +34,7 @@ pallas-traverse = "0.31.0"
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
serde-wasm-bindgen = "0.4.5"
# uplc = { version = "=1.0.26-alpha", default-features = false, features = ["native-secp256k1"] }
uplc = "=1.1.7"
uplc = "=1.1.9"
wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] }
rand_os = { version = "0.1", features = ["wasm-bindgen"] }
js-sys = "=0.3.61"
Expand Down
13 changes: 12 additions & 1 deletion packages/sidan-csl-rs/src/core/core_csl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl MeshCSL {

let tx_value = to_value(&output.amount);
let amount_builder = output_builder.next()?;
let built_output: csl::TransactionOutput = if tx_value.multiasset().is_some() {
let mut built_output: csl::TransactionOutput = if tx_value.multiasset().is_some() {
if tx_value.coin().is_zero() {
amount_builder
.with_asset_and_min_required_coin_by_utxo_cost(
Expand All @@ -196,6 +196,17 @@ impl MeshCSL {
} else {
amount_builder.with_coin(&tx_value.coin()).build()?
};
match built_output.amount().multiasset() {
Some(multiasset) => {
if multiasset.len() == 0 {
built_output = csl::TransactionOutput::new(
&built_output.address(),
&csl::Value::new(&built_output.amount().coin()),
)
}
}
None => {}
}
self.tx_builder.add_output(&built_output)?;
Ok(())
}
Expand Down
Loading

0 comments on commit 5a020c4

Please sign in to comment.