-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mint::as_positive_multiasset()/as_negative_multiasset() deposit.rs (excluding internal functions - why are these public?) min_ada.rs Still missing genesis but that is more work (discussed previously)
- Loading branch information
1 parent
cd32fb6
commit f069de9
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use wasm_bindgen::prelude::{wasm_bindgen, JsError}; | ||
|
||
use crate::{ | ||
assets::{Coin, Value}, | ||
transaction::TransactionBody, | ||
}; | ||
|
||
#[wasm_bindgen] | ||
pub fn get_implicit_input( | ||
txbody: &TransactionBody, | ||
pool_deposit: Coin, // // protocol parameter | ||
key_deposit: Coin, // protocol parameter | ||
) -> Result<Value, JsError> { | ||
cml_chain::deposit::get_implicit_input(txbody.as_ref(), pool_deposit, key_deposit) | ||
.map(Into::into) | ||
.map_err(Into::into) | ||
} | ||
|
||
#[wasm_bindgen] | ||
pub fn get_deposit( | ||
txbody: &TransactionBody, | ||
pool_deposit: Coin, // // protocol parameter | ||
key_deposit: Coin, // protocol parameter | ||
) -> Result<Coin, JsError> { | ||
cml_chain::deposit::get_deposit(txbody.as_ref(), pool_deposit, key_deposit).map_err(Into::into) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use wasm_bindgen::prelude::{wasm_bindgen, JsError}; | ||
|
||
use crate::{assets::Coin, transaction::TransactionOutput}; | ||
|
||
#[wasm_bindgen] | ||
pub fn min_ada_required( | ||
output: &TransactionOutput, | ||
coins_per_utxo_byte: Coin, // protocol parameter (in lovelace) | ||
) -> Result<Coin, JsError> { | ||
cml_chain::min_ada::min_ada_required(output.as_ref(), coins_per_utxo_byte).map_err(Into::into) | ||
} |