mirror of
https://github.com/FlipsideCrypto/optimism-models.git
synced 2026-02-06 13:26:44 +00:00
An 4316/shapella upgrade (#230)
* new api fields - silver * withdrawals
This commit is contained in:
parent
b41c435646
commit
a7244b523e
@ -122,7 +122,9 @@ SELECT
|
||||
d.modified_timestamp,
|
||||
'2000-01-01'
|
||||
)
|
||||
) AS modified_timestamp
|
||||
) AS modified_timestamp,
|
||||
withdrawals,
|
||||
withdrawals_root
|
||||
FROM
|
||||
{{ ref('silver__blocks') }} A
|
||||
LEFT JOIN {{ ref('silver__state_hashes') }}
|
||||
|
||||
@ -53,4 +53,8 @@ models:
|
||||
- name: INSERTED_TIMESTAMP
|
||||
description: '{{ doc("inserted_timestamp") }}'
|
||||
- name: MODIFIED_TIMESTAMP
|
||||
description: '{{ doc("modified_timestamp") }}'
|
||||
description: '{{ doc("modified_timestamp") }}'
|
||||
- name: WITHDRAWALS
|
||||
description: An array of withdrawals that occurred in this block.
|
||||
- name: WITHDRAWALS_ROOT
|
||||
description: A hash of the withdrawals that occurred in this block.
|
||||
@ -67,7 +67,9 @@ SELECT
|
||||
GREATEST(COALESCE(A.modified_timestamp, '2000-01-01'), COALESCE(b.modified_timestamp, '2000-01-01'), COALESCE(C.modified_timestamp, '2000-01-01')) AS modified_timestamp,
|
||||
VALUE AS eth_value,
|
||||
value_precise_raw AS eth_value_precise_raw,
|
||||
value_precise AS eth_value_precise
|
||||
value_precise AS eth_value_precise,
|
||||
deposit_nonce,
|
||||
deposit_receipt_version
|
||||
FROM
|
||||
{{ ref('silver__transactions') }} A
|
||||
LEFT JOIN {{ ref('silver__state_hashes') }}
|
||||
|
||||
@ -87,4 +87,8 @@ models:
|
||||
- name: INSERTED_TIMESTAMP
|
||||
description: '{{ doc("inserted_timestamp") }}'
|
||||
- name: MODIFIED_TIMESTAMP
|
||||
description: '{{ doc("modified_timestamp") }}'
|
||||
description: '{{ doc("modified_timestamp") }}'
|
||||
- name: DEPOSIT_NONCE
|
||||
description: The nonce of the deposit transaction.
|
||||
- name: DEPOSIT_RECEIPT_VERSION
|
||||
description: The version of the deposit receipt.
|
||||
@ -48,6 +48,8 @@ SELECT
|
||||
) :: INT AS total_difficulty,
|
||||
DATA :transactionsRoot :: STRING AS transactions_root,
|
||||
DATA :uncles AS uncles,
|
||||
DATA :result :withdrawals AS withdrawals,
|
||||
DATA :result :withdrawalsRoot :: STRING AS withdrawals_root,
|
||||
_inserted_timestamp,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['block_number']
|
||||
|
||||
@ -109,7 +109,13 @@ FINAL AS (
|
||||
utils.udf_hex_to_int(
|
||||
DATA :type :: STRING
|
||||
) :: INT AS TYPE,
|
||||
_inserted_timestamp
|
||||
_inserted_timestamp,
|
||||
utils.udf_hex_to_int(
|
||||
DATA :depositNonce :: STRING
|
||||
) :: INT AS deposit_nonce,
|
||||
utils.udf_hex_to_int(
|
||||
DATA: depositReceiptVersion :: STRING
|
||||
) :: INT AS deposit_receipt_version
|
||||
FROM
|
||||
base
|
||||
)
|
||||
|
||||
@ -172,7 +172,9 @@ new_records AS (
|
||||
effective_gas_price,
|
||||
r.type AS tx_type,
|
||||
t._inserted_timestamp,
|
||||
t.data
|
||||
t.data,
|
||||
r.deposit_nonce,
|
||||
r.deposit_receipt_version
|
||||
FROM
|
||||
base_tx t
|
||||
LEFT OUTER JOIN {{ ref('silver__blocks') }}
|
||||
@ -248,7 +250,9 @@ missing_data AS (
|
||||
b._inserted_timestamp,
|
||||
r._inserted_timestamp
|
||||
) AS _inserted_timestamp,
|
||||
t.data
|
||||
t.data,
|
||||
r.deposit_nonce,
|
||||
r.deposit_receipt_version
|
||||
FROM
|
||||
{{ this }}
|
||||
t
|
||||
@ -311,7 +315,9 @@ FINAL AS (
|
||||
tx_fee_precise,
|
||||
tx_type,
|
||||
_inserted_timestamp,
|
||||
DATA
|
||||
DATA,
|
||||
deposit_nonce,
|
||||
deposit_receipt_version
|
||||
FROM
|
||||
new_records
|
||||
|
||||
@ -354,7 +360,9 @@ SELECT
|
||||
tx_fee_precise_heal AS tx_fee_precise,
|
||||
tx_type,
|
||||
_inserted_timestamp,
|
||||
DATA
|
||||
DATA,
|
||||
deposit_nonce,
|
||||
deposit_receipt_version
|
||||
FROM
|
||||
missing_data
|
||||
{% endif %}
|
||||
@ -421,7 +429,9 @@ SELECT
|
||||
) }} AS transactions_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
'{{ invocation_id }}' AS _invocation_id
|
||||
'{{ invocation_id }}' AS _invocation_id,
|
||||
deposit_nonce,
|
||||
deposit_receipt_version
|
||||
FROM
|
||||
FINAL
|
||||
WHERE
|
||||
|
||||
Loading…
Reference in New Issue
Block a user