From 086ba719a18ad7695937341880b7f2c08efdc75a Mon Sep 17 00:00:00 2001 From: GylmarGonzalez Date: Sun, 15 Dec 2024 00:37:50 -0600 Subject: [PATCH 1/3] only changed for expiry --- migration/src/m20230608_071249_init_db.rs | 2 ++ src/wallet/offline.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/migration/src/m20230608_071249_init_db.rs b/migration/src/m20230608_071249_init_db.rs index 0b628e8..872cc54 100644 --- a/migration/src/m20230608_071249_init_db.rs +++ b/migration/src/m20230608_071249_init_db.rs @@ -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(), ) @@ -473,6 +474,7 @@ pub enum BatchTransfer { CreatedAt, UpdatedAt, Expiration, + ExactExpiry, MinConfirmations, } diff --git a/src/wallet/offline.rs b/src/wallet/offline.rs index a4a6e31..9c9ba15 100644 --- a/src/wallet/offline.rs +++ b/src/wallet/offline.rs @@ -997,8 +997,12 @@ pub struct Transfer { pub receive_utxo: Option, /// Change UTXO of an outgoing transfer pub change_utxo: Option, - /// Expiration of the transfer - pub expiration: Option, + // before to branch issue37 + /// Expiration of the transfer + //pub expiration: Option, + // 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, } From b91302dd3d89fd58c41a29d1ff55ab92b726f5e7 Mon Sep 17 00:00:00 2001 From: GylmarGonzalez Date: Sun, 15 Dec 2024 00:43:50 -0600 Subject: [PATCH 2/3] modify the from_db_transfer --- src/wallet/offline.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wallet/offline.rs b/src/wallet/offline.rs index 9c9ba15..6296e9f 100644 --- a/src/wallet/offline.rs +++ b/src/wallet/offline.rs @@ -1028,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, } } From f34963e880b4e4a83e4b277c8638127be8de3ac4 Mon Sep 17 00:00:00 2001 From: GylmarGonzalez Date: Mon, 16 Dec 2024 14:22:31 -0600 Subject: [PATCH 3/3] modify the file src/database/entities/batch_transfer.rs --- src/database/entities/batch_transfer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/database/entities/batch_transfer.rs b/src/database/entities/batch_transfer.rs index 2967703..fa39ada 100644 --- a/src/database/entities/batch_transfer.rs +++ b/src/database/entities/batch_transfer.rs @@ -21,6 +21,7 @@ pub struct Model { pub created_at: i64, pub updated_at: i64, pub expiration: Option, + pub exact_expiry: Option, pub min_confirmations: u8, } @@ -32,6 +33,7 @@ pub enum Column { CreatedAt, UpdatedAt, Expiration, + ExactExpiry, MinConfirmations, } @@ -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(), } }