Cesar Rodas 10 maanden geleden
bovenliggende
commit
a1289e8d94
2 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  1. 3 1
      client.js
  2. 2 0
      utxo/src/transaction/base_tx.rs

+ 3 - 1
client.js

@@ -99,9 +99,11 @@ async function depositAndConfirm(account, amount, asset) {
 }
 
 async function test() {
+  /* */
   await depositAndConfirm(addr1, 111512312, "BTC/8");
   await depositAndConfirm(addr2, 300512312, "USD/4");
-  let t = await trade(1, "BTC/8", addr1, 26751.11, "USD/4", addr2);
+  /* */
+  let t = await trade(0.01, "BTC/8", addr1, 26751.11, "USD/4", addr2);
   dbg(t);
   t = await change_status(t._rev, 'processing',);
   dbg(t)

+ 2 - 0
utxo/src/transaction/base_tx.rs

@@ -19,8 +19,10 @@ use std::collections::HashMap;
 /// Withdrawal transaction.
 pub struct BaseTx {
     /// List of spend payments to create this transaction
+    #[serde(skip_serializing_if = "Vec::is_empty")]
     pub spends: Vec<PaymentFrom>,
     /// New payments that are created by this transaction
+    #[serde(skip_serializing_if = "Vec::is_empty")]
     pub creates: Vec<PaymentTo>,
     /// Transaction type
     #[serde(rename = "type")]