diff --git a/.changeset/fluffy-eagles-deliver.md b/.changeset/fluffy-eagles-deliver.md new file mode 100644 index 000000000..68f235d8f --- /dev/null +++ b/.changeset/fluffy-eagles-deliver.md @@ -0,0 +1,5 @@ +--- +"@blobscan/web": patch +--- + +Improved decoding display for Optimism blobs; removed truncated Parent L2 block hash link, fixed L1 origin block redirection, and corrected timestamp. diff --git a/apps/web/src/pages/tx/[hash].tsx b/apps/web/src/pages/tx/[hash].tsx index fa7866831..e4ed1090c 100644 --- a/apps/web/src/pages/tx/[hash].tsx +++ b/apps/web/src/pages/tx/[hash].tsx @@ -2,7 +2,6 @@ import { useMemo } from "react"; import type { NextPage } from "next"; import { useRouter } from "next/router"; -import { parseDecodedData } from "~/utils/decoded-transaction"; import { RollupBadge } from "~/components/Badges/RollupBadge"; import { Card } from "~/components/Cards/Card"; import { BlobCard } from "~/components/Cards/SurfaceCards/BlobCard"; @@ -230,9 +229,9 @@ const Tx: NextPage = () => { } const decodedData = - rawTxData && rawTxData.decodedFields - ? parseDecodedData(rawTxData.decodedFields) - : null; + rawTxData?.decodedFields?.type === "optimism" + ? rawTxData.decodedFields.payload + : undefined; return ( <> @@ -265,7 +264,14 @@ const Tx: NextPage = () => { name: "Timestamp since L2 genesis", value: (
- {formatTimestamp(decodedData.timestampSinceL2Genesis)} + {tx + ? formatTimestamp( + tx.blockTimestamp.subtract( + decodedData.timestampSinceL2Genesis, + "ms" + ) + ) + : ""}
), }, @@ -277,19 +283,7 @@ const Tx: NextPage = () => { name: "Parent L2 block hash", value: (
- - {"0x" + decodedData.parentL2BlockHash} - - + {"0x" + decodedData.parentL2BlockHash + "..."}
), }, diff --git a/apps/web/src/utils/decoded-transaction.tsx b/packages/api/src/blob-parse/optimism.ts similarity index 56% rename from apps/web/src/utils/decoded-transaction.tsx rename to packages/api/src/blob-parse/optimism.ts index 9e12fb6ca..faec3f729 100644 --- a/apps/web/src/utils/decoded-transaction.tsx +++ b/packages/api/src/blob-parse/optimism.ts @@ -1,5 +1,9 @@ import { z } from "zod"; +import { logger } from "@blobscan/logger"; + +import { autocompleteBlockHash } from "../utils/autocompleteBlockHash"; + export const OptimismDecodedDataSchema = z.object({ timestampSinceL2Genesis: z.number(), lastL1OriginNumber: z.number(), @@ -13,7 +17,9 @@ export const OptimismDecodedDataSchema = z.object({ type OptimismDecodedData = z.infer; -export function parseDecodedData(data: string): OptimismDecodedData | null { +export async function parseOptimismDecodedData( + data: string +): Promise { let json; try { @@ -28,5 +34,15 @@ export function parseDecodedData(data: string): OptimismDecodedData | null { return null; } + const hash = await autocompleteBlockHash(decoded.data.l1OriginBlockHash); + + if (hash) { + decoded.data.l1OriginBlockHash = hash; + } else { + logger.error( + `Failed to get full block hash for L1 origin block hash: ${decoded.data.l1OriginBlockHash}` + ); + } + return decoded.data; } diff --git a/packages/api/src/blob-parse/parse-decoded-fields.ts b/packages/api/src/blob-parse/parse-decoded-fields.ts new file mode 100644 index 000000000..8d76527b4 --- /dev/null +++ b/packages/api/src/blob-parse/parse-decoded-fields.ts @@ -0,0 +1,36 @@ +import { z } from "zod"; + +import { + parseOptimismDecodedData, + OptimismDecodedDataSchema, +} from "./optimism"; + +const OptimismSchema = z.object({ + type: z.literal("optimism"), + payload: OptimismDecodedDataSchema, +}); + +const UnknownSchema = z.object({ + type: z.literal("unknown"), + payload: z.string(), +}); + +export const decodedFields = z.union([OptimismSchema, UnknownSchema]); + +type DecodedFields = z.infer; + +export async function parseDecodedFields(data: string): Promise { + const optimismDecodedData = await parseOptimismDecodedData(data); + + if (optimismDecodedData) { + return { + type: "optimism", + payload: optimismDecodedData, + }; + } + + return { + type: "unknown", + payload: data, + }; +} diff --git a/packages/api/src/routers/tx/common/serializers.ts b/packages/api/src/routers/tx/common/serializers.ts index 513ab25b6..63ee2b31a 100644 --- a/packages/api/src/routers/tx/common/serializers.ts +++ b/packages/api/src/routers/tx/common/serializers.ts @@ -1,5 +1,9 @@ import { z } from "@blobscan/zod"; +import { + decodedFields, + parseDecodedFields, +} from "../../../blob-parse/parse-decoded-fields"; import { serializeExpandedBlobData, serializeExpandedBlock, @@ -42,7 +46,7 @@ const baseSerializedTransactionFieldsSchema = z.object({ .merge(serializedExpandedBlobDataSchema) ), block: serializedExpandedBlockSchema.optional(), - decodedFields: z.string().optional(), + decodedFields: decodedFields.optional(), }); export const serializedTransactionSchema = @@ -121,15 +125,18 @@ export function serializeBaseTransactionFields( }; } -export function serializeTransaction( +export async function serializeTransaction( txQuery: FullQueriedTransaction -): SerializedTransaction { - const serializedBaseTx = serializeBaseTransactionFields(txQuery); +): Promise { + const serializedBaseTx = await serializeBaseTransactionFields(txQuery); const serializedAdditionalTx = serializeDerivedTxBlobGasFields(txQuery); + const decodedFieldsString = JSON.stringify(txQuery.decodedFields); + const decodedFields = await parseDecodedFields(decodedFieldsString); + return { ...serializedBaseTx, ...serializedAdditionalTx, - decodedFields: JSON.stringify(txQuery.decodedFields), + decodedFields, }; } diff --git a/packages/api/src/routers/tx/getAll.ts b/packages/api/src/routers/tx/getAll.ts index 3a5920314..d733537f0 100644 --- a/packages/api/src/routers/tx/getAll.ts +++ b/packages/api/src/routers/tx/getAll.ts @@ -89,10 +89,12 @@ export const getAll = publicProcedure countOp, ]); + const transactions = await Promise.all( + queriedTxs.map(addDerivedFieldsToTransaction).map(serializeTransaction) + ); + return { - transactions: queriedTxs - .map(addDerivedFieldsToTransaction) - .map(serializeTransaction), + transactions, ...(count ? { totalTransactions: txCountOrStats } : {}), }; }); diff --git a/packages/api/src/utils/autocompleteBlockHash.ts b/packages/api/src/utils/autocompleteBlockHash.ts new file mode 100644 index 000000000..a9e5929d6 --- /dev/null +++ b/packages/api/src/utils/autocompleteBlockHash.ts @@ -0,0 +1,29 @@ +import { prisma } from "@blobscan/db"; +import { logger } from "@blobscan/logger"; + +/* Autocomplete a block hash from a truncated version of it. + @param partialHash - The first bytes of a block hash. + @returns The block hash, if there is a single ocurrence, or null. + */ +export async function autocompleteBlockHash(partialHash: string) { + const blocks = await prisma.block.findMany({ + where: { + hash: { + startsWith: partialHash, + }, + }, + select: { + hash: true, + }, + }); + + if (blocks[0] === undefined) { + return null; + } + + if (blocks.length > 1) { + logger.error(`Multiple blocks found for hash ${partialHash}`); + } + + return blocks[0].hash; +} diff --git a/packages/api/test/__snapshots__/tx.test.ts.snap b/packages/api/test/__snapshots__/tx.test.ts.snap index 2486e1f9d..64326136b 100644 --- a/packages/api/test/__snapshots__/tx.test.ts.snap +++ b/packages/api/test/__snapshots__/tx.test.ts.snap @@ -34,7 +34,10 @@ exports[`Transaction router > getAll > when getting expanded transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -108,7 +111,10 @@ exports[`Transaction router > getAll > when getting expanded transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -144,7 +150,10 @@ exports[`Transaction router > getAll > when getting expanded transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -183,7 +192,10 @@ exports[`Transaction router > getAll > when getting expanded transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -232,7 +244,10 @@ exports[`Transaction router > getAll > when getting expanded transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -310,7 +325,10 @@ exports[`Transaction router > getAll > when getting expanded transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -350,7 +368,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1002, "blockTimestamp": "2023-05-10T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "baseAddress", "hash": "txHash004", "index": 0, @@ -381,7 +402,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash003", "index": 2, @@ -408,7 +432,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address3", "hash": "txHash002", "index": 1, @@ -443,7 +470,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -475,7 +505,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -510,7 +543,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -537,7 +573,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1006, "blockTimestamp": "2023-08-31T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address5", "hash": "0x5be77167b05f39ea8950f11b0da2bdfec6e04055030068b051ac5a43aaf251e9", "index": 0, @@ -577,7 +616,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -604,7 +646,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address3", "hash": "txHash002", "index": 1, @@ -635,7 +680,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash003", "index": 2, @@ -675,7 +723,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -710,7 +761,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1005, "blockTimestamp": "2023-08-28T10:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash012", "index": 0, @@ -737,7 +791,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash007", "index": 0, @@ -768,7 +825,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash003", "index": 2, @@ -800,7 +860,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T15:50:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "0xd80214f2e7c7271114f372b6a8baaf39bcb364448788f6d8229d2a903edf9272", "index": 0, @@ -832,7 +895,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1006, "blockTimestamp": "2023-08-31T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address5", "hash": "0x5be77167b05f39ea8950f11b0da2bdfec6e04055030068b051ac5a43aaf251e9", "index": 0, @@ -859,7 +925,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1005, "blockTimestamp": "2023-08-28T10:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address5", "hash": "txHash013", "index": 1, @@ -894,7 +963,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1005, "blockTimestamp": "2023-08-28T10:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash012", "index": 0, @@ -921,7 +993,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "baseAddress", "hash": "txHash011", "index": 4, @@ -948,7 +1023,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address3", "hash": "txHash010", "index": 3, @@ -975,7 +1053,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address5", "hash": "txHash009", "index": 2, @@ -1002,7 +1083,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "arbitrumAddress", "hash": "txHash008", "index": 1, @@ -1029,7 +1113,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash007", "index": 0, @@ -1061,7 +1148,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "baseAddress", "hash": "txHash011", "index": 4, @@ -1088,7 +1178,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address3", "hash": "txHash010", "index": 3, @@ -1115,7 +1208,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address5", "hash": "txHash009", "index": 2, @@ -1142,7 +1238,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "arbitrumAddress", "hash": "txHash008", "index": 1, @@ -1169,7 +1268,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash007", "index": 0, @@ -1204,7 +1306,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1003, "blockTimestamp": "2023-08-03T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash006", "index": 1, @@ -1239,7 +1344,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1003, "blockTimestamp": "2023-08-03T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash005", "index": 0, @@ -1271,7 +1379,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash007", "index": 0, @@ -1306,7 +1417,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -1346,7 +1460,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -1378,7 +1495,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash007", "index": 0, @@ -1413,7 +1533,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -1453,7 +1576,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1002, "blockTimestamp": "2023-05-10T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "baseAddress", "hash": "txHash004", "index": 0, @@ -1484,7 +1610,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash003", "index": 2, @@ -1511,7 +1640,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address3", "hash": "txHash002", "index": 1, @@ -1546,7 +1678,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -1582,7 +1717,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash003", "index": 2, @@ -1609,7 +1747,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address3", "hash": "txHash002", "index": 1, @@ -1644,7 +1785,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -1676,7 +1820,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -1711,7 +1858,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -1743,7 +1893,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -1778,7 +1931,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -1805,7 +1961,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1006, "blockTimestamp": "2023-08-31T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address5", "hash": "0x5be77167b05f39ea8950f11b0da2bdfec6e04055030068b051ac5a43aaf251e9", "index": 0, @@ -1837,7 +1996,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -1872,7 +2034,10 @@ exports[`Transaction router > getAll > when getting filtered transaction results "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -1904,7 +2069,10 @@ exports[`Transaction router > getAll > when getting paginated transaction result "blockNumber": 1008, "blockTimestamp": "2023-08-31T16:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address2", "hash": "txHash016", "index": 0, @@ -1939,7 +2107,10 @@ exports[`Transaction router > getAll > when getting paginated transaction result "blockNumber": 1007, "blockTimestamp": "2023-08-31T14:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash015", "index": 0, @@ -1979,7 +2150,10 @@ exports[`Transaction router > getAll > when getting paginated transaction result "blockNumber": 1005, "blockTimestamp": "2023-08-28T10:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "optimismAddress", "hash": "txHash012", "index": 0, @@ -2006,7 +2180,10 @@ exports[`Transaction router > getAll > when getting paginated transaction result "blockNumber": 1004, "blockTimestamp": "2023-08-20T12:00:00.000Z", "category": "rollup", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "baseAddress", "hash": "txHash011", "index": 4, @@ -2049,7 +2226,10 @@ exports[`Transaction router > getByHash > should get a transaction by hash corre "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -2122,7 +2302,10 @@ exports[`Transaction router > getByHash > when getting expanded transaction resu "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -2198,7 +2381,10 @@ exports[`Transaction router > getByHash > when getting expanded transaction resu "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -2240,7 +2426,10 @@ exports[`Transaction router > getByHash > when getting expanded transaction resu "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0, @@ -2320,7 +2509,10 @@ exports[`Transaction router > getByHash > when getting expanded transaction resu "blockNumber": 1001, "blockTimestamp": "2022-10-16T12:00:00.000Z", "category": "other", - "decodedFields": "{}", + "decodedFields": { + "payload": "{}", + "type": "unknown", + }, "from": "address1", "hash": "txHash001", "index": 0,