You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/domains/src/inputs/queryable.rs
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ use crate::queryable::{HasPagination, QueryPagination, Queryable};
11
11
pubenumInputs{
12
12
#[iden = "inputs"]
13
13
Table,
14
+
#[iden = "id"]
15
+
Id,
14
16
#[iden = "subject"]
15
17
Subject,
16
18
#[iden = "value"]
@@ -94,7 +96,7 @@ impl Queryable for InputsQuery {
94
96
}
95
97
96
98
fnpagination_column() -> Self::PaginationColumn{
97
-
Inputs::BlockHeight
99
+
Inputs::Id
98
100
}
99
101
100
102
fnpagination(&self) -> &QueryPagination{
@@ -284,7 +286,7 @@ mod test {
284
286
285
287
assert_eq!(
286
288
coin_query.query_to_string(),
287
-
format!("SELECT * FROM \"inputs\" WHERE \"input_type\" = 'coin' AND \"owner_id\" = '{}' AND \"asset_id\" = '{}' ORDER BY \"block_height\" ASC LIMIT {}",
289
+
format!("SELECT * FROM \"inputs\" WHERE \"input_type\" = 'coin' AND \"owner_id\" = '{}' AND \"asset_id\" = '{}' ORDER BY \"id\" ASC LIMIT {}",
288
290
TEST_OWNER_ID,TEST_ASSET_ID,FIRST_POINTER)
289
291
);
290
292
@@ -307,7 +309,7 @@ mod test {
307
309
308
310
assert_eq!(
309
311
contract_query.query_to_string(),
310
-
format!("SELECT * FROM \"inputs\" WHERE \"input_type\" = 'contract' AND \"contract_id\" = '{}' AND \"block_height\" > {} ORDER BY \"block_height\" DESC LIMIT {}",
312
+
format!("SELECT * FROM \"inputs\" WHERE \"input_type\" = 'contract' AND \"contract_id\" = '{}' AND \"id\" > {} ORDER BY \"id\" DESC LIMIT {}",
311
313
TEST_CONTRACT_ID,AFTER_POINTER,LAST_POINTER)
312
314
);
313
315
@@ -330,7 +332,7 @@ mod test {
330
332
331
333
assert_eq!(
332
334
message_query.query_to_string(),
333
-
format!("SELECT * FROM \"inputs\" WHERE \"input_type\" = 'message' AND \"sender_address\" = '{}' AND \"recipient_address\" = '{}' AND \"block_height\" < {} ORDER BY \"block_height\" ASC LIMIT {}",
335
+
format!("SELECT * FROM \"inputs\" WHERE \"input_type\" = 'message' AND \"sender_address\" = '{}' AND \"recipient_address\" = '{}' AND \"id\" < {} ORDER BY \"id\" ASC LIMIT {}",
Copy file name to clipboardExpand all lines: crates/domains/src/outputs/queryable.rs
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ use crate::queryable::{HasPagination, QueryPagination, Queryable};
11
11
pubenumOutputs{
12
12
#[iden = "outputs"]
13
13
Table,
14
+
#[iden = "id"]
15
+
Id,
14
16
#[iden = "subject"]
15
17
Subject,
16
18
#[iden = "value"]
@@ -88,7 +90,7 @@ impl Queryable for OutputsQuery {
88
90
}
89
91
90
92
fnpagination_column() -> Self::PaginationColumn{
91
-
Outputs::BlockHeight
93
+
Outputs::Id
92
94
}
93
95
94
96
fnpagination(&self) -> &QueryPagination{
@@ -252,7 +254,7 @@ mod test {
252
254
253
255
assert_eq!(
254
256
coin_query.query_to_string(),
255
-
format!("SELECT * FROM \"outputs\" WHERE \"output_type\" = 'coin' AND \"to_address\" = '{}' AND \"asset_id\" = '{}' ORDER BY \"block_height\" ASC LIMIT {}",
257
+
format!("SELECT * FROM \"outputs\" WHERE \"output_type\" = 'coin' AND \"to_address\" = '{}' AND \"asset_id\" = '{}' ORDER BY \"id\" ASC LIMIT {}",
256
258
TEST_ADDRESS,TEST_ASSET_ID,FIRST_POINTER)
257
259
);
258
260
@@ -273,7 +275,7 @@ mod test {
273
275
274
276
assert_eq!(
275
277
contract_query.query_to_string(),
276
-
format!("SELECT * FROM \"outputs\" WHERE \"output_type\" = 'contract' AND \"contract_id\" = '{}' AND \"block_height\" > {} ORDER BY \"block_height\" DESC LIMIT {}",
278
+
format!("SELECT * FROM \"outputs\" WHERE \"output_type\" = 'contract' AND \"contract_id\" = '{}' AND \"id\" > {} ORDER BY \"id\" DESC LIMIT {}",
277
279
TEST_CONTRACT_ID,AFTER_POINTER,LAST_POINTER)
278
280
);
279
281
@@ -294,7 +296,7 @@ mod test {
294
296
295
297
assert_eq!(
296
298
change_query.query_to_string(),
297
-
format!("SELECT * FROM \"outputs\" WHERE \"output_type\" = 'change' AND \"to_address\" = '{}' AND \"asset_id\" = '{}' AND \"block_height\" < {} ORDER BY \"block_height\" ASC LIMIT {}",
299
+
format!("SELECT * FROM \"outputs\" WHERE \"output_type\" = 'change' AND \"to_address\" = '{}' AND \"asset_id\" = '{}' AND \"id\" < {} ORDER BY \"id\" ASC LIMIT {}",
Copy file name to clipboardExpand all lines: crates/domains/src/receipts/queryable.rs
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ use crate::queryable::{HasPagination, QueryPagination, Queryable};
11
11
pubenumReceipts{
12
12
#[iden = "receipts"]
13
13
Table,
14
+
#[iden = "id"]
15
+
Id,
14
16
#[iden = "subject"]
15
17
Subject,
16
18
#[iden = "value"]
@@ -99,7 +101,7 @@ impl Queryable for ReceiptsQuery {
99
101
}
100
102
101
103
fnpagination_column() -> Self::PaginationColumn{
102
-
Receipts::BlockHeight
104
+
Receipts::Id
103
105
}
104
106
105
107
fnpagination(&self) -> &QueryPagination{
@@ -320,7 +322,7 @@ mod test {
320
322
321
323
assert_eq!(
322
324
contract_query.query_to_string(),
323
-
format!("SELECT * FROM \"receipts\" WHERE \"from_contract_id\" = '{}' AND \"to_contract_id\" = '{}' ORDER BY \"block_height\" ASC LIMIT {}",
325
+
format!("SELECT * FROM \"receipts\" WHERE \"from_contract_id\" = '{}' AND \"to_contract_id\" = '{}' ORDER BY \"id\" ASC LIMIT {}",
324
326
TEST_CONTRACT_ID,TEST_CONTRACT_ID,FIRST_POINTER)
325
327
);
326
328
@@ -345,7 +347,7 @@ mod test {
345
347
346
348
assert_eq!(
347
349
asset_query.query_to_string(),
348
-
format!("SELECT * FROM \"receipts\" WHERE \"asset_id\" = '{}' AND \"block_height\" > {} ORDER BY \"block_height\" DESC LIMIT {}",
350
+
format!("SELECT * FROM \"receipts\" WHERE \"asset_id\" = '{}' AND \"id\" > {} ORDER BY \"id\" DESC LIMIT {}",
349
351
TEST_ASSET_ID,AFTER_POINTER,LAST_POINTER)
350
352
);
351
353
@@ -370,7 +372,7 @@ mod test {
370
372
371
373
assert_eq!(
372
374
address_query.query_to_string(),
373
-
format!("SELECT * FROM \"receipts\" WHERE \"sender_address\" = '{}' AND \"recipient_address\" = '{}' AND \"block_height\" < {} ORDER BY \"block_height\" ASC LIMIT {}",
375
+
format!("SELECT * FROM \"receipts\" WHERE \"sender_address\" = '{}' AND \"recipient_address\" = '{}' AND \"id\" < {} ORDER BY \"id\" ASC LIMIT {}",
Copy file name to clipboardExpand all lines: crates/domains/src/transactions/queryable.rs
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ use crate::queryable::{HasPagination, QueryPagination, Queryable};
11
11
pubenumTransactions{
12
12
#[iden = "transactions"]
13
13
Table,
14
+
#[iden = "id"]
15
+
Id,
14
16
#[iden = "subject"]
15
17
Subject,
16
18
#[iden = "value"]
@@ -73,7 +75,7 @@ impl Queryable for TransactionsQuery {
73
75
}
74
76
75
77
fnpagination_column() -> Self::PaginationColumn{
76
-
Transactions::BlockHeight
78
+
Transactions::Id
77
79
}
78
80
79
81
fnpagination(&self) -> &QueryPagination{
@@ -178,7 +180,7 @@ mod test {
178
180
179
181
assert_eq!(
180
182
type_query.query_to_string(),
181
-
format!("SELECT * FROM \"transactions\" WHERE \"tx_index\" = {} AND \"type\" = 'script' ORDER BY \"block_height\" ASC LIMIT {}",
183
+
format!("SELECT * FROM \"transactions\" WHERE \"tx_index\" = {} AND \"type\" = 'script' ORDER BY \"id\" ASC LIMIT {}",
182
184
TEST_TX_INDEX,FIRST_POINTER)
183
185
);
184
186
@@ -197,7 +199,7 @@ mod test {
197
199
198
200
assert_eq!(
199
201
range_query.query_to_string(),
200
-
format!("SELECT * FROM \"transactions\" WHERE \"block_height\" = {} AND \"block_height\" > {} ORDER BY \"block_height\" DESC LIMIT {}",
202
+
format!("SELECT * FROM \"transactions\" WHERE \"block_height\" = {} AND \"id\" > {} ORDER BY \"id\" DESC LIMIT {}",
201
203
TEST_BLOCK_HEIGHT,AFTER_POINTER,LAST_POINTER)
202
204
);
203
205
@@ -216,7 +218,7 @@ mod test {
216
218
217
219
assert_eq!(
218
220
status_type_query.query_to_string(),
219
-
format!("SELECT * FROM \"transactions\" WHERE \"type\" = 'create' AND \"tx_status\" = 'failed' AND \"block_height\" < {} ORDER BY \"block_height\" ASC LIMIT {}",
221
+
format!("SELECT * FROM \"transactions\" WHERE \"type\" = 'create' AND \"tx_status\" = 'failed' AND \"id\" < {} ORDER BY \"id\" ASC LIMIT {}",
format!("SELECT * FROM \"utxos\" WHERE \"utxo_id\" = '{}' ORDER BY \"block_height\" ASC LIMIT {}",
232
+
format!("SELECT * FROM \"utxos\" WHERE \"utxo_id\" = '{}' ORDER BY \"id\" ASC LIMIT {}",
230
233
TEST_UTXO_ID,FIRST_POINTER)
231
234
);
232
235
@@ -246,7 +249,7 @@ mod test {
246
249
247
250
assert_eq!(
248
251
indices_query.query_to_string(),
249
-
format!("SELECT * FROM \"utxos\" WHERE \"tx_id\" = '{}' AND \"tx_index\" = {} AND \"input_index\" = {} AND \"block_height\" > {} ORDER BY \"block_height\" DESC LIMIT {}",
252
+
format!("SELECT * FROM \"utxos\" WHERE \"tx_id\" = '{}' AND \"tx_index\" = {} AND \"input_index\" = {} AND \"id\" > {} ORDER BY \"id\" DESC LIMIT {}",
format!("SELECT * FROM \"utxos\" WHERE \"utxo_type\" = 'message' AND \"block_height\" < {} ORDER BY \"block_height\" ASC LIMIT {}",
272
+
format!("SELECT * FROM \"utxos\" WHERE \"utxo_type\" = 'message' AND \"id\" < {} ORDER BY \"id\" ASC LIMIT {}",
270
273
BEFORE_POINTER,FIRST_POINTER)
271
274
);
272
275
@@ -291,7 +294,7 @@ mod test {
291
294
292
295
assert_eq!(
293
296
complex_query.query_to_string(),
294
-
format!("SELECT * FROM \"utxos\" WHERE \"block_height\" = {} AND \"tx_id\" = '{}' AND \"tx_index\" = {} AND \"input_index\" = {} AND \"utxo_type\" = 'contract' AND \"utxo_id\" = '{}' AND \"block_height\" > {} AND \"block_height\" < {} ORDER BY \"block_height\" ASC LIMIT {}",
297
+
format!("SELECT * FROM \"utxos\" WHERE \"block_height\" = {} AND \"tx_id\" = '{}' AND \"tx_index\" = {} AND \"input_index\" = {} AND \"utxo_type\" = 'contract' AND \"utxo_id\" = '{}' AND \"id\" > {} AND \"id\" < {} ORDER BY \"id\" ASC LIMIT {}",
0 commit comments