Skip to content

Commit

Permalink
remove last tx hash from ibc clients table
Browse files Browse the repository at this point in the history
  • Loading branch information
ejmg committed Jul 15, 2024
1 parent c72cebf commit 762c018
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
16 changes: 4 additions & 12 deletions src/app/api/ibc/clients/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export async function GET(req: NextRequest) {
SELECT
clients.client_id as "client_id!",
clients.block_id as "block_id!",
hashes.created_at as "last_updated_at!",
hashes.tx_hash as "hash!",
last_updated.created_at as "last_updated_at!",
update_attrs.max_value as "consensus_height"
-- Useful for aggregating other event data if that is desired later.
-- array_agg(array[update_attrs.key, update_attrs.value]) as "events!"
Expand All @@ -29,25 +28,18 @@ export async function GET(req: NextRequest) {
ea.composite_key='create_client.client_id'
ORDER BY client_id, ea.block_id DESC
) clients LEFT JOIN LATERAL (
SELECT MAX(ea.value) as "max_value", ea.tx_id
SELECT MAX(ea.value) as "max_value"
FROM event_attributes ea
WHERE
ea.block_id=clients.block_id
AND
ea.key='consensus_height'
GROUP BY ea.tx_id
) update_attrs ON true LEFT JOIN LATERAL (
-- NOTE: null check probably no longer needed since both create_client and update_client indices are now in clients
SELECT tx.tx_hash, tx.created_at
SELECT tx.created_at
FROM tx_results tx
WHERE
tx.rowid=update_attrs.tx_id
OR
update_attrs.tx_id IS NULL
AND
tx.rowid=clients.tx_id
LIMIT 1
) hashes ON true
) last_updated ON true
ORDER BY clients.block_id DESC
LIMIT $pageLimit! OFFSET $pageOffset!
;`;
Expand Down
1 change: 0 additions & 1 deletion src/app/api/ibc/clients/route.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export interface IGetClientsResult {
block_id: bigint;
client_id: string;
consensus_height: string | null;
hash: string;
last_updated_at: Date;
}

Expand Down
1 change: 0 additions & 1 deletion src/components/ibc/clients/ClientsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const ClientsTable : FC<ClientsTableProps> = ({className, queryName, defa
client_id: string,
block_id: bigint,
last_updated_at: string,
hash: string,
consensus_height: string | null
}>,
pages: number
Expand Down
9 changes: 0 additions & 9 deletions src/components/ibc/clients/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export interface ClientsColumns {
client_id: string,
last_updated_at: string,
block_id: bigint,
hash: string,
consensus_height: string | null,
};

Expand Down Expand Up @@ -37,14 +36,6 @@ export const columns : Array<ColumnDef<ClientsColumns>> = [
return <pre className="text-sm break-all">{timestamp}</pre>;
},
},
{
accessorKey: "hash",
header: () => <div className="text-sm">Transaction Hash</div>,
cell: ({ getValue }) => {
const hash = getValue() as string;
return <Link href={`/transaction/${hash}`} className="text-link text-sm"><pre className="sm:max-w-full max-w-[45px] overflow-hidden overflow-ellipsis">{hash}</pre></Link>;
},
},
{
accessorKey: "consensus_height",
header: () => <div className="text-sm">Last Consensus Height</div>,
Expand Down

0 comments on commit 762c018

Please sign in to comment.