mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
rename tx log entry field tx_hex -> stored_tx (#2181)
This commit is contained in:
parent
230fe191e0
commit
aa9da6838b
5 changed files with 7 additions and 8 deletions
|
@ -177,7 +177,7 @@ pub fn txs(
|
|||
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),
|
||||
None => "None".to_owned(),
|
||||
};
|
||||
|
|
|
@ -102,7 +102,7 @@ where
|
|||
let mut t = TxLogEntry::new(parent_key_id.clone(), TxLogEntryType::TxSent, log_id);
|
||||
t.tx_slate_id = Some(slate_id);
|
||||
let filename = format!("{}.grintx", slate_id);
|
||||
t.tx_hex = Some(filename);
|
||||
t.stored_tx = Some(filename);
|
||||
t.fee = Some(fee);
|
||||
let mut amount_debited = 0;
|
||||
t.num_inputs = lock_inputs.len();
|
||||
|
|
|
@ -196,7 +196,7 @@ where
|
|||
return Err(ErrorKind::TransactionDoesntExist(tx_id.to_string()))?;
|
||||
}
|
||||
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)
|
||||
|
|
|
@ -600,9 +600,8 @@ pub struct TxLogEntry {
|
|||
pub amount_debited: u64,
|
||||
/// Fee
|
||||
pub fee: Option<u64>,
|
||||
// TODO: rename this to 'stored_tx_file' or something for mainnet
|
||||
/// The transaction json itself, stored for reference or resending
|
||||
pub tx_hex: Option<String>,
|
||||
/// Location of the store transaction, (reference or resending)
|
||||
pub stored_tx: Option<String>,
|
||||
}
|
||||
|
||||
impl ser::Writeable for TxLogEntry {
|
||||
|
@ -634,7 +633,7 @@ impl TxLogEntry {
|
|||
num_inputs: 0,
|
||||
num_outputs: 0,
|
||||
fee: None,
|
||||
tx_hex: None,
|
||||
stored_tx: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ where
|
|||
}
|
||||
|
||||
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,
|
||||
None => return Ok(None),
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue