Skip to content

Commit a7807db

Browse files
committed
code rabbit
1 parent 50bc979 commit a7807db

File tree

4 files changed

+4
-42
lines changed

4 files changed

+4
-42
lines changed

applications/minotari_app_grpc/proto/base_node.proto

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,3 @@ message PaymentReferenceResponse {
593593
optional uint64 revealed_amount = 9;
594594
}
595595

596-
597-
// Status of payment reference lookup
598-
enum PaymentReferenceStatus {
599-
// Payment reference was found and confirmed
600-
FOUND = 0;
601-
// Payment reference was not found in the blockchain
602-
NOT_FOUND = 1;
603-
// Payment reference format is invalid
604-
INVALID_FORMAT = 2;
605-
// Payment reference is in mempool (unconfirmed)
606-
PENDING = 3;
607-
}
608-

applications/minotari_app_grpc/proto/wallet.proto

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,15 +1580,3 @@ enum PaymentDirection {
15801580
// Payment sent from this wallet
15811581
PAYMENT_DIRECTION_OUTBOUND = 2;
15821582
}
1583-
1584-
// Enum for PayRef status indicating availability
1585-
enum PayRefStatus {
1586-
// Unknown or unspecified status
1587-
PAYREF_STATUS_UNKNOWN = 0;
1588-
// PayRef is available (has sufficient confirmations)
1589-
PAYREF_STATUS_AVAILABLE = 1;
1590-
// PayRef is pending (waiting for more confirmations)
1591-
PAYREF_STATUS_PENDING = 2;
1592-
// PayRef is not mined (transaction not yet in a block)
1593-
PAYREF_STATUS_NOT_MINED = 3;
1594-
}

base_layer/wallet/src/transaction_service/payment_reference.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ pub enum PayRefDisplayFormat {
6969
Custom { prefix_chars: u8, suffix_chars: u8 },
7070
}
7171

72-
/// Status of a Payment Reference
73-
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
74-
pub enum PayRefStatus {
75-
/// PayRef is available with the specified number of confirmations
76-
Available(FixedHash, u64),
77-
/// PayRef is pending more confirmations
78-
Pending(u64, u64), // current_confirmations, blocks_remaining
79-
/// Output has not been mined yet
80-
NotMined,
81-
/// Output data is invalid for PayRef generation
82-
InvalidOutput,
83-
}
84-
8572
/// Direction of a payment
8673
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8774
pub enum PaymentDirection {

base_layer/wallet/src/transaction_service/storage/sqlite_db.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ impl TransactionBackend for TransactionServiceSqliteDatabase {
11681168
let mut conn = self.database_connection.get_pooled_connection()?;
11691169
let cipher = acquire_read_lock!(self.cipher);
11701170

1171-
let payref = PayrefSql::find_by_output_hash(&payref.to_vec(), &mut conn)?;
1171+
let payref = PayrefSql::find_by_payref(&payref.to_vec(), &mut conn)?;
11721172
if payref.is_none() {
11731173
return Ok(None);
11741174
}
@@ -2474,12 +2474,12 @@ impl PayrefSql {
24742474
Ok(())
24752475
}
24762476

2477-
pub fn find_by_output_hash(
2478-
output_hash: &[u8],
2477+
pub fn find_by_payref(
2478+
payref: &[u8],
24792479
conn: &mut SqliteConnection,
24802480
) -> Result<Option<PayrefSql>, TransactionStorageError> {
24812481
let result = payrefs::table
2482-
.filter(payrefs::output_hash.eq(output_hash))
2482+
.filter(payrefs::payref.eq(payref))
24832483
.first::<PayrefSql>(conn)
24842484
.optional()?;
24852485
Ok(result)

0 commit comments

Comments
 (0)