Skip to content

Commit

Permalink
feat: upgrade api layer
Browse files Browse the repository at this point in the history
  • Loading branch information
He1DAr committed Nov 18, 2024
1 parent ea80e0d commit d307216
Show file tree
Hide file tree
Showing 71 changed files with 979 additions and 1,799 deletions.
30 changes: 11 additions & 19 deletions e2e/filters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { test, expect } from '@playwright/test';
import { GetTransactionListTypeEnum } from '@stacks/blockchain-api-client';
import { expect, test } from '@playwright/test';

import { txs } from './mocks';

test.describe('Transaction page', () => {
test.beforeEach(async ({ page, context }) => {
test.beforeEach(async ({ page }) => {
await page.route('**/extended/v1/tx**', route =>
route.fulfill({
status: 200,
Expand All @@ -22,31 +22,23 @@ test.describe('Transaction page', () => {
await page.waitForTimeout(1000);

// smart_contract filter
await page.click(`[data-test=${GetTransactionListTypeEnum.smart_contract}]`);
await expect(
page.locator(`[data-test=${GetTransactionListTypeEnum.smart_contract}-transaction]`)
).toBeHidden();
await page.click(`[data-test=smart_contract]`);
await expect(page.locator(`[data-test=smart_contract-transaction]`)).toBeHidden();
await page.waitForTimeout(1000);

// contract_call filter
await page.click(`[data-test=${GetTransactionListTypeEnum.contract_call}]`);
await expect(
page.locator(`[data-test=${GetTransactionListTypeEnum.contract_call}-transaction]`)
).toBeHidden();
await page.click(`[data-test=contract_call]`);
await expect(page.locator(`[data-test=contract_call-transaction]`)).toBeHidden();
await page.waitForTimeout(1000);

// token_transfer filter
await page.click(`[data-test=${GetTransactionListTypeEnum.token_transfer}]`);
await expect(
page.locator(`[data-test=${GetTransactionListTypeEnum.token_transfer}-transaction]`)
).toBeHidden();
await page.click(`[data-test=token_transfer]`);
await expect(page.locator(`[data-test=token_transfer-transaction]`)).toBeHidden();
await page.waitForTimeout(1000);

// coinbase filter
await page.click(`[data-test=${GetTransactionListTypeEnum.coinbase}]`);
await expect(
page.locator(`[data-test=${GetTransactionListTypeEnum.coinbase}-transaction]`)
).toBeHidden();
await page.click(`[data-test=coinbase]`);
await expect(page.locator(`[data-test=coinbase-transaction]`)).toBeHidden();
await page.waitForTimeout(1000);
});
});
Expand Down
10 changes: 4 additions & 6 deletions e2e/mocks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { GetTransactionListTypeEnum } from '@stacks/blockchain-api-client';

export const txs = [
{
tx_id: '0x1',
sender_address: 'SP1',
tx_type: GetTransactionListTypeEnum.contract_call,
tx_type: 'contract_call',
contract_call: {
contract_id: 'SP1.contract1',
function_name: 'transaction-1',
Expand All @@ -13,19 +11,19 @@ export const txs = [
{
tx_id: '0x2',
sender_address: 'SP1',
tx_type: GetTransactionListTypeEnum.token_transfer,
tx_type: 'token_transfer',
token_transfer: {
amount: 1,
},
},
{
tx_id: '0x3',
sender_address: 'SP1',
tx_type: GetTransactionListTypeEnum.coinbase,
tx_type: 'coinbase',
},
{
tx_id: '0x4',
sender_address: 'SP1',
tx_type: GetTransactionListTypeEnum.smart_contract,
tx_type: 'smart_contract',
},
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@reduxjs/toolkit": "1.9.7",
"@sentry/nextjs": "8.26.0",
"@stacks/auth": "6.15.0",
"@stacks/blockchain-api-client": "7.12.0",
"@stacks/blockchain-api-client": "8.2.2",
"@stacks/common": "6.15.1-pr.0bcf867e.0+0bcf867e",
"@stacks/connect": "7.7.1",
"@stacks/connect-react": "22.4.2",
Expand Down
Loading

0 comments on commit d307216

Please sign in to comment.