Skip to content

Commit

Permalink
test: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters committed Oct 12, 2023
1 parent 0067dcb commit c660d17
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/api/test/address.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Transaction } from "../src/transaction/entities/transaction.entity";
import { AddressTransaction } from "../src/transaction/entities/addressTransaction.entity";
import { TransactionReceipt } from "../src/transaction/entities/transactionReceipt.entity";
import { Log } from "../src/log/log.entity";
import { Token } from "../src/token/token.entity";
import { Token, TokenType } from "../src/token/token.entity";
import { BatchDetails } from "../src/batch/batchDetails.entity";
import { Counter } from "../src/counter/counter.entity";
import { Transfer, TransferType } from "../src/transfer/transfer.entity";
Expand Down Expand Up @@ -310,6 +310,7 @@ describe("AddressController (e2e)", () => {
transactionIndex: i,
timestamp: new Date("2022-11-21T18:16:51.000Z"),
type,
tokenType: i % 2 ? TokenType.ERC20 : TokenType.ETH,
tokenAddress:
i % 2 ? "0x97d0a23f34e535e44df8ba84c53a0945cf0eeb67" : "0x000000000000000000000000000000000000800a",
logIndex: i,
Expand All @@ -326,6 +327,7 @@ describe("AddressController (e2e)", () => {
tokenAddress: transferSpec.tokenAddress,
blockNumber: transferSpec.blockNumber,
timestamp: transferSpec.timestamp,
tokenType: transferSpec.tokenType,
isFeeOrRefund: transferSpec.isFeeOrRefund,
logIndex: transferSpec.logIndex,
isInternal: transferSpec.isInternal,
Expand Down Expand Up @@ -1029,6 +1031,7 @@ describe("AddressController (e2e)", () => {
tokenAddress: "0x97d0a23F34E535e44dF8ba84c53A0945cF0eEb67",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e11",
type: "mint",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -1048,6 +1051,7 @@ describe("AddressController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e11",
type: "transfer",
tokenType: "ETH",
isInternal: false,
},
{
Expand All @@ -1067,6 +1071,7 @@ describe("AddressController (e2e)", () => {
tokenAddress: "0x97d0a23F34E535e44dF8ba84c53A0945cF0eEb67",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e11",
type: "deposit",
tokenType: "ERC20",
isInternal: false,
},
])
Expand Down
16 changes: 15 additions & 1 deletion packages/api/test/token.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Repository } from "typeorm";
import { getRepositoryToken } from "@nestjs/typeorm";
import { AppModule } from "../src/app.module";
import { configureApp } from "../src/configureApp";
import { Token } from "../src/token/token.entity";
import { Token, TokenType } from "../src/token/token.entity";
import { BlockDetail } from "../src/block/blockDetail.entity";
import { Transaction } from "../src/transaction/entities/transaction.entity";
import { Transfer, TransferType } from "../src/transfer/transfer.entity";
Expand Down Expand Up @@ -108,6 +108,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: "1000",
type: TransferType.Deposit,
tokenType: TokenType.ERC20,
logIndex: transferIndex++,
transactionIndex: 0,
timestamp: "2022-11-21T18:16:51.000Z",
Expand All @@ -123,6 +124,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: "1000",
type: TransferType.Fee,
tokenType: TokenType.ERC20,
logIndex: transferIndex++,
transactionIndex: 0,
timestamp: "2022-11-21T18:16:51.000Z",
Expand All @@ -138,6 +140,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: "1000",
type: TransferType.Mint,
tokenType: TokenType.ERC20,
logIndex: transferIndex++,
transactionIndex: 0,
timestamp: "2022-11-21T18:16:51.000Z",
Expand All @@ -153,6 +156,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: "1000",
type: TransferType.Transfer,
tokenType: TokenType.ERC20,
logIndex: transferIndex++,
transactionIndex: 0,
timestamp: "2022-11-21T18:16:51.000Z",
Expand All @@ -168,6 +172,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: "1000",
type: TransferType.Withdrawal,
tokenType: TokenType.ERC20,
logIndex: transferIndex++,
transactionIndex: 0,
timestamp: "2022-11-21T18:16:51.000Z",
Expand All @@ -183,6 +188,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: undefined,
type: TransferType.Mint,
tokenType: TokenType.ERC721,
fields: { tokenId: "1" },
logIndex: transferIndex++,
transactionIndex: 0,
Expand All @@ -199,6 +205,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xd754ff5e8a6f257e162f72578a4bb0493c068101",
amount: "1000",
type: TransferType.Refund,
tokenType: TokenType.ERC20,
logIndex: transferIndex++,
transactionIndex: 0,
timestamp: "2022-11-21T18:16:51.000Z",
Expand Down Expand Up @@ -392,6 +399,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "transfer",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -411,6 +419,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "withdrawal",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -432,6 +441,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "mint",
tokenType: "ERC721",
isInternal: false,
},
{
Expand All @@ -451,6 +461,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "deposit",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -470,6 +481,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "mint",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -489,6 +501,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "transfer",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -508,6 +521,7 @@ describe("TokenController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "withdrawal",
tokenType: "ERC20",
isInternal: false,
},
])
Expand Down
13 changes: 12 additions & 1 deletion packages/api/test/transaction.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Repository } from "typeorm";
import { getRepositoryToken } from "@nestjs/typeorm";
import { AppModule } from "../src/app.module";
import { configureApp } from "../src/configureApp";
import { Token } from "../src/token/token.entity";
import { Token, TokenType } from "../src/token/token.entity";
import { BlockDetail } from "../src/block/blockDetail.entity";
import { Transaction } from "../src/transaction/entities/transaction.entity";
import { AddressTransaction } from "../src/transaction/entities/addressTransaction.entity";
Expand Down Expand Up @@ -188,6 +188,7 @@ describe("TransactionController (e2e)", () => {
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
tokenAddress:
i % 2 ? "0xd754ff5e8a6f257e162f72578a4bb0493c068101" : "0x000000000000000000000000000000000000800a",
tokenType: i % 2 ? TokenType.ERC20 : TokenType.ETH,
amount: "2000",
type,
logIndex: i,
Expand Down Expand Up @@ -1005,6 +1006,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "deposit",
tokenType: "ETH",
isInternal: false,
},
{
Expand All @@ -1024,6 +1026,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "transfer",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -1043,6 +1046,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "withdrawal",
tokenType: "ETH",
isInternal: false,
},
{
Expand All @@ -1062,6 +1066,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "fee",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -1081,6 +1086,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "mint",
tokenType: "ETH",
isInternal: false,
},
{
Expand All @@ -1100,6 +1106,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "refund",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -1119,6 +1126,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "deposit",
tokenType: "ETH",
isInternal: false,
},
{
Expand All @@ -1138,6 +1146,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0xD754FF5E8a6F257E162f72578a4bB0493c068101",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "deposit",
tokenType: "ERC20",
isInternal: false,
},
{
Expand All @@ -1157,6 +1166,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "transfer",
tokenType: "ETH",
isInternal: false,
},
])
Expand Down Expand Up @@ -1221,6 +1231,7 @@ describe("TransactionController (e2e)", () => {
tokenAddress: "0x000000000000000000000000000000000000800A",
transactionHash: "0x8a008b8dbbc18035e56370abb820e736b705d68d6ac12b203603db8d9ea87e10",
type: "deposit",
tokenType: "ETH",
isInternal: false,
},
],
Expand Down

0 comments on commit c660d17

Please sign in to comment.