Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature update/uplc #108

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading