mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-12-22 19:49:24 +00:00
make sweep_all tx_hash_list optional
This commit is contained in:
parent
352f2f5abe
commit
588e45d2bf
2 changed files with 5 additions and 5 deletions
|
@ -340,10 +340,11 @@ pub async fn upload_delivery_info(
|
|||
// get draft payment txset
|
||||
let wallet_password = utils::empty_string();
|
||||
monero::open_wallet(&orid, &wallet_password).await;
|
||||
let mut sweep: reqres::XmrRpcSweepAllResponse =
|
||||
monero::refresh().await;
|
||||
let sweep: reqres::XmrRpcSweepAllResponse =
|
||||
monero::sweep_all(String::from(&lookup.subaddress)).await;
|
||||
monero::close_wallet(&orid, &wallet_password).await;
|
||||
if sweep.result.tx_hash_list.is_empty() {
|
||||
if sweep.result.multisig_txset.is_empty() {
|
||||
error!("unable to create draft txset");
|
||||
return Default::default();
|
||||
}
|
||||
|
@ -351,7 +352,6 @@ pub async fn upload_delivery_info(
|
|||
let mut m_order: Order = find(orid);
|
||||
m_order.status = StatusType::Shipped.value();
|
||||
m_order.ship_date = chrono::offset::Utc::now().timestamp();
|
||||
m_order.hash = String::from(&sweep.result.tx_hash_list.remove(0));
|
||||
m_order.vend_msig_txset = sweep.result.multisig_txset;
|
||||
// delivery info will be stored encrypted and separate from the rest of the
|
||||
// order
|
||||
|
|
|
@ -526,7 +526,7 @@ pub struct XmrRpcSweepAllResult {
|
|||
pub fee_list: Vec<u128>,
|
||||
pub multisig_txset: String,
|
||||
pub spent_key_images_list: Vec<KeyImageList>,
|
||||
pub tx_hash_list: Vec<String>,
|
||||
pub tx_hash_list: Option<Vec<String>>,
|
||||
pub unsigned_txset: String,
|
||||
pub weight_list: Vec<u128>,
|
||||
}
|
||||
|
@ -1097,7 +1097,7 @@ impl Default for XmrRpcSweepAllResponse {
|
|||
fee_list: Vec::new(),
|
||||
multisig_txset: utils::empty_string(),
|
||||
spent_key_images_list: Vec::new(),
|
||||
tx_hash_list: Vec::new(),
|
||||
tx_hash_list: Some(Vec::new()),
|
||||
unsigned_txset: utils::empty_string(),
|
||||
weight_list: Vec::new(),
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue