Skip to content

Commit

Permalink
Adding back txo_id_hex to undo breaking change (#651)
Browse files Browse the repository at this point in the history
keeping txo_id
  • Loading branch information
briancorbin authored Jan 3, 2023
1 parent 47a76e3 commit 1b66d63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion full-service/src/json_rpc/v2/models/transaction_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl TransactionLog {
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
pub struct InputTxo {
pub txo_id: String,

pub txo_id_hex: String,
/// Amount of this Txo
pub amount: Amount,
}
Expand All @@ -117,6 +117,7 @@ impl InputTxo {
pub fn new(txo: &db::models::Txo) -> Self {
Self {
txo_id: txo.id.clone(),
txo_id_hex: txo.id.clone(),
amount: Amount::from(&txo.amount()),
}
}
Expand All @@ -126,6 +127,8 @@ impl InputTxo {
pub struct OutputTxo {
pub txo_id: String,

pub txo_id_hex: String,

pub public_key: String,

pub amount: Amount,
Expand All @@ -137,6 +140,7 @@ impl OutputTxo {
pub fn new(txo: &db::models::Txo, recipient_public_address_b58: String) -> Self {
Self {
txo_id: txo.id.clone(),
txo_id_hex: txo.id.clone(),
public_key: hex::encode(txo.public_key().unwrap().as_bytes()),
amount: Amount::from(&txo.amount()),
recipient_public_address_b58,
Expand Down

0 comments on commit 1b66d63

Please sign in to comment.