Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/1234.bugfix.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
api: Fix charged fee for oasis encoded eth txs
4 changes: 4 additions & 0 deletions .changelog/1234.bugfix.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix consensus related events edgecase

The query did not include the event type in the join, which could result
in wrong events showing up as related events.
6 changes: 4 additions & 2 deletions storage/client/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const (
LEFT JOIN chain.blocks b ON tx_block = b.height
LEFT JOIN chain.events_related_accounts rel ON
chain.events.tx_block = rel.tx_block AND
chain.events.type = rel.type AND
chain.events.event_index = rel.event_index AND
-- When related_address ($5) is NULL and hence we do no filtering on it, avoid the join altogether.
($5::text IS NOT NULL)
Expand Down Expand Up @@ -601,8 +602,9 @@ const (
txs.gas_limit,
txs.gas_used,
CASE
WHEN txs.tx_eth_hash IS NULL THEN txs.fee
ELSE COALESCE(FLOOR(txs.fee / NULLIF(txs.gas_limit, 0)) * txs.gas_used, 0)
WHEN txs.method IN ('evm.Call', 'evm.Create') OR txs.tx_eth_hash IS NOT NULL
THEN COALESCE(FLOOR(txs.fee / NULLIF(txs.gas_limit, 0)) * txs.gas_used, 0)
ELSE txs.fee
END AS charged_fee,
txs.size,
txs.raw_result,
Expand Down
Loading