From 13b7bb515b3baf2f5435ec6eb7deae127d0b1b9e Mon Sep 17 00:00:00 2001 From: ponyjackal Date: Mon, 4 Mar 2024 08:53:50 -0800 Subject: [PATCH] feat: rename hasCryptopunksTransfer --- .../ethereum/assetTransfersCryptopunks.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/transformers/ethereum/assetTransfersCryptopunks.ts b/src/transformers/ethereum/assetTransfersCryptopunks.ts index d0f90d4..91031c4 100644 --- a/src/transformers/ethereum/assetTransfersCryptopunks.ts +++ b/src/transformers/ethereum/assetTransfersCryptopunks.ts @@ -17,7 +17,7 @@ const TRANSFER_SIGNATURES = { }; function updateTokenTransfers(tx: RawTransaction) { - const oldNFTsTransfers: AssetTransfer[] = []; + const cryptopunksTransfers: AssetTransfer[] = []; for (const log of tx.receipt.logs) { if (!CRYPTO_PUNKS_ADDRESSES.includes(log.address)) { @@ -28,7 +28,7 @@ function updateTokenTransfers(tx: RawTransaction) { switch (signature) { case TRANSFER_SIGNATURES.CRYPTO_PUNKS_ERC721: - oldNFTsTransfers.push({ + cryptopunksTransfers.push({ asset: log.address, from: decodeEVMAddress(log.topics[1]), to: decodeEVMAddress(log.topics[2]), @@ -37,7 +37,7 @@ function updateTokenTransfers(tx: RawTransaction) { }); break; case TRANSFER_SIGNATURES.CRYPTO_PUNKS_ERC721_BUY: - oldNFTsTransfers.push({ + cryptopunksTransfers.push({ asset: log.address, from: decodeEVMAddress(log.topics[2]), to: decodeEVMAddress(log.topics[3]), @@ -56,19 +56,19 @@ function updateTokenTransfers(tx: RawTransaction) { assetTransfer.type !== AssetType.ETH && !CRYPTO_PUNKS_ADDRESSES.includes(assetTransfer.asset), ); - const assetTransfers = [...nonOldAssetTransfers, ...oldNFTsTransfers]; + const assetTransfers = [...nonOldAssetTransfers, ...cryptopunksTransfers]; return assetTransfers; } export function transform(block: RawBlock): RawBlock { block.transactions = block.transactions.map((tx) => { - const hasOldNFTTransfer = tx.assetTransfers?.some( + const hasCryptopunksTransfer = tx.assetTransfers?.some( (assetTransfer) => assetTransfer.type !== AssetType.ETH && CRYPTO_PUNKS_ADDRESSES.includes(assetTransfer.asset), ); - if (hasOldNFTTransfer) { + if (hasCryptopunksTransfer) { tx.assetTransfers = updateTokenTransfers(tx); } return tx;