Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the new field Expiry. #55

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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 @@ -995,10 +995,14 @@
pub recipient_id: Option<String>,
/// UTXO of an incoming transfer
pub receive_utxo: Option<Outpoint>,
/// Change UTXO of an outgoing transfer

Check warning on line 998 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/rgb-lib/rgb-lib/src/wallet/offline.rs
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 @@ -1021,10 +1025,13 @@
.expect("DB should contain a valid u64 value"),
kind: td.kind,
txid: td.txid,
recipient_id: x.recipient_id.clone(),

Check warning on line 1028 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/rgb-lib/rgb-lib/src/wallet/offline.rs
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()))),

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / lint

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_feature_electrum (linux)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_feature_esplora (linux)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (1.77.0, linux)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_feature_electrum (macos)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (stable, macos)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (stable, linux)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (1.77.0, macos)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_no_default_features (linux)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / test_and_coverage

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / test_features

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_no_default_features (macos)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (stable, windows)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (1.77.0, windows)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (nightly, linux)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (nightly, macos)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_feature_esplora (macos)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_feature_electrum (windows)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_no_default_features (windows)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_feature_esplora (windows)

no field `exact_expiry` on type `database::TransferData`

Check failure on line 1034 in src/wallet/offline.rs

View workflow job for this annotation

GitHub Actions / build_all_features (nightly, windows)

no field `exact_expiry` on type `database::TransferData`
transport_endpoints,
}
}
Expand Down
Loading