Skip to content

Commit

Permalink
Add confirmed clause to receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Feb 9, 2021
1 parent fe70d48 commit f364c28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/lib/storage/src/chain/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ impl<'a, 'c> BlockSchema<'a, 'c> {
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
,aggr_exec as (
SELECT
Expand All @@ -290,6 +291,7 @@ impl<'a, 'c> BlockSchema<'a, 'c> {
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
SELECT
blocks.number AS "block_number!",
Expand Down Expand Up @@ -389,6 +391,7 @@ impl<'a, 'c> BlockSchema<'a, 'c> {
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
,aggr_exec as (
SELECT
Expand All @@ -399,6 +402,7 @@ impl<'a, 'c> BlockSchema<'a, 'c> {
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
SELECT
blocks.number AS "block_number!",
Expand Down
11 changes: 11 additions & 0 deletions core/lib/storage/src/chain/operations_ext/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
execute_aggregated_blocks_binding.block_number
FROM aggregate_operations
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
WHERE aggregate_operations.confirmed = true
),
transactions AS (
SELECT
Expand Down Expand Up @@ -544,12 +545,14 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
commit_aggregated_blocks_binding.block_number
FROM aggregate_operations
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
WHERE aggregate_operations.confirmed = true
), aggr_exec AS (
SELECT
aggregate_operations.confirmed,
execute_aggregated_blocks_binding.block_number
FROM aggregate_operations
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
WHERE aggregate_operations.confirmed = true
), transactions as (
select
*
Expand Down Expand Up @@ -704,6 +707,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
, aggr_exec as (
SELECT
Expand All @@ -714,6 +718,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
SELECT
blocks.number AS details_block_number,
Expand Down Expand Up @@ -768,6 +773,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
, aggr_exec as (
SELECT
Expand All @@ -778,6 +784,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
SELECT
blocks.number AS details_block_number,
Expand Down Expand Up @@ -861,6 +868,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
, aggr_exec as (
SELECT
Expand All @@ -871,6 +879,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
SELECT
blocks.number AS details_block_number,
Expand Down Expand Up @@ -923,6 +932,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN commit_aggregated_blocks_binding ON aggregate_operations.id = commit_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
, aggr_exec as (
SELECT
Expand All @@ -933,6 +943,7 @@ impl<'a, 'c> OperationsExtSchema<'a, 'c> {
INNER JOIN execute_aggregated_blocks_binding ON aggregate_operations.id = execute_aggregated_blocks_binding.op_id
INNER JOIN eth_aggregated_ops_binding ON aggregate_operations.id = eth_aggregated_ops_binding.op_id
INNER JOIN eth_operations ON eth_operations.id = eth_aggregated_ops_binding.eth_op_id
WHERE aggregate_operations.confirmed = true
)
SELECT
blocks.number AS details_block_number,
Expand Down

0 comments on commit f364c28

Please sign in to comment.