diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7c0a814780..6e5c002c3f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,6 +20,5 @@ /packages/tools/eslint-config @alber70g @webpro /packages/tools/eslint-plugin @alber70g @webpro /packages/tools/heft-rig @alber70g @webpro -/packages/tools/integration-tests @ggobugi27 /packages/tools/remark-plugins @webpro /packages/tools/rush-fix-versions @alber70g @webpro diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 42c48a233b..4cb23d61a0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1679,52 +1679,6 @@ importers: specifier: ~3.0.0 version: 3.0.0 - ../../packages/tools/integration-tests: - dependencies: - '@kadena/chainweb-node-client': - specifier: workspace:* - version: link:../../libs/chainweb-node-client - '@kadena/pactjs': - specifier: workspace:* - version: link:../../libs/pactjs - '@kadena/types': - specifier: workspace:* - version: link:../../libs/types - exponential-backoff: - specifier: ^3.1.0 - version: 3.1.1 - kadena.js: - specifier: workspace:* - version: link:../../libs/kadena.js - devDependencies: - '@kadena-dev/eslint-config': - specifier: workspace:* - version: link:../eslint-config - '@kadena-dev/heft-rig': - specifier: workspace:* - version: link:../heft-rig - '@rushstack/eslint-config': - specifier: ~3.3.0 - version: 3.3.2(eslint@8.45.0)(typescript@5.1.6) - '@rushstack/heft': - specifier: ~0.50.6 - version: 0.50.7(@types/node@16.18.39) - '@types/heft-jest': - specifier: ~1.0.3 - version: 1.0.3 - '@types/node': - specifier: ^16.0.0 - version: 16.18.39 - concurrently: - specifier: ^7.2.2 - version: 7.6.0 - eslint: - specifier: ^8.45.0 - version: 8.45.0 - prettier: - specifier: ~3.0.0 - version: 3.0.0 - ../../packages/tools/kda-cli: dependencies: '@inkjs/ui': @@ -14736,10 +14690,6 @@ packages: jest-message-util: 29.6.2 jest-util: 29.6.2 - /exponential-backoff@3.1.1: - resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} - dev: false - /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} engines: {node: '>= 0.10.0'} diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 6f3c880e3f..7982855e04 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "48c1105dd2167eda84f82ddfcb54cf79f62d3577", + "pnpmShrinkwrapHash": "902dd9410361f1e4ab5a7a0f3a110aeb318ff6bf", "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" } diff --git a/packages/apps/docs/src/components/Layout/Blog/Blog.tsx b/packages/apps/docs/src/components/Layout/Blog/Blog.tsx index e64dc9cf62..de3cc3bad6 100644 --- a/packages/apps/docs/src/components/Layout/Blog/Blog.tsx +++ b/packages/apps/docs/src/components/Layout/Blog/Blog.tsx @@ -45,7 +45,7 @@ export const Blog: FC = ({ {children}
- + { { '@media': { [breakpoints[key]]: { - gridTemplateColumns: `repeat(${count}, 1fr)`, + gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))`, }, }, }, @@ -72,7 +72,7 @@ const containerColumnVariantsArray = Object.keys(breakpoints).map((key) => { export const explicitColumnVariant = styleVariants(columnCount, (count) => { return [ { - gridTemplateColumns: `repeat(${count}, 1fr)`, + gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))`, }, ]; }); diff --git a/packages/libs/react-ui/src/components/Grid/Grid.stories.tsx b/packages/libs/react-ui/src/components/Grid/Grid.stories.tsx index d5a9230696..dfc56ca668 100644 --- a/packages/libs/react-ui/src/components/Grid/Grid.stories.tsx +++ b/packages/libs/react-ui/src/components/Grid/Grid.stories.tsx @@ -57,7 +57,7 @@ type Story = StoryObj< export const GridRoot: Story = { name: 'Grid', args: { - spacing: 'xl', + spacing: '$xl', columns: { sm: 2, md: 4, @@ -104,7 +104,7 @@ export const GridRoot: Story = { export const GridItem: Story = { args: { - spacing: 'xl', + spacing: '$xl', columns: 12, columnSpan: { sm: 2, diff --git a/packages/libs/react-ui/src/components/Grid/GridRoot.tsx b/packages/libs/react-ui/src/components/Grid/GridRoot.tsx index cb113e01ba..8d16309737 100644 --- a/packages/libs/react-ui/src/components/Grid/GridRoot.tsx +++ b/packages/libs/react-ui/src/components/Grid/GridRoot.tsx @@ -36,7 +36,7 @@ const assembleColumnVariants = ( const GridRoot: FC = ({ children, columns, - spacing = 'md', + spacing = '$md', }) => { const classList = classNames( gapVariants[spacing], diff --git a/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.css.ts b/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.css.ts index a0ed88a158..f439a75fd6 100644 --- a/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.css.ts +++ b/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.css.ts @@ -1,5 +1,5 @@ -import { sprinkles } from '../../styles'; - +import { sprinkles } from '@theme/sprinkles.css'; +import { darkThemeClass, vars } from '@theme/vars.css'; import { style, styleVariants } from '@vanilla-extract/css'; export const layoutVariant = styleVariants({ @@ -77,13 +77,24 @@ export const CardContainer = style([ sprinkles({ display: 'grid', padding: '$3', - gap: '$4', + gap: '$2', marginTop: '$sm', borderRadius: '$sm', alignItems: 'flex-start', fontSize: '$sm', - background: '$background', + background: { + lightMode: '$white', + darkMode: '$gray100', + }, }), + { + border: `1px solid ${vars.colors.$borderDefault}`, + selectors: { + [`${darkThemeClass} &`]: { + border: `1px solid ${vars.colors.$gray60}`, + }, + }, + }, ]); export const ContentContainer = style([ diff --git a/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.tsx b/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.tsx index 5e6d333cbf..613be55792 100644 --- a/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.tsx +++ b/packages/libs/react-ui/src/components/TrackerCard/TrackerCard.tsx @@ -23,7 +23,7 @@ export interface ITrackerCardProps { helperText?: string; helperTextType?: 'mild' | 'severe'; icon?: (typeof ProductIcon)[keyof typeof ProductIcon]; - variant: keyof typeof layoutVariant; + variant?: keyof typeof layoutVariant; } export interface ILabelValue { @@ -40,7 +40,7 @@ export const TrackerCard: FC = ({ icon, helperText, helperTextType = 'mild', - variant, + variant = 'vertical', }): JSX.Element => { const classCardContainer = classNames( CardContainer, @@ -64,7 +64,7 @@ export const TrackerCard: FC = ({ return (
- {Icon ? :
} + {Icon ? : null}
{labelValues?.map((item, index) => { diff --git a/packages/tools/integration-tests/.eslintrc.js b/packages/tools/integration-tests/.eslintrc.js deleted file mode 100644 index b2c1cd5129..0000000000 --- a/packages/tools/integration-tests/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -// This is a workaround for https://github.com/eslint/eslint/issues/3458 -require('@rushstack/eslint-config/patch/modern-module-resolution'); - -module.exports = { - extends: ['@kadena-dev/eslint-config/profile/lib'], - parserOptions: { tsconfigRootDir: __dirname }, -}; diff --git a/packages/tools/integration-tests/.gitignore b/packages/tools/integration-tests/.gitignore deleted file mode 100644 index d9e51498e4..0000000000 --- a/packages/tools/integration-tests/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/log/ -/node_modules/ \ No newline at end of file diff --git a/packages/tools/integration-tests/config/rig.json b/packages/tools/integration-tests/config/rig.json deleted file mode 100644 index 8993b4048c..0000000000 --- a/packages/tools/integration-tests/config/rig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - - "rigPackageName": "@kadena-dev/heft-rig" -} diff --git a/packages/tools/integration-tests/package.json b/packages/tools/integration-tests/package.json deleted file mode 100644 index e30d7e97aa..0000000000 --- a/packages/tools/integration-tests/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@kadena/integration-tests", - "version": "0.0.1", - "private": true, - "description": "", - "keywords": [], - "license": "ISC", - "contributors": [ - { - "name": "Albert" - }, - { - "name": "Linda" - }, - { - "name": "Hee Kyun" - }, - { - "name": "Randy" - } - ], - "main": "lib/index.js", - "types": "lib/index.d.ts", - "scripts": { - "build": "heft build --clean", - "format": "npm run format:src", - "format:ci": "prettier config src --check", - "format:src": "prettier config src --write", - "lint": "eslint package.json src --ext .js,.ts --fix", - "precommit": "pnpm run test --silent", - "start:pact": "rm -Rf ./log && mkdir log && pact --serve src/tests/pact-server.conf", - "test": "", - "test:integration:devnet": "heft test --test-path-pattern devnet*", - "test:integration:pactserver": "concurrently \"npm:start:pact\" \"sleep 5 && heft test --test-path-pattern pact-server* && sleep 5\" --kill-others" - }, - "dependencies": { - "@kadena/chainweb-node-client": "workspace:*", - "@kadena/pactjs": "workspace:*", - "@kadena/types": "workspace:*", - "exponential-backoff": "^3.1.0", - "kadena.js": "workspace:*" - }, - "devDependencies": { - "@kadena-dev/eslint-config": "workspace:*", - "@kadena-dev/heft-rig": "workspace:*", - "@rushstack/eslint-config": "~3.3.0", - "@rushstack/heft": "~0.50.6", - "@types/heft-jest": "~1.0.3", - "@types/node": "^16.0.0", - "concurrently": "^7.2.2", - "eslint": "^8.45.0", - "prettier": "~3.0.0" - } -} diff --git a/packages/tools/integration-tests/src/tests/devnet-test.test.ts b/packages/tools/integration-tests/src/tests/devnet-test.test.ts deleted file mode 100644 index 2919bbb08b..0000000000 --- a/packages/tools/integration-tests/src/tests/devnet-test.test.ts +++ /dev/null @@ -1,275 +0,0 @@ -// These tests expect devnet to be running at http://localhost:8080. -// To run devnet, follow instructions at https://github.com/kadena-io/devnet. - -import { - ChainwebNetworkId, - createListenRequest, - createPollRequest, - createSendRequest, - ICommandResult, - ILocalCommandResult, - IPollResponse, - ISendRequestBody, - listen, - local, - poll, - send, - SendResponse, - spv, -} from '@kadena/chainweb-node-client'; -import { ensureSignedCommand } from '@kadena/pactjs'; -import { ICommand, IPactEvent, IUnsignedCommand } from '@kadena/types'; - -import { createSampleContTx, createSampleExecTx } from './mock-txs'; - -import { backOff } from 'exponential-backoff'; - -const devnetNetwork: ChainwebNetworkId = 'development'; -const devnetApiHostChain0: string = - 'http://localhost:8080/chainweb/0.0/development/chain/0/pact'; -const devnetApiHostChain1: string = - 'http://localhost:8080/chainweb/0.0/development/chain/1/pact'; -const devnetKeyPair = { - publicKey: 'f89ef46927f506c70b6a58fd322450a936311dc6ac91f4ec3d8ef949608dbf1f', - secretKey: 'da81490c7efd5a95398a3846fa57fd17339bdf1b941d102f2d3217ad29785ff0', -}; -const devnetAccount = `k:${devnetKeyPair.publicKey}`; - -const sampleCommand1: IUnsignedCommand = createSampleExecTx( - devnetKeyPair, - `(+ 1 2)`, - devnetNetwork, -); - -const signedSampleCommand1: ICommand = ensureSignedCommand(sampleCommand1); - -const sendReq1: ISendRequestBody = createSendRequest(signedSampleCommand1); - -const sampleCommand2: IUnsignedCommand = createSampleExecTx( - { - ...devnetKeyPair, - clist: [ - { - name: 'coin.GAS', - args: [], - }, - { - name: 'coin.TRANSFER_XCHAIN', - args: [devnetAccount, devnetAccount, 0.05, `${1}`], - }, - // Needed if transaction goes in before fork-point of version `2.14` - { - name: 'coin.DEBIT', - args: [devnetAccount], - }, - ], - }, - `(coin.transfer-crosschain "${devnetAccount}" "${devnetAccount}" (read-keyset "test-keyset") "${1}" ${0.05})`, - devnetNetwork, - { 'test-keyset': { pred: 'keys-all', keys: [devnetKeyPair.publicKey] } }, -); - -const signedSampleCommand2: ICommand = ensureSignedCommand(sampleCommand2); - -const sendReq2: ISendRequestBody = { - cmds: [signedSampleCommand2], -}; - -function sleep20Seconds(): Promise { - return ((ms) => new Promise((resolve) => setTimeout(resolve, ms)))(20000); -} - -describe('[DevNet] Makes /send request of simple transaction', () => { - it('Receives request key of transaction', async () => { - const actual: Response | SendResponse = await send( - sendReq1, - devnetApiHostChain0, - ); - const expected: SendResponse = { - requestKeys: [signedSampleCommand1.hash], - }; - expect(actual).toEqual(expected); - }); -}); - -describe('[DevNet] Makes /send request to initiate a cross-chain transaction', () => { - test('Receives request key of transaction', async () => { - const actual: Response | SendResponse = await send( - sendReq2, - devnetApiHostChain0, - ); - const expected: SendResponse = { - requestKeys: [signedSampleCommand2.hash], - }; - expect(actual).toEqual(expected); - }); -}); - -describe('[DevNet] Makes /local request of simple transaction', () => { - it('Receives the expected transaction result', async () => { - const actual: ICommandResult | Response = await local( - signedSampleCommand1, - devnetApiHostChain0, - ); - const { logs, metaData, ...actualWithoutLogsAndMetaData } = - actual as ICommandResult; - const expected: Omit = { - reqKey: signedSampleCommand1.hash, - txId: null, - result: { - data: 3, - status: 'success', - }, - gas: 5, - continuation: null, - }; - expect(actualWithoutLogsAndMetaData).toEqual(expected); - expect(logs).toBeTruthy(); - expect(metaData?.publicMeta).toBeDefined(); - expect(metaData?.publicMeta?.chainId).toEqual('0'); - expect(metaData?.publicMeta?.sender).toEqual(devnetAccount); - }); -}); - -describe('[DevNet] Makes /poll request of simple transaction', () => { - it('Receives empty result while tx is still in mempool', async () => { - const actual: Response | IPollResponse = await poll( - createPollRequest(sendReq1), - devnetApiHostChain0, - ); - const expected: IPollResponse = {}; - expect(actual).toEqual(expected); - }); -}); - -// NOTE: Sets test timeout to 100 seconds (~2 min) since devnet blockrate is slower than -// pact-server. -jest.setTimeout(100000); -describe('[DevNet] Attempts to retrieve result of a simple transaction', () => { - const expectedResult: Omit = { - continuation: null, - gas: 5, - reqKey: signedSampleCommand1.hash, - result: { - data: 3, - status: 'success', - }, - }; - const expectedEvent: Array> = [ - { - module: { - name: 'coin', - namespace: null, - }, - name: 'TRANSFER', - params: [devnetAccount, devnetAccount, 0.00005], - }, - ]; - - it('Makes /listen request and retrieves expected result', async () => { - await backOff(() => - listen(createListenRequest(sendReq1), devnetApiHostChain0).then( - (actual: ICommandResult | Response) => { - const { logs, metaData, txId, events, ...resultWithoutDynamicData } = - actual as ICommandResult; - expect(logs).toBeTruthy(); - expect(txId).toBeTruthy(); - expect(metaData).toBeTruthy(); - if (events !== undefined && events.length !== 0) { - const { moduleHash, ...eventWithNoModHash } = events[0]; - expect([eventWithNoModHash]).toEqual(expectedEvent); - expect(moduleHash).toBeTruthy(); - } - expect(resultWithoutDynamicData).toEqual(expectedResult); - }, - ), - ); - }); - - it('Makes /poll request and retrieves expected result after /listen succeeds', async () => { - const actual = await poll(createPollRequest(sendReq1), devnetApiHostChain0); - const actualInArray = Object.values(actual).map((res) => { - const { logs, metaData, txId, events, ...resultWithoutDynamicData } = res; - expect(logs).toBeTruthy(); - expect(txId).toBeTruthy(); - expect(metaData).toBeTruthy(); - if (events !== undefined && events.length !== 0) { - const { moduleHash, ...eventWithNoModHash } = events[0]; - expect([eventWithNoModHash]).toEqual(expectedEvent); - expect(moduleHash).toBeTruthy(); - } - return resultWithoutDynamicData; - }); - expect(actualInArray).toEqual([expectedResult]); - }); -}); - -// NOTE: Sets test timeout to 300 seconds (5 min) since devnet blockrate is slower than -// pact-server. -jest.setTimeout(300000); -describe('[DevNet] Finishes a cross-chain transfer', () => { - it('Retrieves expected result of transaction that initiated the cross-chain', async () => { - const actual: ICommandResult | Response = await backOff(() => - listen(createListenRequest(sendReq2), devnetApiHostChain0), - ); - const { result } = actual as ICommandResult; - const { status } = result; - expect(status).toEqual('success'); - }); - - it('/spv fails because instance is too young', async () => { - const actual = spv( - { requestKey: signedSampleCommand2.hash, targetChainId: '1' }, - devnetApiHostChain0, - ); - const expected = - 'SPV target not reachable: target chain not reachable. Chainweb instance is too young'; - return expect(actual).rejects.toThrowError(expected); - }); - - it('Retrieves /spv proof after waiting some time and completes the cross-chain transfer', async () => { - // NOTE: sleep to prevent too young error. - await sleep20Seconds(); - await sleep20Seconds(); - await sleep20Seconds(); - await sleep20Seconds(); - - // Retrieve spv proof - const actualSPVProof: string | Response = await backOff(() => - spv( - { requestKey: signedSampleCommand2.hash, targetChainId: '1' }, - devnetApiHostChain0, - ), - ); - const proof = actualSPVProof as string; - const hash = signedSampleCommand2.hash; - - // Submit /send request finishing cross-chain transfer in target chain - const contReqPayload: IUnsignedCommand = createSampleContTx( - devnetNetwork, - devnetKeyPair, - hash, - {}, - proof.replace(/"/g, '').replace(/\\/g, ''), // NOTE: Prevents a Pact parsing error. - '1', - ); - const signedContReqPayload: ICommand = ensureSignedCommand(contReqPayload); - const contReq: ISendRequestBody = createSendRequest(signedContReqPayload); - const actualContSendResp: SendResponse | Response = await send( - contReq, - devnetApiHostChain1, - ); - const expectedContSendResp: SendResponse = { - requestKeys: [signedContReqPayload.hash], - }; - expect(actualContSendResp).toEqual(expectedContSendResp); - - // Retrieve result of finishing cross-chain transfer - const actualContResult: ICommandResult | Response = await backOff(() => - listen(createListenRequest(contReq), devnetApiHostChain1), - ); - const { result } = actualContResult as ICommandResult; - const { status } = result; - expect(status).toEqual('success'); - }); -}); diff --git a/packages/tools/integration-tests/src/tests/mock-txs.ts b/packages/tools/integration-tests/src/tests/mock-txs.ts deleted file mode 100644 index bcfea20341..0000000000 --- a/packages/tools/integration-tests/src/tests/mock-txs.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ChainwebChainId } from '@kadena/chainweb-node-client'; -import { - EnvData, - IKeyPair, - IMetaData, - IUnsignedCommand, - NetworkId, - PactTransactionHash, - Proof, -} from '@kadena/types'; - -import { prepareContCommand, prepareExecCommand } from 'kadena.js'; - -export function createSampleExecTx( - keyPair: IKeyPair, - pactCode: string, - network?: NetworkId, - envData?: EnvData, -): IUnsignedCommand { - const nonce: string = 'step01'; - const meta: IMetaData = { - creationTime: Math.round(new Date().getTime() / 1000) - 1, - ttl: 28800, - gasLimit: 10000, - chainId: '0', - gasPrice: 0.00001, - sender: `k:${keyPair.publicKey}`, - }; - return prepareExecCommand([keyPair], nonce, pactCode, meta, network, envData); -} - -export function createSampleContTx( - network: NetworkId, - keyPair: IKeyPair, - pactId: PactTransactionHash, - envData: EnvData, - proof: Proof, - targetChainId: ChainwebChainId, -): IUnsignedCommand { - const nonce: string = 'step02'; - const meta: IMetaData = { - creationTime: Math.round(new Date().getTime() / 1000) - 1, - ttl: 28800, - gasLimit: 10000, - chainId: targetChainId, - gasPrice: 0.00001, - sender: `k:${keyPair.publicKey}`, - }; - const step = 1; - const rollback = false; - return prepareContCommand( - [keyPair], - nonce, - proof, - pactId, - rollback, - step, - meta, - network, - envData, - ); -} diff --git a/packages/tools/integration-tests/src/tests/pact-server-test.test.ts b/packages/tools/integration-tests/src/tests/pact-server-test.test.ts deleted file mode 100644 index f7f4845aad..0000000000 --- a/packages/tools/integration-tests/src/tests/pact-server-test.test.ts +++ /dev/null @@ -1,115 +0,0 @@ -// Expects pact server to be running at http://127.0.0.1:9001. -// To run: `$ npm run start:pact`. -// Requires `pact` to be installed: https://github.com/kadena-io/pact - -import { - createListenRequest, - createPollRequest, - createSendRequest, - ICommandResult, - IPollResponse, - ISendRequestBody, - listen, - ListenResponse, - local, - poll, - send, - SendResponse, -} from '@kadena/chainweb-node-client'; -import { ensureSignedCommand } from '@kadena/pactjs'; -import { ICommand, IUnsignedCommand } from '@kadena/types'; - -import { createSampleExecTx } from './mock-txs'; - -const pactServerApiHost: string = 'http://127.0.0.1:9001'; -const pactServerKeyPair = { - publicKey: 'ba54b224d1924dd98403f5c751abdd10de6cd81b0121800bf7bdbdcfaec7388d', - secretKey: '8693e641ae2bbe9ea802c736f42027b03f86afe63cae315e7169c9c496c17332', -}; -const pactCode: string = '(+ 1 2)'; -const sampleCommand: IUnsignedCommand = createSampleExecTx( - pactServerKeyPair, - pactCode, -); -const signedSampleCommand: ICommand = ensureSignedCommand(sampleCommand); -const sendReq: ISendRequestBody = createSendRequest(signedSampleCommand); - -describe('[Pact Server] Makes /send request', () => { - it('Receives request key of transaction', async () => { - const actual: SendResponse | Response = await send( - sendReq, - pactServerApiHost, - ); - const expected = { - requestKeys: [signedSampleCommand.hash], - }; - expect(actual).toEqual(expected); - }); -}); - -describe('[Pact Server] Makes /local request', () => { - it('Receives the expected transaction result', async () => { - const actual: ICommandResult | Response = await local( - signedSampleCommand, - pactServerApiHost, - ); - const expected: ICommandResult = { - reqKey: signedSampleCommand.hash, - txId: null, - logs: 'wsATyGqckuIvlm89hhd2j4t6RMkCrcwJe_oeCYr7Th8', - result: { - data: 3, - status: 'success', - }, - gas: 0, - continuation: null, - metaData: null, - }; - expect(actual).toEqual(expected); - }); -}); - -describe('[Pact Server] Makes /poll request', () => { - it('Receives the expected transaction result', async () => { - const actual: IPollResponse | Response = await poll( - createPollRequest(sendReq), - pactServerApiHost, - ); - const actualInArray = Object.values(actual); - const expected: ICommandResult = { - continuation: null, - gas: 0, - logs: 'wsATyGqckuIvlm89hhd2j4t6RMkCrcwJe_oeCYr7Th8', - metaData: null, - reqKey: signedSampleCommand.hash, - result: { - data: 3, - status: 'success', - }, - txId: 0, - }; - expect(actualInArray).toEqual([expected]); - }); -}); - -describe('[Pact Server] Makes /listen request', () => { - it('Receives the expected transaction result', async () => { - const actual: Response | ICommandResult = await listen( - createListenRequest(sendReq), - pactServerApiHost, - ); - const expected: ListenResponse = { - continuation: null, - gas: 0, - logs: 'wsATyGqckuIvlm89hhd2j4t6RMkCrcwJe_oeCYr7Th8', - metaData: null, - reqKey: signedSampleCommand.hash, - result: { - data: 3, - status: 'success', - }, - txId: 0, - }; - expect(actual).toEqual(expected); - }); -}); diff --git a/packages/tools/integration-tests/src/tests/pact-server.conf b/packages/tools/integration-tests/src/tests/pact-server.conf deleted file mode 100644 index 0124c93c64..0000000000 --- a/packages/tools/integration-tests/src/tests/pact-server.conf +++ /dev/null @@ -1,5 +0,0 @@ -port: 9001 -logDir: log -persistDir: log -pragmas: [] -verbose: true diff --git a/packages/tools/integration-tests/tsconfig.json b/packages/tools/integration-tests/tsconfig.json deleted file mode 100644 index 65d7f18189..0000000000 --- a/packages/tools/integration-tests/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./node_modules/@kadena-dev/heft-rig/profiles/default/tsconfig-base.json", - "compilerOptions": { - "types": ["heft-jest", "node"] - } -} diff --git a/rush.json b/rush.json index 6b549880bc..63960cbc65 100644 --- a/rush.json +++ b/rush.json @@ -586,13 +586,6 @@ "shouldPublish": true }, - { - "packageName": "@kadena/integration-tests", - "projectFolder": "packages/tools/integration-tests", - "tags": ["tools"], - "shouldPublish": false - }, - { "packageName": "@kadena/pactjs-cli", "projectFolder": "packages/tools/pactjs-cli",