Fix sent_notes.to_address column reference.
This commit is contained in:
parent
30a9c066ad
commit
fae15ce268
|
@ -78,7 +78,7 @@ struct SentNote: SentNoteEntity, Codable {
|
||||||
case outputPool = "output_pool"
|
case outputPool = "output_pool"
|
||||||
case outputIndex = "output_index"
|
case outputIndex = "output_index"
|
||||||
case account = "from_account"
|
case account = "from_account"
|
||||||
case address
|
case address = "to_address"
|
||||||
case value
|
case value
|
||||||
case memo
|
case memo
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ class SentNotesSQLDAO: SentNotesRepository {
|
||||||
// sent_notes.tx as transactionId,
|
// sent_notes.tx as transactionId,
|
||||||
// sent_notes.output_index as outputIndex,
|
// sent_notes.output_index as outputIndex,
|
||||||
// sent_notes.account as account,
|
// sent_notes.account as account,
|
||||||
// sent_notes.address as address,
|
// sent_notes.to_address as address,
|
||||||
// sent_notes.value as value,
|
// sent_notes.value as value,
|
||||||
// sent_notes.memo as memo
|
// sent_notes.memo as memo
|
||||||
// FROM sent_note JOIN transactions
|
// FROM sent_note JOIN transactions
|
||||||
|
|
|
@ -115,7 +115,7 @@ extension TransactionSQLDAO {
|
||||||
transactions.txid AS rawTransactionId,
|
transactions.txid AS rawTransactionId,
|
||||||
transactions.expiry_height AS expiryHeight,
|
transactions.expiry_height AS expiryHeight,
|
||||||
transactions.raw AS raw,
|
transactions.raw AS raw,
|
||||||
sent_notes.address AS toAddress,
|
sent_notes.to_address AS toAddress,
|
||||||
sent_notes.value AS value,
|
sent_notes.value AS value,
|
||||||
sent_notes.memo AS memo,
|
sent_notes.memo AS memo,
|
||||||
sent_notes.id_note AS noteId,
|
sent_notes.id_note AS noteId,
|
||||||
|
@ -184,7 +184,7 @@ extension TransactionSQLDAO {
|
||||||
transactions.txid AS rawTransactionId,
|
transactions.txid AS rawTransactionId,
|
||||||
transactions.expiry_height AS expiryHeight,
|
transactions.expiry_height AS expiryHeight,
|
||||||
transactions.raw AS raw,
|
transactions.raw AS raw,
|
||||||
sent_notes.address AS toAddress,
|
sent_notes.to_address AS toAddress,
|
||||||
CASE
|
CASE
|
||||||
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
||||||
ELSE received_notes.value
|
ELSE received_notes.value
|
||||||
|
@ -205,8 +205,8 @@ extension TransactionSQLDAO {
|
||||||
ON transactions.id_tx = sent_notes.tx
|
ON transactions.id_tx = sent_notes.tx
|
||||||
LEFT JOIN blocks
|
LEFT JOIN blocks
|
||||||
ON transactions.block = blocks.height
|
ON transactions.block = blocks.height
|
||||||
WHERE (sent_notes.address IS NULL AND received_notes.is_change != 1)
|
WHERE (sent_notes.to_address IS NULL AND received_notes.is_change != 1)
|
||||||
OR sent_notes.address IS NOT NULL
|
OR sent_notes.to_address IS NOT NULL
|
||||||
ORDER BY ( minedheight IS NOT NULL ),
|
ORDER BY ( minedheight IS NOT NULL ),
|
||||||
minedheight DESC,
|
minedheight DESC,
|
||||||
blocktimeinseconds DESC,
|
blocktimeinseconds DESC,
|
||||||
|
@ -231,7 +231,7 @@ extension TransactionSQLDAO {
|
||||||
transactions.txid AS rawTransactionId,
|
transactions.txid AS rawTransactionId,
|
||||||
transactions.expiry_height AS expiryHeight,
|
transactions.expiry_height AS expiryHeight,
|
||||||
transactions.raw AS raw,
|
transactions.raw AS raw,
|
||||||
sent_notes.address AS toAddress,
|
sent_notes.to_address AS toAddress,
|
||||||
CASE
|
CASE
|
||||||
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
||||||
ELSE received_notes.value
|
ELSE received_notes.value
|
||||||
|
@ -253,8 +253,8 @@ extension TransactionSQLDAO {
|
||||||
LEFT JOIN blocks
|
LEFT JOIN blocks
|
||||||
ON transactions.block = blocks.height
|
ON transactions.block = blocks.height
|
||||||
WHERE (\(fromTransaction.blockTimeInSeconds), \(fromTransaction.transactionIndex)) > (blocktimeinseconds, transactionIndex) AND
|
WHERE (\(fromTransaction.blockTimeInSeconds), \(fromTransaction.transactionIndex)) > (blocktimeinseconds, transactionIndex) AND
|
||||||
(sent_notes.address IS NULL AND received_notes.is_change != 1)
|
(sent_notes.to_address IS NULL AND received_notes.is_change != 1)
|
||||||
OR sent_notes.address IS NOT NULL
|
OR sent_notes.to_address IS NOT NULL
|
||||||
ORDER BY ( minedheight IS NOT NULL ),
|
ORDER BY ( minedheight IS NOT NULL ),
|
||||||
minedheight DESC,
|
minedheight DESC,
|
||||||
blocktimeinseconds DESC,
|
blocktimeinseconds DESC,
|
||||||
|
@ -297,7 +297,7 @@ extension TransactionSQLDAO {
|
||||||
transactions.txid AS rawTransactionId,
|
transactions.txid AS rawTransactionId,
|
||||||
transactions.expiry_height AS expiryHeight,
|
transactions.expiry_height AS expiryHeight,
|
||||||
transactions.raw AS raw,
|
transactions.raw AS raw,
|
||||||
sent_notes.address AS toAddress,
|
sent_notes.to_address AS toAddress,
|
||||||
CASE
|
CASE
|
||||||
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
||||||
ELSE received_notes.value
|
ELSE received_notes.value
|
||||||
|
@ -320,8 +320,8 @@ extension TransactionSQLDAO {
|
||||||
ON transactions.block = blocks.height
|
ON transactions.block = blocks.height
|
||||||
WHERE (\(range.start.height) <= minedheight
|
WHERE (\(range.start.height) <= minedheight
|
||||||
AND minedheight <= \(range.end.height)) AND
|
AND minedheight <= \(range.end.height)) AND
|
||||||
(sent_notes.address IS NULL AND received_notes.is_change != 1)
|
(sent_notes.to_address IS NULL AND received_notes.is_change != 1)
|
||||||
OR sent_notes.address IS NOT NULL
|
OR sent_notes.to_address IS NOT NULL
|
||||||
ORDER BY ( minedheight IS NOT NULL ),
|
ORDER BY ( minedheight IS NOT NULL ),
|
||||||
minedheight DESC,
|
minedheight DESC,
|
||||||
blocktimeinseconds DESC,
|
blocktimeinseconds DESC,
|
||||||
|
@ -342,7 +342,7 @@ extension TransactionSQLDAO {
|
||||||
transactions.txid AS rawTransactionId,
|
transactions.txid AS rawTransactionId,
|
||||||
transactions.expiry_height AS expiryHeight,
|
transactions.expiry_height AS expiryHeight,
|
||||||
transactions.raw AS raw,
|
transactions.raw AS raw,
|
||||||
sent_notes.address AS toAddress,
|
sent_notes.to_address AS toAddress,
|
||||||
CASE
|
CASE
|
||||||
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
WHEN sent_notes.value IS NOT NULL THEN sent_notes.value
|
||||||
ELSE received_notes.value
|
ELSE received_notes.value
|
||||||
|
@ -365,8 +365,8 @@ extension TransactionSQLDAO {
|
||||||
ON transactions.block = blocks.height
|
ON transactions.block = blocks.height
|
||||||
WHERE minedheight >= 0
|
WHERE minedheight >= 0
|
||||||
AND rawTransactionId == \(Blob(bytes: rawId.bytes)) AND
|
AND rawTransactionId == \(Blob(bytes: rawId.bytes)) AND
|
||||||
(sent_notes.address IS NULL AND received_notes.is_change != 1)
|
(sent_notes.to_address IS NULL AND received_notes.is_change != 1)
|
||||||
OR sent_notes.address IS NOT NULL
|
OR sent_notes.to_address IS NOT NULL
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue