Skip to content

Commit

Permalink
Merge pull request #4083 from cardano-foundation/1.11.0
Browse files Browse the repository at this point in the history
merge 1.11.0 into main
  • Loading branch information
nemo83 authored Nov 1, 2024
2 parents ffa1315 + 6c70ad6 commit 98c7a14
Show file tree
Hide file tree
Showing 107 changed files with 1,551 additions and 3,816 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
release-type: node
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
release-as: 1.9.0
release-as: 1.11.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorer",
"version": "1.9.1",
"version": "1.11.0",
"private": true,
"dependencies": {
"@cardano-foundation/cardano-connect-with-wallet": "^0.2.9",
Expand Down
49 changes: 1 addition & 48 deletions playwright/api/call-blockfrost/blockfrost.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,50 +230,6 @@ export function blockfrostApi(request: APIRequestContext) {
const getAssetNameByAssetToken = async (assetToken: string | null) => {
return BaseApi.getData(request, Endpoint.BlockFrost.Token.Base + `/${assetToken}`);
};
const getTxCountTopADAHolder = async (address: string) => {
return BaseApi.getData(
request,
Endpoint.BlockFrost.TopADAHolder.TxCount.replace(":address", address),
{},
{
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/json",
project_id: BLOCKFROST_TOKEN
},
false
);
};

const getDataAmountStaked = async (stakedAddress: string) => {
return BaseApi.getData(
request,
Endpoint.BlockFrost.TopADAHolder.dataTabAmountStaked.replace(":stake_address", stakedAddress),
{},
{
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/json",
project_id: BLOCKFROST_TOKEN
},
false
);
};

const getPoolIDAcount = async (stakedAddress: string) => {
return BaseApi.getData(
request,
Endpoint.BlockFrost.TopADAHolder.poolIDAcount.replace(":stake_address", stakedAddress),
{},
{
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/json",
project_id: BLOCKFROST_TOKEN
},
false
);
};

return {
getLastEpochData,
Expand All @@ -291,9 +247,6 @@ export function blockfrostApi(request: APIRequestContext) {
getStakePools,
getMetadataPools,
getHistoryPools,
getAssetNameByAssetToken,
getTxCountTopADAHolder,
getDataAmountStaked,
getPoolIDAcount
getAssetNameByAssetToken
};
}
7 changes: 0 additions & 7 deletions playwright/api/dtos/topADAHolders.dto.ts

This file was deleted.

14 changes: 0 additions & 14 deletions playwright/helpers/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ export class BlockFrost {
return `${BlockFrost.BASE_MAIN_NET_URL}/assets`;
}
};
static TopADAHolder = class {
public static get Base() {
return `${BlockFrost.BASE_MAIN_NET_URL}/addresses`;
}
public static get TxCount() {
return `${BlockFrost.TopADAHolder.Base}/:address/total`;
}
public static get dataTabAmountStaked() {
return `${BlockFrost.BASE_MAIN_NET_URL}/accounts/:stake_address`;
}
public static get poolIDAcount() {
return `${BlockFrost.BASE_MAIN_NET_URL}/accounts/:stake_address/delegations`;
}
};
}

