mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 06:12:55 +00:00
c84bb077fa
are gas-fee-only from transfers table. Updates #4618
24 lines
627 B
SQL
24 lines
627 B
SQL
--- Select all token transfers
|
|
WITH token_rows AS (
|
|
SELECT ROWID, *
|
|
FROM transfers
|
|
WHERE type != 'eth'
|
|
)
|
|
--- Select all 0-value transfers
|
|
, eth_zero_value_rows AS (
|
|
SELECT ROWID, *
|
|
FROM transfers
|
|
WHERE type = 'eth' AND amount_padded128hex = '00000000000000000000000000000000'
|
|
)
|
|
-- Select gas-fee-only ETH transfers
|
|
, eth_gas_fee_only_rows AS (
|
|
SELECT ROWID
|
|
FROM eth_zero_value_rows
|
|
WHERE (tx_hash, address, network_id, account_nonce) IN (
|
|
SELECT tx_hash, address, network_id, account_nonce
|
|
FROM token_rows
|
|
)
|
|
)
|
|
|
|
DELETE FROM transfers WHERE ROWID in eth_gas_fee_only_rows;
|