Final Owner API Changes (#32)

* node height return value and documentation

* rustfmt

* add parameter struct for initiate tx functions

* rustfmt

* change tx estimate to use InitTxArgs

* rustfmt

* transaction estimate

* rustfmt

* initiate tx args fixed

* add send args to init

* rustfmt

* last owner api documentation
This commit is contained in:
Yeastplume
2019-03-29 16:00:02 +00:00
committed by GitHub
parent 7b8fe92f53
commit 427f42c552
16 changed files with 698 additions and 632 deletions
+11 -10
View File
@@ -23,7 +23,7 @@ use crate::keychain;
use crate::libwallet;
use crate::libwallet::api_impl::{foreign, owner};
use crate::libwallet::types::{
BlockFees, CbData, NodeClient, WalletBackend, WalletInfo, WalletInst,
BlockFees, CbData, InitTxArgs, NodeClient, WalletBackend, WalletInfo, WalletInst,
};
use crate::lmdb_wallet::LMDBBackend;
use crate::util;
@@ -196,15 +196,16 @@ where
let slate = {
let mut w = wallet.lock();
w.open_with_credentials()?;
let slate_i = owner::initiate_tx(
&mut *w, None, // account
amount, // amount
2, // minimum confirmations
500, // max outputs
1, // num change outputs
true, // select all outputs
None, None, test_mode,
)?;
let args = InitTxArgs {
src_acct_name: None,
amount,
minimum_confirmations: 2,
max_outputs: 500,
num_change_outputs: 1,
selection_strategy_is_use_all: true,
..Default::default()
};
let slate_i = owner::initiate_tx(&mut *w, args, test_mode)?;
let slate = client.send_tx_slate_direct(dest, &slate_i)?;
owner::tx_lock_outputs(&mut *w, &slate)?;
let slate = owner::finalize_tx(&mut *w, &slate)?;