Skip to content

Commit

Permalink
Fix txHash
Browse files Browse the repository at this point in the history
  • Loading branch information
VegeBun-csj committed Jul 30, 2024
1 parent cf8c5a6 commit 9e008e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VITE_TRADE_URL=
VITE_DOCS_URL=https://docs.dorafactory.org/docs
VITE_MINTSCAN_URL=
VITE_ETHERSCAN_URL=https://sepolia.etherscan.io
VITE_DORA_EXPLORER_URL=https://vota-sf-explorer.dorafactory.org/
VITE_DORA_EXPLORER_URL=https://vota-sf-explorer.dorafactory.org/vota-sf

VITE_ALCHEMY_API_KEY=
VITE_INFURA_API_KEY=
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const truncateAddress = (address?: string, prefix: string = 'dora') => {
export const truncateTransactionHash = (address?: string, prefix: string = '') => {
if (!address) return '';
const hash = address.replace(prefix, '');
const firstHalf = hash.slice(0, 4);
const secondHalf = hash.slice(-4);
const firstHalf = hash.slice(0, 8);
const secondHalf = hash.slice(-8);
return `${prefix}${firstHalf}...${secondHalf}`;
};

Expand Down
4 changes: 2 additions & 2 deletions src/views/PendingMigrationsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ const getPendingMigrationsTableColumnDef = ({
{txHash === defaultTransactionHash ? (
"0x000000.....000000"
) : (
<Link href={`${import.meta.env.VITE_DORA_EXPLORER_URL}/tx/${txHash}`} withIcon>
{truncateTransactionHash(txHash.valueOf())}
<Link href={`${import.meta.env.VITE_DORA_EXPLORER_URL}/tx/${txHash.startsWith('0x') ? txHash.slice(2) : txHash}`} withIcon>
{truncateTransactionHash((txHash.startsWith('0x') ? txHash.slice(2) : txHash).valueOf())}
</Link>
)}
</TableCell>
Expand Down

0 comments on commit 9e008e9

Please sign in to comment.