export class Koios {
Expand Down
4 changes: 0 additions & 4 deletions playwright/pages/block-detail.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export function blockDetailPage(page: Page) {
//Block detail - Transactions Table
const blocksDetailTrxTableTxhash = page.getByTestId("block.detail.trxTable.txhash");
const blocksDetailTrxTableCreatedAt = page.getByTestId("block.detail.trxTable.createdAt");
const blocksDetailTrxTableAddress = page.getByTestId("block.detail.trxTable.address");
const blocksDetailTrxTableFees = page.getByTestId("block.detail.trxTable.fees");
const blocksDetailTrxTableoutput = page.getByTestId("block.detail.trxTable.output");
const blocksDetailTrxTableValueTrx = page.getByTestId("block.detail.trxTable.value.txhash#0");
const blocksDetailTrxTableValueInputAddress = page.getByTestId("block.detail.trxTable.value.inputAddress#0");

Expand Down Expand Up @@ -106,9 +104,7 @@ export function blockDetailPage(page: Page) {
const checkTransactionsTable = async () => {
await expect(blocksDetailTrxTableTxhash, "Check title on transaction table").toHaveText("Tx hash");
await expect(blocksDetailTrxTableCreatedAt, "Check title on transaction table").toHaveText("Created At");
await expect(blocksDetailTrxTableAddress, "Check title on transaction table").toHaveText("Addresses");
await expect(blocksDetailTrxTableFees, "Check title on transaction table").toHaveText("Fees");
await expect(blocksDetailTrxTableoutput, "Check title on transaction table").toHaveText("Output in ADA");
};

const checkBlockDetail = async ({ blockNo }: { blockNo: string | null }) => {
Expand Down
72 changes: 1 addition & 71 deletions playwright/pages/blocks-dashboard.page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { expect, Page } from "@playwright/test";
import moment from "moment";

import { BlockInformationDto } from "playwright/api/dtos/blockInformation.dto";

export function blocksDashboard(page: Page) {
const blocksTable = page.getByTestId("blocks-card");
Expand All @@ -20,23 +17,9 @@ export function blocksDashboard(page: Page) {
const blocksTableTitleSlot = page.getByTestId("blocks.table.title.slot");
const blocksTableTitleAbsSlot = page.getByTestId("blocks.table.title.absoluteSlot");
const blocksTableTitleCreateAt = page.getByTestId("blocks.table.title.createAt");
const blocksTableTitleTransactionsCount = page.getByTestId("blocks.table.title.transactions");
const blocksTableTitleFee = page.getByTestId("blocks.table.title.fee");
const blocksTableTitleOutput = page.getByTestId("blocks.table.title.output");
const blocksTableValueSlot = page.getByTestId("blocks.table.value.slot#2");

//Block widget
const blocksWidgetViewDetailButton = page.getByTestId("block.detailViewEpoch.viewDetail");
const blocksWidgetEpochNo = page.getByTestId("block.widget.epochNo");
const blocksWidgetSlotNo = page.getByTestId("block.widget.slotNo");
const blocksWidgetAbsSlotNo = page.getByTestId("block.widget.absSlotNo");
const blocksWidgetCreatedAt = page.getByTestId("block.widget.createdAt");
const blocksWidgetConfirmation = page.getByTestId("block.widget.confirmation");
const blocksWidgetFee = page.getByTestId("block.widget.fees");
const blocksWidgetOutput = page.getByTestId("block.widget.output");
const blocksWidgetBlockHash = page.getByTestId("block.widget.blockHash");
const blocksWidgetTrxTab = page.getByTestId("block.widget.trxTab");

const goToDashboard = async () => {
await page.goto("/");
};
Expand All @@ -53,14 +36,6 @@ export function blocksDashboard(page: Page) {
await blocksTableValueSlot.click();
};

const goToBlockDetailFromWidget = async () => {
await blocksWidgetViewDetailButton.click();
};

const goToBlockDetailFromWidgetByBlockHash = async () => {
await blocksWidgetBlockHash.click();
};

const goToBlockDetailFromBlockNo = async () => {
await blocksTableValueBlock.click();
};
Expand All @@ -73,10 +48,6 @@ export function blocksDashboard(page: Page) {
await blocksTableValueEpoch.click();
};

const goToBlockDetailFromWidgetByTrxTab = async () => {
await blocksWidgetTrxTab.click();
};

const openLastBlockDetails = async () => {
await expect(blocksTable).toBeVisible();
await firstBlocksID.click();
Expand All @@ -93,46 +64,9 @@ export function blocksDashboard(page: Page) {
await expect(blocksTableTitleSlot, "Check title on blocks table").toHaveText("Slot");
await expect(blocksTableTitleAbsSlot, "Check title on blocks table").toHaveText("Absolute Slot");
await expect(blocksTableTitleCreateAt, "Check title on blocks table").toHaveText("Created At");
await expect(blocksTableTitleTransactionsCount, "Check title on blocks table").toHaveText("Transactions");
await expect(blocksTableTitleFee, "Check title on blocks table").toHaveText("Fees");
await expect(blocksTableTitleOutput, "Check title on finished epoch table").toHaveText("Output");
};

const checkBlockWidget = async ({ blockFrostBlock }: { blockFrostBlock: BlockInformationDto }) => {
expect(+((await blocksWidgetEpochNo.textContent()) || 0), "Check epoch on block widget").toEqual(
blockFrostBlock.epoch
);
expect(
+((await blocksWidgetSlotNo.textContent())?.split("/")[0] || 0),
"Slot no in block widget to equal total fee in block on Blockfrost "
).toEqual(+(blockFrostBlock?.epoch_slot || 0));

expect(
+((await blocksWidgetAbsSlotNo.textContent()) || 0),
"Absolute slot in block widget to equal total fee in block on Blockfrost "
).toEqual(+(blockFrostBlock?.slot || 0));

expect(
moment((await blocksWidgetCreatedAt.textContent())?.replace(",", "")).unix(),
"Created time to equal create time epoch Blockfrost"
).toEqual(blockFrostBlock?.time);

expect(
+((await blocksWidgetConfirmation.textContent()) || 0),
"Confirmation in block widget to equal total fee in block on Blockfrost "
).toBeGreaterThanOrEqual(+(blockFrostBlock?.confirmations || 0));

expect(
+((await blocksWidgetFee.textContent())?.replaceAll(",", "") || 0) * 10 ** 6,
"Total fees in block widget to equal total fee in block on Blockfrost "
).toEqual(+(blockFrostBlock?.fees || 0));

expect(
+((await blocksWidgetOutput.textContent())?.replaceAll(",", "") || 0) * 10 ** 6,
"Total output in block widget to equal total fee in block on Blockfrost "
).toEqual(+(blockFrostBlock?.output || 0));
};

return {
openLastBlockDetails,
goToDashboard,
Expand All @@ -141,12 +75,8 @@ export function blocksDashboard(page: Page) {
searchBarOnBlocks,
checkBlocksTable,
openLastestBlockWidget,
goToBlockDetailFromWidget,
goToBlockDetailFromBlockNo,
goToEpochDetailFromEpochNo,
goToBlockDetailFromBlockId,
checkBlockWidget,
goToBlockDetailFromWidgetByBlockHash,
goToBlockDetailFromWidgetByTrxTab
goToBlockDetailFromBlockId
};
}
7 changes: 0 additions & 7 deletions playwright/pages/epoch-detail.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export function epochDetailPage(page: Page) {
const slotTitleColumnBlockTable = page.getByTestId("epochList.slotTitle");
const slotNoTitleColumnBlockTable = page.getByTestId("epochList.slotNoTitle");
const createdAtTitleColumnBlockTable = page.getByTestId("epochList.createdAtTitle");
const txCountTitleColumnBlockTable = page.getByTestId("epochList.txCountTitle");
const feesTitleColumnBlockTable = page.getByTestId("epochList.feesTitle");
const outSumTitleColumnBlockTable = page.getByTestId("epochList.outSumTitle");

const goToBlockDetailFromEpoch = async () => {
await firstBlockInEpochDetail.click();
};
Expand Down Expand Up @@ -145,9 +141,6 @@ export function epochDetailPage(page: Page) {
await expect(slotTitleColumnBlockTable, "Check title on finished blocks table").toHaveText("Slot");
await expect(slotNoTitleColumnBlockTable, "Check title on finished blocks table").toHaveText("Absolute Slot");
await expect(createdAtTitleColumnBlockTable, "Check title on finished blocks table").toHaveText("Created At");
await expect(txCountTitleColumnBlockTable, "Check title on finished blocks table").toHaveText("Transactions");
await expect(feesTitleColumnBlockTable, "Check title on finished blocks table").toHaveText("Fees");
await expect(outSumTitleColumnBlockTable, "Check title on finished blocks table").toHaveText("Output");
};

const checkBlockDetailPage = async ({ blockId = "" }: { blockId: string | null }) => {
Expand Down
14 changes: 0 additions & 14 deletions playwright/pages/epochs-dashboard.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export function epochsDashboardPage(page: Page) {
const startTimeTitleTable = page.getByTestId("epoch.table.startTimeTitle");
const endTimeTitleTable = page.getByTestId("epoch.table.endTimeTitle");
const blocksTitleTable = page.getByTestId("epoch.table.blocksTitle");
const uniqueAccountsTitleTable = page.getByTestId("epoch.table.uniqueAccountsTitle");
const transactionCountTitleTable = page.getByTestId("epoch.table.transactionCountTitle");
const rewardsDistributedTitleTable = page.getByTestId("epoch.table.rewardsDistributedTitle");
const totalOutputTitleTable = page.getByTestId("epoch.table.totalOutputTitle");

// Epoch widget
const firstEpochContainer = page.getByTestId("epoch.firstEpoch.container");
Expand All @@ -36,7 +32,6 @@ export function epochsDashboardPage(page: Page) {
const startTimeInEpochWidget = page.getByTestId("epoch.detailViewEpoch.startTimeValue");
const endTimeInEpochWidget = page.getByTestId("epoch.detailViewEpoch.endTimeValue");
const txCountInEpochWidget = page.getByTestId("epoch.detailViewEpoch.txCountValue");
const totalOutputInEpochWidget = page.getByTestId("epoch.detailViewEpoch.totalOutputValue");
const blockTabWidget = page.getByTestId("epoch.detailViewEpoch.blockLink");
const viewDetailButtonWidget = page.getByTestId("epoch.detailViewEpoch.viewDetail");
const blockTab = page.getByTestId("epoch.detailViewEpoch.blockLink");
Expand Down Expand Up @@ -109,10 +104,6 @@ export function epochsDashboardPage(page: Page) {
await expect(startTimeTitleTable, "Check title on finished epoch table").toHaveText("Start Timestamp");
await expect(endTimeTitleTable, "Check title on finished epoch table").toHaveText("End Timestamp");
await expect(blocksTitleTable, "Check title on finished epoch table").toHaveText("Blocks");
await expect(uniqueAccountsTitleTable, "Check title on finished epoch table").toHaveText("Unique Accounts");
await expect(transactionCountTitleTable, "Check title on finished epoch table").toHaveText("Transaction Count");
await expect(rewardsDistributedTitleTable, "Check title on finished epoch table").toHaveText("Rewards Distributed");
await expect(totalOutputTitleTable, "Check title on finished epoch table").toHaveText("Total Output");
};

const checkCurrentEpochWidget = async ({ currentEpoch }: { currentEpoch?: BlockfrostEpochInformationDto }) => {
Expand Down Expand Up @@ -167,11 +158,6 @@ export function epochsDashboardPage(page: Page) {
"Total transaction in finished epoch on widget to equal total block in epoch on Blockfrost "
).toEqual(currentEpoch?.tx_count || 0);

expect(
+((await totalOutputInEpochWidget.textContent())?.replaceAll(",", "") || 0) * 10 ** 6,
"Total output in finished epoch on widget to equal total block in epoch on Blockfrost "
).toEqual(+(currentEpoch?.output || 0));

await expect(blockTabWidget, "Block tab on epoch widget").toHaveText("Blocks");

await expect(viewDetailButtonWidget, "View details button on epoch widget").toHaveText("View details");
Expand Down
15 changes: 1 addition & 14 deletions playwright/pages/native-token.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export function nativeTokenPage(page: Page) {
const tokenTableIcon = page.getByTestId("tokens.table.title.icon");
const tokenTableAssetName = page.getByTestId("tokens.table.title.assetName");
const tokenTableScriptHash = page.getByTestId("tokens.table.title.scriptHash");
const tokenTableTotalTxs = page.getByTestId("tokens.table.title.totalTxs");
const tokenTableNumberOfHolders = page.getByTestId("tokens.table.title.numberOfHolders");
const tokenTableTotalVolumn = page.getByTestId("tokens.table.title.totalVolumn");
const tokenTableVolume24h = page.getByTestId("tokens.table.title.volume24h");
const tokenTableTotalSupply = page.getByTestId("tokens.table.title.totalSupply");
const tokenTabletoCreatedAt = page.getByTestId("tokens.table.title.createdAt");
Expand All @@ -39,7 +37,6 @@ export function nativeTokenPage(page: Page) {
const tokenTransactionTxhash = page.getByTestId("token.transaction.txHash#0");
const tokenTransactionBlock = page.getByTestId("token.transaction.block#0");
const tokenTransactionEpoch = page.getByTestId("token.transaction.epoch#0");
const tokenTransactionAddress = page.getByTestId("token.transaction.address#0");
const widgetPolicyName = page.getByTestId("token.widget.policyName");
const tokenAssetName = page.getByTestId("token.asset.name");
const tokenMinting = page.getByTestId("token.detail.minting.trxHash#0");
Expand Down Expand Up @@ -82,9 +79,7 @@ export function nativeTokenPage(page: Page) {
const goToEpochDetailFromTransactionTableByEpoch = async () => {
await tokenTransactionEpoch.click();
};
const goToAddressDetailFromTransactionTableByAddress = async () => {
await tokenTransactionAddress.click();
};

const goToStakeAddressDetailFromTopHolderTableByAddress = async () => {
await deatailTopHolderTab.click();
await topholderTransactionAddress.click();
Expand Down Expand Up @@ -152,10 +147,6 @@ export function nativeTokenPage(page: Page) {
const blockTrx = await tokenTransactionBlock.getAttribute("aria-label");
return blockTrx;
};
const getAddressByTableValueTrx = async () => {
const addressTrx = await tokenTransactionAddress.getAttribute("aria-label");
return addressTrx;
};
const getMintingByTableValueTrx = async () => {
const tokenMintingTrx = await tokenMinting.getAttribute("aria-label");
return tokenMintingTrx;
Expand All @@ -165,9 +156,7 @@ export function nativeTokenPage(page: Page) {
await expect(tokenTableIcon, "Check title on transaction table").toHaveText("Icon");
await expect(tokenTableAssetName, "Check title on transaction table").toHaveText("Asset name");
await expect(tokenTableScriptHash, "Check title on transaction table").toHaveText("Script hash");
await expect(tokenTableTotalTxs, "Check title on transaction table").toHaveText("Total Transactions");
await expect(tokenTableNumberOfHolders, "Check title on transaction table").toHaveText("Number of holders");
await expect(tokenTableTotalVolumn, "Check title on transaction table").toHaveText("Total volume");
await expect(tokenTableVolume24h, "Check title on transaction table").toHaveText("Volume 24H");
await expect(tokenTableTotalSupply, "Check title on transaction table").toHaveText("Total Supply");
await expect(tokenTabletoCreatedAt, "Check title on transaction table").toHaveText("Created At");
Expand Down Expand Up @@ -201,7 +190,6 @@ export function nativeTokenPage(page: Page) {
);
};
return {
goToAddressDetailFromTransactionTableByAddress,
goToStakeAddressDetailFromTopHolderTableByAddress,
goToTransactionDetailFromMintingTableByTxHash,
goToTransactionDetailFromTransactionTableByTxHash,
Expand Down Expand Up @@ -231,7 +219,6 @@ export function nativeTokenPage(page: Page) {
getDataPolicyName,
getTokenAssetName,
getEpochByTableValueTrx,
getAddressByTableValueTrx,
getMintingByTableValueTrx,
getBlockByTableValueTrx
};
Expand Down
Loading

0 comments on commit 98c7a14

Please sign in to comment.