rename tx log entry field tx_hex -> stored_tx (#2181)

This commit is contained in:
Yeastplume 2018-12-18 16:44:03 +00:00 committed by GitHub
parent 230fe191e0
commit aa9da6838b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 8 deletions

View file

@ -177,7 +177,7 @@ pub fn txs(
core::amount_to_hr_string(t.amount_debited - t.amount_credited, true) core::amount_to_hr_string(t.amount_debited - t.amount_credited, true)
) )
}; };
let tx_data = match t.tx_hex { let tx_data = match t.stored_tx {
Some(t) => format!("{}", t), Some(t) => format!("{}", t),
None => "None".to_owned(), None => "None".to_owned(),
}; };

View file

@ -102,7 +102,7 @@ where
let mut t = TxLogEntry::new(parent_key_id.clone(), TxLogEntryType::TxSent, log_id); let mut t = TxLogEntry::new(parent_key_id.clone(), TxLogEntryType::TxSent, log_id);
t.tx_slate_id = Some(slate_id); t.tx_slate_id = Some(slate_id);
let filename = format!("{}.grintx", slate_id); let filename = format!("{}.grintx", slate_id);
t.tx_hex = Some(filename); t.stored_tx = Some(filename);
t.fee = Some(fee); t.fee = Some(fee);
let mut amount_debited = 0; let mut amount_debited = 0;
t.num_inputs = lock_inputs.len(); t.num_inputs = lock_inputs.len();

View file

@ -196,7 +196,7 @@ where
return Err(ErrorKind::TransactionDoesntExist(tx_id.to_string()))?; return Err(ErrorKind::TransactionDoesntExist(tx_id.to_string()))?;
} }
let tx = tx_vec[0].clone(); let tx = tx_vec[0].clone();
Ok((tx.confirmed, tx.tx_hex)) Ok((tx.confirmed, tx.stored_tx))
} }
/// Update the stored transaction (this update needs to happen when the TX is finalised) /// Update the stored transaction (this update needs to happen when the TX is finalised)

View file

@ -600,9 +600,8 @@ pub struct TxLogEntry {
pub amount_debited: u64, pub amount_debited: u64,
/// Fee /// Fee
pub fee: Option<u64>, pub fee: Option<u64>,
// TODO: rename this to 'stored_tx_file' or something for mainnet /// Location of the store transaction, (reference or resending)
/// The transaction json itself, stored for reference or resending pub stored_tx: Option<String>,
pub tx_hex: Option<String>,
} }
impl ser::Writeable for TxLogEntry { impl ser::Writeable for TxLogEntry {
@ -634,7 +633,7 @@ impl TxLogEntry {
num_inputs: 0, num_inputs: 0,
num_outputs: 0, num_outputs: 0,
fee: None, fee: None,
tx_hex: None, stored_tx: None,
} }
} }

View file

@ -262,7 +262,7 @@ where
} }
fn get_stored_tx(&self, entry: &TxLogEntry) -> Result<Option<Transaction>, Error> { fn get_stored_tx(&self, entry: &TxLogEntry) -> Result<Option<Transaction>, Error> {
let filename = match entry.tx_hex.clone() { let filename = match entry.stored_tx.clone() {
Some(f) => f, Some(f) => f,
None => return Ok(None), None => return Ok(None),
}; };