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

Release / 10.0.0 #358

Merged
merged 3 commits into from
Feb 6, 2022
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
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cardano-serialization-lib",
"version": "10.0.0-beta.9",
"version": "10.0.0",
"description": "(De)serialization functions for the Cardano blockchain along with related utility functions",
"scripts": {
"rust:build-nodejs": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; wasm-pack pack) && npm run js:flowgen",
Expand Down
4 changes: 1 addition & 3 deletions rust/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 rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cardano-serialization-lib"
version = "10.0.0-beta.9"
version = "10.0.0"
edition = "2018"
authors = ["EMURGO"]
license = "MIT"
Expand Down
20 changes: 10 additions & 10 deletions rust/pkg/cardano_serialization_lib.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ declare export function encode_json_str_to_native_script(
schema: number
): NativeScript;

/**
* @param {Transaction} tx
* @param {LinearFee} linear_fee
* @returns {BigNum}
*/
declare export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum;

/**
* @param {string} password
* @param {string} salt
Expand All @@ -189,13 +196,6 @@ declare export function decrypt_with_password(
data: string
): string;

/**
* @param {Transaction} tx
* @param {LinearFee} linear_fee
* @returns {BigNum}
*/
declare export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum;

/**
*/

Expand Down Expand Up @@ -5707,13 +5707,13 @@ declare export class TransactionOutputAmountBuilder {
): TransactionOutputAmountBuilder;

/**
* @param {BigNum} coins_per_utxo_word
* @param {MultiAsset} multiasset
* @param {BigNum} coins_per_utxo_word
* @returns {TransactionOutputAmountBuilder}
*/
with_asset_and_min_required_coin(
coins_per_utxo_word: BigNum,
multiasset: MultiAsset
multiasset: MultiAsset,
coins_per_utxo_word: BigNum
): TransactionOutputAmountBuilder;

/**
Expand Down
2 changes: 1 addition & 1 deletion rust/src/output_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl TransactionOutputAmountBuilder {
cfg
}

pub fn with_asset_and_min_required_coin(&self, coins_per_utxo_word: &Coin, multiasset: &MultiAsset) -> Result<TransactionOutputAmountBuilder, JsError> {
pub fn with_asset_and_min_required_coin(&self, multiasset: &MultiAsset, coins_per_utxo_word: &Coin) -> Result<TransactionOutputAmountBuilder, JsError> {
let min_possible_coin = min_pure_ada(&coins_per_utxo_word, self.data_hash.is_some())?;
let mut value = Value::new(&min_possible_coin);
value.set_multiasset(multiasset);
Expand Down
4 changes: 2 additions & 2 deletions rust/src/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ impl TransactionBuilder {
).as_positive_multiasset();

self.add_output(&output_builder
.with_asset_and_min_required_coin(&self.config.coins_per_utxo_word, &multiasset)?
.with_asset_and_min_required_coin(&multiasset, &self.config.coins_per_utxo_word)?
.build()?
)
}
Expand Down Expand Up @@ -3862,7 +3862,7 @@ mod tests {
&TransactionOutputBuilder::new()
.with_address(&address)
.next().unwrap()
.with_asset_and_min_required_coin(&tx_builder.config.coins_per_utxo_word, &multiasset).unwrap()
.with_asset_and_min_required_coin(&multiasset, &tx_builder.config.coins_per_utxo_word).unwrap()
.build().unwrap()
).unwrap();

Expand Down