diff --git a/packages/api/src/address/address.controller.spec.ts b/packages/api/src/address/address.controller.spec.ts index fb040b44b9..e215f6c378 100644 --- a/packages/api/src/address/address.controller.spec.ts +++ b/packages/api/src/address/address.controller.spec.ts @@ -7,8 +7,6 @@ import { BalanceService } from "../balance/balance.service"; import { BlockService } from "../block/block.service"; import { LogService } from "../log/log.service"; import { TransactionService } from "../transaction/transaction.service"; -import { TransactionReceiptService } from "../transaction/transactionReceipt.service"; -import { TransactionReceipt } from "../transaction/entities/transactionReceipt.entity"; import { Log } from "../log/log.entity"; import { Token } from "../token/token.entity"; import { PagingOptionsWithMaxItemsLimitDto } from "../common/dtos"; @@ -28,7 +26,6 @@ describe("AddressController", () => { let logServiceMock: LogService; let balanceServiceMock: BalanceService; let transactionServiceMock: TransactionService; - let transactionReceiptServiceMock: TransactionReceiptService; let transferServiceMock: TransferService; const blockchainAddress = "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; const normalizedAddress = "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"; @@ -38,7 +35,6 @@ describe("AddressController", () => { serviceMock = mock(); blockServiceMock = mock(); transactionServiceMock = mock(); - transactionReceiptServiceMock = mock(); logServiceMock = mock(); balanceServiceMock = mock(); transferServiceMock = mock(); @@ -58,10 +54,6 @@ describe("AddressController", () => { provide: TransactionService, useValue: transactionServiceMock, }, - { - provide: TransactionReceiptService, - useValue: transactionReceiptServiceMock, - }, { provide: LogService, useValue: logServiceMock, @@ -104,9 +96,8 @@ describe("AddressController", () => { describe("when contract address exists", () => { const transactionHash = "transactionHash"; - const transactionFrom = "transactionFrom"; + const creatorAddress = "creatorAddress"; const totalTxCount = 20; - let transactionReceipt; const addressBalances = { balances: { "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF": { @@ -128,21 +119,13 @@ describe("AddressController", () => { bytecode: "0x123", createdInBlockNumber: 30, creatorTxHash: transactionHash, - creatorAddress: transactionFrom, + creatorAddress, }; - transactionReceipt = mock({ from: transactionFrom }); (serviceMock.findOne as jest.Mock).mockResolvedValue(addressRecord); - (transactionReceiptServiceMock.findOne as jest.Mock).mockResolvedValue(transactionReceipt); (transactionServiceMock.count as jest.Mock).mockResolvedValue(totalTxCount); (balanceServiceMock.getBalances as jest.Mock).mockResolvedValue(addressBalances); }); - it("queries creatorAddress value from transaction receipt", async () => { - await controller.getAddress(blockchainAddress); - expect(transactionReceiptServiceMock.findOne).toHaveBeenCalledTimes(1); - expect(transactionReceiptServiceMock.findOne).toHaveBeenCalledWith(transactionHash, ["from"]); - }); - it("queries totalTransactions value from transaction receipt repo with formatted contractAddress", async () => { await controller.getAddress(blockchainAddress); expect(transactionServiceMock.count).toHaveBeenCalledTimes(1); diff --git a/packages/api/src/address/address.controller.ts b/packages/api/src/address/address.controller.ts index d6b30e772e..70f18a078c 100644 --- a/packages/api/src/address/address.controller.ts +++ b/packages/api/src/address/address.controller.ts @@ -16,7 +16,6 @@ import { formatHexAddress, buildDateFilter } from "../common/utils"; import { AddressService } from "./address.service"; import { BlockService } from "../block/block.service"; import { TransactionService } from "../transaction/transaction.service"; -import { TransactionReceiptService } from "../transaction/transactionReceipt.service"; import { BalanceService } from "../balance/balance.service"; import { AddressType, ContractDto, AccountDto, TokenAddressDto } from "./dtos"; import { LogDto } from "../log/log.dto"; @@ -37,7 +36,6 @@ export class AddressController { private readonly addressService: AddressService, private readonly blockService: BlockService, private readonly transactionService: TransactionService, - private readonly transactionReceiptService: TransactionReceiptService, private readonly logService: LogService, private readonly balanceService: BalanceService, private readonly transferService: TransferService @@ -66,11 +64,7 @@ export class AddressController { ]); if (addressRecord?.bytecode.length > 2) { - const [txReceipt, totalTransactions] = await Promise.all([ - this.transactionReceiptService.findOne(addressRecord.creatorTxHash, ["from"]), - this.transactionService.count({ "from|to": formatHexAddress(address) }), - ]); - + const totalTransactions = await this.transactionService.count({ "from|to": formatHexAddress(address) }); return { type: AddressType.Contract, ...addressRecord, @@ -79,7 +73,7 @@ export class AddressController { createdInBlockNumber: addressRecord.createdInBlockNumber, creatorTxHash: addressRecord.creatorTxHash, totalTransactions, - creatorAddress: txReceipt.from, + creatorAddress: addressRecord.creatorAddress, }; } diff --git a/packages/api/test/address.e2e-spec.ts b/packages/api/test/address.e2e-spec.ts index 772878a9ee..0c51412dcc 100644 --- a/packages/api/test/address.e2e-spec.ts +++ b/packages/api/test/address.e2e-spec.ts @@ -785,7 +785,7 @@ describe("AddressController (e2e)", () => { blockNumber: 106, bytecode: "0x000012", createdInBlockNumber: 10, - creatorAddress: "0xc7e0220d02D549C4846A6EC31D89C3B670eBE355", + creatorAddress: "0x91d0a23f34e535e44Df8Ba84c53a0945cf0eEB60", creatorTxHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e15", totalTransactions: 4, type: "contract", @@ -844,7 +844,7 @@ describe("AddressController (e2e)", () => { blockNumber: 106, bytecode: "0x000012", createdInBlockNumber: 10, - creatorAddress: "0xc7e0220d02D549C4846A6EC31D89C3B670eBE355", + creatorAddress: "0x91d0a23f34e535e44Df8Ba84c53a0945cf0eEB60", creatorTxHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e15", totalTransactions: 4, type: "contract", @@ -903,7 +903,7 @@ describe("AddressController (e2e)", () => { blockNumber: 106, bytecode: "0x000012", createdInBlockNumber: 10, - creatorAddress: "0xc7e0220d02D549C4846A6EC31D89C3B670eBE355", + creatorAddress: "0x91d0a23f34e535e44Df8Ba84c53a0945cf0eEB60", creatorTxHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e15", totalTransactions: 4, type: "contract", @@ -962,7 +962,7 @@ describe("AddressController (e2e)", () => { blockNumber: 106, bytecode: "0x000012", createdInBlockNumber: 10, - creatorAddress: "0xc7e0220d02D549C4846A6EC31D89C3B670eBE355", + creatorAddress: "0x91d0a23f34e535e44Df8Ba84c53a0945cf0eEB60", creatorTxHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e15", totalTransactions: 4, type: "contract", @@ -982,7 +982,7 @@ describe("AddressController (e2e)", () => { blockNumber: 10, bytecode: "0x000012", createdInBlockNumber: 10, - creatorAddress: "0xc7e0220d02D549C4846A6EC31D89C3B670eBE355", + creatorAddress: "0x91d0a23f34e535e44Df8Ba84c53a0945cf0eEB60", creatorTxHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e15", totalTransactions: 0, type: "contract", diff --git a/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature b/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature index 57f7fc174c..2c1125ea70 100644 --- a/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature +++ b/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature @@ -114,11 +114,11 @@ Feature: Main Page # When I click by text "Show more transactions ->" Then Element with "text" "in" should be "visible" - @id382 @mainnet - Scenario: Verify label "self" for Account info on Account page - Given I go to page "/address/0x94124252B5D343AB6E950A15982599ee1AADE660" + #@id382 @mainnet + #Scenario: Verify label "self" for Account info on Account page + #Given I go to page "/address/0x94124252B5D343AB6E950A15982599ee1AADE660" # When I click by text "Show more transactions ->" - Then Element with "text" "self" should be "visible" + #Then Element with "text" "self" should be "visible" @id580 @id578 @id619 @testnet @testnetSmokeSuite Scenario Outline: Verify label "