Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions migration/src/m20230608_071249_init_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl MigrationTrait for Migration {
.col(big_unsigned(BatchTransfer::CreatedAt))
.col(big_unsigned(BatchTransfer::UpdatedAt))
.col(big_unsigned_null(BatchTransfer::Expiration))
.col(boolean_null(BatchTransfer::ExactExpiry))
.col(tiny_unsigned(BatchTransfer::MinConfirmations))
.to_owned(),
)
Expand Down Expand Up @@ -473,6 +474,7 @@ pub enum BatchTransfer {
CreatedAt,
UpdatedAt,
Expiration,
ExactExpiry,
MinConfirmations,
}

Expand Down
3 changes: 3 additions & 0 deletions src/database/entities/batch_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct Model {
pub created_at: i64,
pub updated_at: i64,
pub expiration: Option<i64>,
pub exact_expiry: Option<bool>,
pub min_confirmations: u8,
}

Expand All @@ -32,6 +33,7 @@ pub enum Column {
CreatedAt,
UpdatedAt,
Expiration,
ExactExpiry,
MinConfirmations,
}

Expand Down Expand Up @@ -62,6 +64,7 @@ impl ColumnTrait for Column {
Self::CreatedAt => ColumnType::BigInteger.def(),
Self::UpdatedAt => ColumnType::BigInteger.def(),
Self::Expiration => ColumnType::BigInteger.def().null(),
Self::ExactExpiry => ColumnType::Boolean.def().null(),
Self::MinConfirmations => ColumnType::SmallInteger.def(),
}
}
Expand Down
13 changes: 10 additions & 3 deletions src/wallet/offline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,12 @@ pub struct Transfer {
pub receive_utxo: Option<Outpoint>,
/// Change UTXO of an outgoing transfer
pub change_utxo: Option<Outpoint>,
/// Expiration of the transfer
pub expiration: Option<i64>,
// before to branch issue37
/// Expiration of the transfer
//pub expiration: Option<i64>,
// after to branch issue37
/// Expiration of the transfer and whether it should be exact
pub expiration: Option<(i64, bool)>,
/// Transport endpoints for the transfer
pub transport_endpoints: Vec<TransferTransportEndpoint>,
}
Expand All @@ -1024,7 +1028,10 @@ impl Transfer {
recipient_id: x.recipient_id.clone(),
receive_utxo: td.receive_utxo,
change_utxo: td.change_utxo,
expiration: td.expiration,
// before to branch issue37
//expiration: td.expiration,
// after to branch issue37
expiration: td.expiration.map(|e| Some((e, td.exact_expiry.unwrap()))),
transport_endpoints,
}
}
Expand Down