Skip to content

Commit f5563ff

Browse files
authored
Merge pull request #363 from Emurgo/ruslan/tx-builder-total-input
[10.0.2] Making `tx_builder.get_total_input()` function public
2 parents 6e87b17 + 95f04b8 commit f5563ff

File tree

9 files changed

+32
-5
lines changed

9 files changed

+32
-5
lines changed

build-and-test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
. test.sh && npm run rust:build-nodejs

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cardano-serialization-lib",
3-
"version": "10.0.1",
3+
"version": "10.0.2",
44
"description": "(De)serialization functions for the Cardano blockchain along with related utility functions",
55
"scripts": {
66
"rust:build-nodejs": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; wasm-pack pack) && npm run js:flowgen",

release.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
if [ $1 = "prod" ];
2+
then RELEASE_TYPE="prod"
3+
elif [ $1 = "beta" ];
4+
then RELEASE_TYPE="beta"
5+
else
6+
echo "First parameter is expected 'prod' or 'beta'"
7+
return 1
8+
fi
9+
10+
echo "Preparing ${RELEASE_TYPE} release"
11+
12+
. build-and-test.sh \
13+
&& npm run js:publish-nodejs:${RELEASE_TYPE} \
14+
&& npm run js:publish-browser:${RELEASE_TYPE} \
15+
&& npm run js:publish-asm:${RELEASE_TYPE} \
16+
&& (cd rust; cargo publish --allow-dirty)

rust/Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cardano-serialization-lib"
3-
version = "10.0.1"
3+
version = "10.0.2"
44
edition = "2018"
55
authors = ["EMURGO"]
66
license = "MIT"

rust/pkg/cardano_serialization_lib.js.flow

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5299,6 +5299,12 @@ declare export class TransactionBuilder {
52995299
*/
53005300
get_implicit_input(): Value;
53015301

5302+
/**
5303+
* Return explicit input plus implicit input plus mint minus burn
5304+
* @returns {Value}
5305+
*/
5306+
get_total_input(): Value;
5307+
53025308
/**
53035309
* does not include fee
53045310
* @returns {Value}

rust/src/tx_builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ impl TransactionBuilder {
949949
}).unwrap_or((Value::zero(), Value::zero()))
950950
}
951951

952-
fn get_total_input(&self) -> Result<Value, JsError> {
952+
/// Return explicit input plus implicit input plus mint minus burn
953+
pub fn get_total_input(&self) -> Result<Value, JsError> {
953954
let (mint_value, burn_value) = self.get_mint_as_values();
954955
self.get_explicit_input()?
955956
.checked_add(&self.get_implicit_input()?)?

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nvm i && npm i && npm run rust:test

0 commit comments

Comments
 (0)