Remove deprecated parameters

This commit is contained in:
Willian Mitsuda 2021-11-07 09:21:02 -03:00
parent 00ecea2c54
commit 43f0ba0f8d
6 changed files with 3 additions and 35 deletions

View File

@ -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<DetailsProps> = ({
<DecodedParamsTable
args={resolvedTxDesc.args}
paramTypes={resolvedTxDesc.functionFragment.inputs}
txContext={toTransactionContext(txData)}
hasParamNames={resolvedTxDesc === txDesc}
userMethod={userMethod}
devMethod={devMethod}

View File

@ -7,7 +7,7 @@ import Copy from "../components/Copy";
import ModeTab from "../components/ModeTab";
import DecodedParamsTable from "./decoder/DecodedParamsTable";
import DecodedLogSignature from "./decoder/DecodedLogSignature";
import { toTransactionContext, TransactionData } from "../types";
import { TransactionData } from "../types";
import { useTopic0 } from "../useTopic0";
import { ResolvedAddresses } from "../api/address-resolver";
@ -106,7 +106,6 @@ const LogEntry: React.FC<LogEntryProps> = ({
<DecodedParamsTable
args={resolvedLogDesc.args}
paramTypes={resolvedLogDesc.eventFragment.inputs}
txContext={toTransactionContext(txData)}
hasParamNames={resolvedLogDesc === logDesc}
resolvedAddresses={resolvedAddresses}
/>

View File

@ -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<TraceInputProps> = ({
<DecodedParamsTable
args={fourBytesTxDesc.args}
paramTypes={fourBytesTxDesc.functionFragment.inputs}
txContext={toTransactionContext(txData)}
hasParamNames={false}
resolvedAddresses={resolvedAddresses}
/>

View File

@ -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<DecodedParamRowProps> = ({
i,
r,
paramType,
txContext,
arrayElem,
help,
resolvedAddresses,
@ -105,7 +102,6 @@ const DecodedParamRow: React.FC<DecodedParamRowProps> = ({
i={idx}
r={e}
paramType={paramType.components[idx]}
txContext={txContext}
/>
))}
{paramType.baseType === "array" &&
@ -115,7 +111,6 @@ const DecodedParamRow: React.FC<DecodedParamRowProps> = ({
prefix={paramType.name ?? <span className="italic">param_{i}</span>}
r={e}
paramType={paramType.arrayChildren}
txContext={txContext}
arrayElem={idx}
/>
))}

View File

@ -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<DecodedParamsTableProps> = ({
args,
paramTypes,
txContext,
hasParamNames = true,
devMethod,
resolvedAddresses,
@ -49,7 +46,6 @@ const DecodedParamsTable: React.FC<DecodedParamsTableProps> = ({
i={i}
r={r}
paramType={paramTypes[i]}
txContext={txContext}
help={devMethod?.params?.[paramTypes[i].name]}
resolvedAddresses={resolvedAddresses}
/>

View File

@ -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";