From 43f0ba0f8d6bcb5cf6773d11d5f4647d70d016d6 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sun, 7 Nov 2021 09:21:02 -0300 Subject: [PATCH] Remove deprecated parameters --- src/transaction/Details.tsx | 7 +------ src/transaction/LogEntry.tsx | 3 +-- src/transaction/TraceInput.tsx | 3 +-- src/transaction/decoder/DecodedParamRow.tsx | 5 ----- src/transaction/decoder/DecodedParamsTable.tsx | 4 ---- src/types.ts | 16 ---------------- 6 files changed, 3 insertions(+), 35 deletions(-) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 51b8a63..8cf46f1 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -24,11 +24,7 @@ import USDValue from "../components/USDValue"; import FormattedBalance from "../components/FormattedBalance"; import ETH2USDValue from "../components/ETH2USDValue"; import TokenTransferItem from "../TokenTransferItem"; -import { - TransactionData, - InternalOperation, - toTransactionContext, -} from "../types"; +import { TransactionData, InternalOperation } from "../types"; import PercentageBar from "../components/PercentageBar"; import ExternalLink from "../components/ExternalLink"; import RelativePosition from "../components/RelativePosition"; @@ -353,7 +349,6 @@ const Details: React.FC = ({ = ({ diff --git a/src/transaction/TraceInput.tsx b/src/transaction/TraceInput.tsx index 603e619..367a51c 100644 --- a/src/transaction/TraceInput.tsx +++ b/src/transaction/TraceInput.tsx @@ -6,7 +6,7 @@ import FormattedBalance from "../components/FormattedBalance"; import FunctionSignature from "./FunctionSignature"; import DecodedParamsTable from "./decoder/DecodedParamsTable"; import { TraceEntry } from "../useErigonHooks"; -import { toTransactionContext, TransactionData } from "../types"; +import { TransactionData } from "../types"; import { ResolvedAddresses } from "../api/address-resolver"; import { extract4Bytes, @@ -87,7 +87,6 @@ const TraceInput: React.FC = ({ diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index eb31b91..9bd64b6 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -8,7 +8,6 @@ import Uint256Decoder from "./Uint256Decoder"; import AddressDecoder from "./AddressDecoder"; import BooleanDecoder from "./BooleanDecoder"; import BytesDecoder from "./BytesDecoder"; -import { SelectedTransactionContext } from "../../types"; import { ResolvedAddresses } from "../../api/address-resolver"; type DecodedParamRowProps = { @@ -16,7 +15,6 @@ type DecodedParamRowProps = { i?: number | undefined; r: any; paramType: ParamType; - txContext: SelectedTransactionContext; arrayElem?: number | undefined; help?: string | undefined; resolvedAddresses?: ResolvedAddresses | undefined; @@ -27,7 +25,6 @@ const DecodedParamRow: React.FC = ({ i, r, paramType, - txContext, arrayElem, help, resolvedAddresses, @@ -105,7 +102,6 @@ const DecodedParamRow: React.FC = ({ i={idx} r={e} paramType={paramType.components[idx]} - txContext={txContext} /> ))} {paramType.baseType === "array" && @@ -115,7 +111,6 @@ const DecodedParamRow: React.FC = ({ prefix={paramType.name ?? param_{i}} r={e} paramType={paramType.arrayChildren} - txContext={txContext} arrayElem={idx} /> ))} diff --git a/src/transaction/decoder/DecodedParamsTable.tsx b/src/transaction/decoder/DecodedParamsTable.tsx index 136b169..376eee2 100644 --- a/src/transaction/decoder/DecodedParamsTable.tsx +++ b/src/transaction/decoder/DecodedParamsTable.tsx @@ -1,14 +1,12 @@ import React from "react"; import { ParamType, Result } from "@ethersproject/abi"; import DecodedParamRow from "./DecodedParamRow"; -import { SelectedTransactionContext } from "../../types"; import { DevMethod, UserMethod } from "../../useSourcify"; import { ResolvedAddresses } from "../../api/address-resolver"; type DecodedParamsTableProps = { args: Result; paramTypes: ParamType[]; - txContext: SelectedTransactionContext; hasParamNames?: boolean; userMethod?: UserMethod | undefined; devMethod?: DevMethod | undefined; @@ -18,7 +16,6 @@ type DecodedParamsTableProps = { const DecodedParamsTable: React.FC = ({ args, paramTypes, - txContext, hasParamNames = true, devMethod, resolvedAddresses, @@ -49,7 +46,6 @@ const DecodedParamsTable: React.FC = ({ i={i} r={r} paramType={paramTypes[i]} - txContext={txContext} help={devMethod?.params?.[paramTypes[i].name]} resolvedAddresses={resolvedAddresses} /> diff --git a/src/types.ts b/src/types.ts index 947aa51..f54f94a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -64,22 +64,6 @@ export type ConfirmedTransactionData = { logs: Log[]; }; -export type SelectedTransactionContext = { - from: string; - to: string | undefined; - miner: string | undefined; -}; - -export const toTransactionContext = ( - txData: TransactionData -): SelectedTransactionContext => { - return { - from: txData.from, - to: txData.to, - miner: txData.confirmedData?.miner, - }; -}; - // The VOID... export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";