Skip to content

Commit

Permalink
Merge pull request #1399 from edenia/fix/recreate-wrong-migration
Browse files Browse the repository at this point in the history
fix(hasura): regenerate migration to get a partial ATH
  • Loading branch information
xavier506 committed Dec 4, 2023
2 parents 1b8c78d + 89d8e7c commit 2bf75d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- DROP VIEW IF EXISTS "evm"."stats";
-- CREATE OR REPLACE VIEW "evm"."stats" AS
-- SELECT COALESCE(evm_block.avg_gas_used, (0)::numeric) AS block_gas_avg,
-- COALESCE(daily_transactions.total_transaction_count, (0)::bigint) AS daily_transaction_count,
-- partial_ath.blocks AS ath_blocks,
-- COALESCE((partial_ath.max_transaction_sum)::numeric, (0)::numeric) AS ath_transactions_count,
-- COALESCE(partial_ath.gas_used_sum, (0)::numeric) AS ath_gas_used
-- COALESCE(partial_ath.gas_used_sum, (0)::numeric) AS ath_gas_used,
-- partial_ath.blocks AS ath_blocks
-- FROM ((( SELECT avg(subquery_alias.gas_used) AS avg_gas_used
-- FROM ( SELECT block.gas_used,
-- block."timestamp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
DROP VIEW IF EXISTS "evm"."stats";
CREATE OR REPLACE VIEW "evm"."stats" AS
SELECT COALESCE(evm_block.avg_gas_used, (0)::numeric) AS block_gas_avg,
COALESCE(daily_transactions.total_transaction_count, (0)::bigint) AS daily_transaction_count,
partial_ath.blocks AS ath_blocks,
COALESCE((partial_ath.max_transaction_sum)::numeric, (0)::numeric) AS ath_transactions_count,
COALESCE(partial_ath.gas_used_sum, (0)::numeric) AS ath_gas_used
COALESCE(partial_ath.gas_used_sum, (0)::numeric) AS ath_gas_used,
partial_ath.blocks AS ath_blocks
FROM ((( SELECT avg(subquery_alias.gas_used) AS avg_gas_used
FROM ( SELECT block.gas_used,
block."timestamp"
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/routes/EVMDashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const EVMDashboard = () => {
loading={loading}
>
<BodyGraphValue
links={EVMStats?.tps_all_time_high?.blocks.map(block =>
links={(EVMStats?.tps_all_time_high?.blocks || []).map(block =>
getEVMBlockNumUrl(block),
)}
/>
Expand Down

0 comments on commit 2bf75d3

Please sign in to comment.