From 1ac2679fadfd4937722517466fbeb51aa41150fd Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 18 Sep 2021 16:10:47 -0300 Subject: [PATCH] Add semantic highlight to address input/log params --- src/transaction/DecodedInput.tsx | 25 ++++++++++++++++++++++--- src/transaction/DecodedLog.tsx | 25 ++++++++++++++++++++++--- src/transaction/Details.tsx | 2 +- src/transaction/LogEntry.tsx | 2 +- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/transaction/DecodedInput.tsx b/src/transaction/DecodedInput.tsx index f4c5c97..9764c8f 100644 --- a/src/transaction/DecodedInput.tsx +++ b/src/transaction/DecodedInput.tsx @@ -1,12 +1,17 @@ import React from "react"; import { TransactionDescription } from "@ethersproject/abi"; +import AddressHighlighter from "../components/AddressHighlighter"; +import DecoratedAddressLink from "../components/DecoratedAddressLink"; +import Copy from "../components/Copy"; +import { TransactionData } from "../types"; type DecodedInputProps = { + txData: TransactionData; txDesc: TransactionDescription; }; -const DecodedInput: React.FC = ({ txDesc }) => ( - +const DecodedInput: React.FC = ({ txData, txDesc }) => ( +
))} diff --git a/src/transaction/DecodedLog.tsx b/src/transaction/DecodedLog.tsx index 9f7a0d1..c4a904f 100644 --- a/src/transaction/DecodedLog.tsx +++ b/src/transaction/DecodedLog.tsx @@ -1,12 +1,17 @@ import React from "react"; import { LogDescription } from "@ethersproject/abi"; +import AddressHighlighter from "../components/AddressHighlighter"; +import DecoratedAddressLink from "../components/DecoratedAddressLink"; +import Copy from "../components/Copy"; +import { TransactionData } from "../types"; type DecodedLogProps = { + txData: TransactionData; logDesc: LogDescription; }; -const DecodedLog: React.FC = ({ logDesc }) => ( -
@@ -27,7 +32,21 @@ const DecodedInput: React.FC = ({ txDesc }) => ( {txDesc.functionFragment.inputs[i].type} - {r.toString()} + {txDesc.functionFragment.inputs[i].type === "address" ? ( +
+ + + + +
+ ) : ( + r.toString() + )}
+const DecodedLog: React.FC = ({ txData, logDesc }) => ( +
))} diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index f3e5721..9328e41 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -327,7 +327,7 @@ const Details: React.FC = ({ ) : txDesc === null ? ( <>No decoded data ) : ( - + )} diff --git a/src/transaction/LogEntry.tsx b/src/transaction/LogEntry.tsx index 3d8312b..7e78ff7 100644 --- a/src/transaction/LogEntry.tsx +++ b/src/transaction/LogEntry.tsx @@ -53,7 +53,7 @@ const LogEntry: React.FC = ({ txData, log, logDesc }) => (
Name
- +
@@ -25,7 +30,21 @@ const DecodedLog: React.FC = ({ logDesc }) => ( {logDesc.eventFragment.inputs[i].type} - {r.toString()} + {logDesc.eventFragment.inputs[i].type === "address" ? ( +
+ + + + +
+ ) : ( + r.toString() + )}