Show contract creation on search results
This commit is contained in:
parent
dcc121ccc2
commit
b8fcc8914d
|
@ -35,7 +35,10 @@ const TransactionItem: React.FC<TransactionItemProps> = ({
|
|||
direction = Direction.SELF;
|
||||
} else if (tx.from === selectedAddress) {
|
||||
direction = Direction.OUT;
|
||||
} else if (tx.to === selectedAddress) {
|
||||
} else if (
|
||||
tx.to === selectedAddress ||
|
||||
tx.createdContractAddress === selectedAddress
|
||||
) {
|
||||
direction = Direction.IN;
|
||||
} else {
|
||||
direction = Direction.INTERNAL;
|
||||
|
@ -44,6 +47,10 @@ const TransactionItem: React.FC<TransactionItemProps> = ({
|
|||
|
||||
const ensFrom = ensCache && tx.from && ensCache[tx.from];
|
||||
const ensTo = ensCache && tx.to && ensCache[tx.to];
|
||||
const ensCreated =
|
||||
ensCache &&
|
||||
tx.createdContractAddress &&
|
||||
ensCache[tx.createdContractAddress];
|
||||
const flash = tx.gasPrice.isZero() && tx.internalMinerInteraction;
|
||||
|
||||
return (
|
||||
|
@ -89,7 +96,7 @@ const TransactionItem: React.FC<TransactionItemProps> = ({
|
|||
</span>
|
||||
<span className="col-span-2 flex items-baseline" title={tx.to}>
|
||||
<span className="truncate">
|
||||
{tx.to && (
|
||||
{tx.to ? (
|
||||
<AddressHighlighter address={tx.to}>
|
||||
<DecoratedAddressLink
|
||||
address={tx.to}
|
||||
|
@ -98,6 +105,15 @@ const TransactionItem: React.FC<TransactionItemProps> = ({
|
|||
miner={tx.miner === tx.to}
|
||||
/>
|
||||
</AddressHighlighter>
|
||||
) : (
|
||||
<AddressHighlighter address={tx.createdContractAddress!}>
|
||||
<DecoratedAddressLink
|
||||
address={tx.createdContractAddress!}
|
||||
ensName={ensCreated}
|
||||
selectedAddress={selectedAddress}
|
||||
creation
|
||||
/>
|
||||
</AddressHighlighter>
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
@ -45,6 +45,7 @@ export class SearchController {
|
|||
hash: t.hash,
|
||||
from: t.from,
|
||||
to: t.to,
|
||||
createdContractAddress: _receipt.contractAddress,
|
||||
value: t.value,
|
||||
fee: _receipt.gasUsed.mul(t.gasPrice!),
|
||||
gasPrice: t.gasPrice!,
|
||||
|
|
|
@ -16,6 +16,7 @@ export type ProcessedTransaction = {
|
|||
hash: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
createdContractAddress?: string;
|
||||
internalMinerInteraction?: boolean;
|
||||
value: BigNumber;
|
||||
fee: BigNumber;
|
||||
|
|
Loading…
Reference in New Issue