From 4ee44bef2fab01a97771ed46e40f9fee3b343aad Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sat, 27 Apr 2024 16:22:14 +1000 Subject: [PATCH 01/12] fix(wallet): origin if opened over file:// (cordova) --- src/AeSdkWallet.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AeSdkWallet.ts b/src/AeSdkWallet.ts index d88a9c402e..b51c95e00d 100644 --- a/src/AeSdkWallet.ts +++ b/src/AeSdkWallet.ts @@ -358,11 +358,12 @@ export default class AeSdkWallet extends AeSdk { * @returns Object with wallet information */ async getWalletInfo(): Promise { + const { origin } = window.location; return { id: this.id, name: this.name, networkId: await this.api.getNetworkId(), - origin: window.location.origin, + origin: origin === 'file://' ? '*' : origin, type: this._type, }; } From 8ce976e470fe67487079534671d854ccd7f0d080 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 28 Apr 2024 16:32:59 +1000 Subject: [PATCH 02/12] fix(aepp): don't require subscription to request addresses --- src/AeSdkAepp.ts | 2 +- test/integration/rpc.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/AeSdkAepp.ts b/src/AeSdkAepp.ts index 483ace100c..2e461b33b9 100644 --- a/src/AeSdkAepp.ts +++ b/src/AeSdkAepp.ts @@ -146,7 +146,7 @@ export default class AeSdkAepp extends AeSdkBase { * @returns Addresses from wallet */ async askAddresses(): Promise { - this._ensureAccountAccess(); + this._ensureConnected(); return this.rpcClient.request(METHODS.address, undefined); } diff --git a/test/integration/rpc.ts b/test/integration/rpc.ts index e950f0d158..cd20965aad 100644 --- a/test/integration/rpc.ts +++ b/test/integration/rpc.ts @@ -27,6 +27,7 @@ import { UnAuthorizedAccountError, UnknownRpcClientError, UnsubscribedAccountError, + RpcInternalError, AccountBase, verifyMessage, buildTx, @@ -183,7 +184,9 @@ describe('Aepp<->Wallet', function aeppWallet() { }); it('Try to ask for address', async () => { - await expect(aepp.askAddresses()).to.be.rejectedWith(UnsubscribedAccountError, 'You are not subscribed for an account.'); + await expect(aepp.askAddresses()).to.be.rejectedWith(RpcInternalError, 'The peer failed to execute your request due to unknown error'); + wallet.onAskAccounts = () => {}; + expect(await aepp.askAddresses()).to.be.eql(wallet.addresses()); }); it('Try to sign and send transaction to wallet without subscription', async () => { @@ -236,7 +239,7 @@ describe('Aepp<->Wallet', function aeppWallet() { expect(aepp.address).to.be.equal(account.address); }); - it('Ask for address: subscribed for accounts -> wallet deny', async () => { + it('Ask for address: exception in onAskAccounts -> wallet deny', async () => { wallet.onAskAccounts = () => { throw new RpcRejectedByUserError(); }; @@ -244,7 +247,7 @@ describe('Aepp<->Wallet', function aeppWallet() { .rejectedWith('Operation rejected by user').with.property('code', 4); }); - it('Ask for address: subscribed for accounts -> wallet accept', async () => { + it('Ask for address: no exception in onAskAccounts -> wallet accept', async () => { let checkPromise; wallet.onAskAccounts = (id, params, origin) => { checkPromise = Promise.resolve().then(() => { From 74db9bb68df997a10c1f7e4319616bb9b2a5612d Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Mon, 6 May 2024 21:33:58 +1000 Subject: [PATCH 03/12] fix(channel): remove `statePassword` unsupported on node side --- src/channel/internal.ts | 1 - test/integration/channel.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/channel/internal.ts b/src/channel/internal.ts index 8b51c17a36..2954eca3c0 100644 --- a/src/channel/internal.ts +++ b/src/channel/internal.ts @@ -174,7 +174,6 @@ export interface ChannelOptions { * Applicable only for responder (default: timeout_idle's value) */ timeoutAwaitingOpen?: number; - statePassword?: string; /** * Log websocket communication and state changes */ diff --git a/test/integration/channel.ts b/test/integration/channel.ts index 0636cfb111..eaff9f7497 100644 --- a/test/integration/channel.ts +++ b/test/integration/channel.ts @@ -100,7 +100,6 @@ async function waitForChannel(channel: Channel): Promise { host: 'localhost', port: 3114, lockPeriod: 1, - statePassword: 'correct horse battery staple', initiatorId: 'ak_', responderId: 'ak_', role: 'initiator', From 2b064d8a2969f93c33c345e1822aaea5678e5e09 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 7 May 2024 00:46:08 +1000 Subject: [PATCH 04/12] fix(channel): `channelId` type, more accurate types --- src/channel/Base.ts | 2 +- src/channel/internal.ts | 12 ++++++------ test/integration/channel.ts | 11 ++++++----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/channel/Base.ts b/src/channel/Base.ts index 2e13824c7f..9f8dd6d8c7 100644 --- a/src/channel/Base.ts +++ b/src/channel/Base.ts @@ -257,7 +257,7 @@ export default class Channel { * }) * ``` */ - async leave(): Promise<{ channelId: Encoded.Bytearray; signedTx: Encoded.Transaction }> { + async leave(): Promise<{ channelId: Encoded.Channel; signedTx: Encoded.Transaction }> { return this.enqueueAction(() => { notify(this, 'channels.leave'); return { handler: handlers.awaitingLeave }; diff --git a/src/channel/internal.ts b/src/channel/internal.ts index 2954eca3c0..188f1fe5bb 100644 --- a/src/channel/internal.ts +++ b/src/channel/internal.ts @@ -74,7 +74,7 @@ export interface ChannelOptions { /** * Initial deposit in favour of the responder by the initiator */ - pushAmount: number; + pushAmount: BigNumber | number; /** * Amount of coins the initiator has committed to the channel */ @@ -120,16 +120,16 @@ export interface ChannelOptions { */ gasPrice?: BigNumber | number; - signedTx?: string; + signedTx?: Encoded.Transaction; /** * Existing channel id (required if reestablishing a channel) */ - existingChannelId?: string; + existingChannelId?: Encoded.Channel; /** * Offchain transaction (required if reestablishing a channel) */ - offChainTx?: string; - reconnectTx?: string; + offChainTx?: Encoded.Transaction; + reconnectTx?: Encoded.Transaction; /** * The time waiting for a new event to be initiated (default: 600000) */ @@ -182,7 +182,7 @@ export interface ChannelOptions { * Function which verifies and signs transactions */ sign: SignTxWithTag; - offchainTx?: string; + offchainTx?: Encoded.Transaction; } export interface ChannelHandler extends Function { diff --git a/test/integration/channel.ts b/test/integration/channel.ts index eaff9f7497..6529f91b53 100644 --- a/test/integration/channel.ts +++ b/test/integration/channel.ts @@ -56,8 +56,6 @@ async function waitForChannel(channel: Channel): Promise { let initiatorCh: Channel; let responderCh: Channel; let responderShouldRejectUpdate: number | boolean; - let existingChannelId: Encoded.Bytearray; - let offchainTx: string; let contractAddress: Encoded.ContractAddress; let callerNonce: number; let contract: Contract<{}>; @@ -626,6 +624,8 @@ async function waitForChannel(channel: Channel): Promise { // TODO: check `initiatorAmountFinal` and `responderAmountFinal` }); + let existingChannelId: Encoded.Channel; + let offchainTx: Encoded.Transaction; it('can leave a channel', async () => { initiatorCh.disconnect(); responderCh.disconnect(); @@ -639,12 +639,11 @@ async function waitForChannel(channel: Channel): Promise { role: 'responder', sign: responderSignTag, }); - await Promise.all([waitForChannel(initiatorCh), waitForChannel(responderCh)]); initiatorCh.round(); // existingChannelRound const result = await initiatorCh.leave(); - result.channelId.should.be.a('string'); - result.signedTx.should.be.a('string'); + expect(result.channelId).to.satisfy((t: string) => t.startsWith('ch_')); + expect(result.signedTx).to.satisfy((t: string) => t.startsWith('tx_')); existingChannelId = result.channelId; offchainTx = result.signedTx; }); @@ -654,6 +653,7 @@ async function waitForChannel(channel: Channel): Promise { ...sharedParams, role: 'initiator', port: 3002, + // @ts-expect-error TODO: use existingChannelId instead existingFsmId existingFsmId: existingChannelId, offchainTx, sign: initiatorSignTag, @@ -1091,6 +1091,7 @@ async function waitForChannel(channel: Channel): Promise { await aeSdkInitiatior.sendTransaction(snapshotSoloTx); }); + // https://github.com/aeternity/protocol/blob/d634e7a3f3110657900759b183d0734e61e5803a/node/api/channels_api_usage.md#reestablish it('can reconnect', async () => { initiatorCh.disconnect(); responderCh.disconnect(); From cfdfd725f3753b06d3b458d971c980ac9b0f3596 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 7 May 2024 01:15:10 +1000 Subject: [PATCH 05/12] fix(channel): accept `host` only if initiator --- src/channel/internal.ts | 28 ++++++++++++++++++---------- test/integration/channel.ts | 8 ++++---- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/channel/internal.ts b/src/channel/internal.ts index 188f1fe5bb..a4a4ea4e83 100644 --- a/src/channel/internal.ts +++ b/src/channel/internal.ts @@ -52,7 +52,7 @@ export type SignTx = (tx: Encoded.Transaction, options?: SignOptions) => ( /** * @see {@link https://github.com/aeternity/protocol/blob/6734de2e4c7cce7e5e626caa8305fb535785131d/node/api/channels_api_usage.md#channel-establishing-parameters} */ -export interface ChannelOptions { +interface CommonChannelOptions { existingFsmId?: Encoded.Bytearray; /** * Channel url (for example: "ws://localhost:3001") @@ -92,17 +92,9 @@ export interface ChannelOptions { */ ttl?: number; /** - * Host of the responder's node - */ - host: string; - /** - * The port of the responders node + * The port of the responder's node */ port: number; - /** - * Participant role - */ - role: 'initiator' | 'responder'; /** * How to calculate minimum depth (default: txfee) */ @@ -185,6 +177,22 @@ export interface ChannelOptions { offchainTx?: Encoded.Transaction; } +export type ChannelOptions = CommonChannelOptions & ({ + /** + * Participant role + */ + role: 'initiator'; + /** + * Host of the responder's node + */ + host: string; +} | { + /** + * Participant role + */ + role: 'responder'; +}); + export interface ChannelHandler extends Function { enter?: Function; } diff --git a/test/integration/channel.ts b/test/integration/channel.ts index 6529f91b53..0701a77f4c 100644 --- a/test/integration/channel.ts +++ b/test/integration/channel.ts @@ -24,7 +24,7 @@ import { } from '../../src'; import { pause } from '../../src/utils/other'; import { - ChannelOptions, notify, SignTx, SignTxWithTag, + notify, SignTx, SignTxWithTag, } from '../../src/channel/internal'; import { appendSignature } from '../../src/channel/handlers'; import { assertNotNull, ensureEqual } from '../utils'; @@ -88,7 +88,7 @@ async function waitForChannel(channel: Channel): Promise { assertNotNull(signedTx); return buildTx(signedTx); }; - const sharedParams: Omit = { + const sharedParams = { url: channelUrl, pushAmount: 3, initiatorAmount: 1e15, @@ -98,8 +98,8 @@ async function waitForChannel(channel: Channel): Promise { host: 'localhost', port: 3114, lockPeriod: 1, - initiatorId: 'ak_', - responderId: 'ak_', + initiatorId: 'ak_' as Encoded.AccountAddress, + responderId: 'ak_' as Encoded.AccountAddress, role: 'initiator', minimumDepth: 0, }; From 15063c68bbd4f6918648d9f23c069861d39dad98 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 11 Jun 2024 14:33:45 +1000 Subject: [PATCH 06/12] fix(aens): validate minus chars in name as node does --- src/tx/builder/helpers.ts | 9 +++++++++ test/unit/aens.ts | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/tx/builder/helpers.ts b/src/tx/builder/helpers.ts index 0a1c0693a9..f959e821d8 100644 --- a/src/tx/builder/helpers.ts +++ b/src/tx/builder/helpers.ts @@ -70,6 +70,15 @@ export function nameToPunycode(maybeName: string): AensName { if (/\p{Emoji_Presentation}/u.test(name)) { throw new ArgumentError('aens name', 'not containing emoji', maybeName); } + if (name[2] === '-' && name[3] === '-') { + throw new ArgumentError('aens name', 'without "-" char in both the third and fourth positions', maybeName); + } + if (name[0] === '-') { + throw new ArgumentError('aens name', 'starting with no "-" char', maybeName); + } + if (name.at(-1) === '-') { + throw new ArgumentError('aens name', 'ending with no "-" char', maybeName); + } let punycode; try { const u = new URL(`http://${name}.${suffix}`); diff --git a/test/unit/aens.ts b/test/unit/aens.ts index 5f03383635..fad5510260 100644 --- a/test/unit/aens.ts +++ b/test/unit/aens.ts @@ -295,6 +295,18 @@ describe('AENS utils', () => { expect(() => ensureName('ldiDxa1Yxy1iiTRztYEN4F8nrnfZib3Q1MllPghmst8fjJ1sI3DXzOoAddE2ETxp.chain')) .to.throw(ArgumentError, 'aens name should be not too long, got ldiDxa1Yxy1iiTRztYEN4F8nrnfZib3Q1MllPghmst8fjJ1sI3DXzOoAddE2ETxp.chain instead'); }); + + it('fails if name starts or ends with minus', () => { + expect(() => ensureName('-test.chain')) + .to.throw(ArgumentError, 'aens name should be starting with no "-" char, got -test.chain instead'); + expect(() => ensureName('test-.chain')) + .to.throw(ArgumentError, 'aens name should be ending with no "-" char, got test-.chain instead'); + }); + + it('fails if name has minus at 2, 3 chars', () => { + expect(() => ensureName('te--st.chain')) + .to.throw(ArgumentError, 'aens name should be without "-" char in both the third and fourth positions, got te--st.chain instead'); + }); }); describe('isAuctionName', () => { From 0524553267162be30476b2ccebdd3f2633e9bb73 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Fri, 14 Jun 2024 10:47:24 +1000 Subject: [PATCH 07/12] fix(account): improve Account:publicKey type --- src/utils/hd-wallet.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/hd-wallet.ts b/src/utils/hd-wallet.ts index 20b63ad213..00837ca713 100644 --- a/src/utils/hd-wallet.ts +++ b/src/utils/hd-wallet.ts @@ -2,7 +2,9 @@ import nacl from 'tweetnacl'; import { full as hmac } from 'tweetnacl-auth'; import { fromString } from 'bip32-path'; import aesjs from 'aes-js'; -import { sha256hash, encode, Encoding } from './encoder'; +import { + sha256hash, encode, Encoding, Encoded, +} from './encoder'; import { CryptographyError } from './errors'; import { concatBuffers } from './other'; @@ -58,8 +60,8 @@ interface HDWallet { } interface Account { - secretKey: string; - publicKey: string; + secretKey: string; // TODO: use Encoded.AccountSecretKey instead hex + publicKey: Encoded.AccountAddress; } type Dec = [-1, 0, 1, 2, 3, 4][N]; From 1ef43e63fd2a75b891d3b13de03db67b6e5fac0d Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 17 Jul 2024 13:35:11 +1000 Subject: [PATCH 08/12] fix: don't allow upgrades `@ledgerhq/hw-transport` to 6.31.0 That version requires `@types/node@20` which is incompatible with TypeScript@4.1. --- package-lock.json | 26 +++++++++++++------------- package.json | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index efa58bdfca..d4a7312144 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@azure/core-client": "^1.8.0", "@azure/core-rest-pipeline": "^1.14.0", "@babel/runtime-corejs3": "^7.24.0", - "@ledgerhq/hw-transport": "^6.30.4", + "@ledgerhq/hw-transport": "~6.30.6", "@types/aes-js": "^3.1.4", "@types/json-bigint": "^1.0.4", "@types/node": "~18.13", @@ -2869,11 +2869,11 @@ } }, "node_modules/@ledgerhq/devices": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.2.1.tgz", - "integrity": "sha512-l/2I/Xzt7Z32OmGzoc/mUvaZivdn7Id/SO7hBTGpk7PtJTpBRxVAabP4GWEKCayGyOAcvTwoVxM0HMkNVfIzOQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.4.0.tgz", + "integrity": "sha512-TUrMlWZJ+5AFp2lWMw4rGQoU+WtjIqlFX5SzQDL9phaUHrt4TFierAGHsaj5+tUHudhD4JhIaLI2cn1NOyq5NQ==", "dependencies": { - "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/errors": "^6.17.0", "@ledgerhq/logs": "^6.12.0", "rxjs": "^7.8.1", "semver": "^7.3.5" @@ -2910,17 +2910,17 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@ledgerhq/errors": { - "version": "6.16.2", - "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.2.tgz", - "integrity": "sha512-jFpohaSW+p1Obp3NDT9QSByEtT3gtBZIjVNu8m25gnrH5zdtfPVlPwH6UiuS50s+2dHQyehV8hF+IfreKDWAZA==" + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.17.0.tgz", + "integrity": "sha512-xnOVpy/gUUkusEORdr2Qhw3Vd0MGfjyVGgkGR9Ck6FXE26OIdIQ3tNmG5BdZN+gwMMFJJVxxS4/hr0taQfZ43w==" }, "node_modules/@ledgerhq/hw-transport": { - "version": "6.30.4", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.4.tgz", - "integrity": "sha512-VBcVd7UG8HDrjWMoZI5rqBDz+PBxLHTIPZOGY/fdMoEUwaBbss0Z3MxuJanMyerlfaLqnBSVuL0blz7rOyagkw==", + "version": "6.30.6", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.6.tgz", + "integrity": "sha512-fT0Z4IywiuJuZrZE/+W0blkV5UCotDPFTYKLkKCLzYzuE6javva7D/ajRaIeR+hZ4kTmKF4EqnsmDCXwElez+w==", "dependencies": { - "@ledgerhq/devices": "^8.2.1", - "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/devices": "^8.3.0", + "@ledgerhq/errors": "^6.16.4", "@ledgerhq/logs": "^6.12.0", "events": "^3.3.0" } diff --git a/package.json b/package.json index 7a817bcb0a..d09c10cec4 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@azure/core-client": "^1.8.0", "@azure/core-rest-pipeline": "^1.14.0", "@babel/runtime-corejs3": "^7.24.0", - "@ledgerhq/hw-transport": "^6.30.4", + "@ledgerhq/hw-transport": "~6.30.6", "@types/aes-js": "^3.1.4", "@types/json-bigint": "^1.0.4", "@types/node": "~18.13", From 03058d4a26d2573aa5dd33915c86eb6140de42ff Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 17 Jul 2024 15:04:10 +1000 Subject: [PATCH 09/12] fix: don't allow upgrades `@azure/core-rest-pipeline` New versions contain syntax unsupported in TypeScript@4.4. --- package-lock.json | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4a7312144..1b4cf22a29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,8 @@ "@aeternity/argon2": "^0.0.1", "@aeternity/uuid": "^0.0.1", "@azure/core-client": "^1.8.0", - "@azure/core-rest-pipeline": "^1.14.0", + "@azure/core-rest-pipeline": "~1.14.0", + "@azure/logger": "~1.0.4", "@babel/runtime-corejs3": "^7.24.0", "@ledgerhq/hw-transport": "~6.30.6", "@types/aes-js": "^3.1.4", diff --git a/package.json b/package.json index d09c10cec4..5205569e43 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,8 @@ "@aeternity/argon2": "^0.0.1", "@aeternity/uuid": "^0.0.1", "@azure/core-client": "^1.8.0", - "@azure/core-rest-pipeline": "^1.14.0", + "@azure/core-rest-pipeline": "~1.14.0", + "@azure/logger": "~1.0.4", "@babel/runtime-corejs3": "^7.24.0", "@ledgerhq/hw-transport": "~6.30.6", "@types/aes-js": "^3.1.4", From 8f7eaea83cd41dcec07cd1d501f1f720fd3ba0fe Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 17 Jul 2024 15:26:18 +1000 Subject: [PATCH 10/12] ci: build assets if release branch --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0da07df467..93e512cffe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,8 @@ jobs: BASE: ${{ github.event.pull_request.base.sha }} run: npx commitlint --from $BASE --to $HEAD --verbose - run: npm run lint + - run: npm run docs:examples && npm run docs:api && ./docs/build-assets.sh + if: contains(github.event.pull_request.title, 'Release') - run: docker compose up -d --wait - run: npx nyc npm test - run: npx nyc report --reporter=text-lcov > coverage.lcov From af6ae29c404e4c279c5e2f99f30dac46e1769acd Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 7 May 2024 02:25:56 +1000 Subject: [PATCH 11/12] test: fix mdw and reduce global timeout --- .mocharc.js | 2 +- test/integration/Middleware.ts | 3 +++ test/integration/MiddlewareSubscriber.ts | 8 ++++---- test/integration/compiler.ts | 4 ++-- test/integration/rpc.ts | 3 +-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.mocharc.js b/.mocharc.js index 06a56b266e..0cee50ca89 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -2,7 +2,7 @@ module.exports = { require: 'tooling/babel-register.js', recursive: true, extension: '.js,.ts', - timeout: process.env.NETWORK ? '500s' : '40s', + timeout: process.env.NETWORK ? '500s' : '8s', ignore: 'test/environment/**', exit: true // TODO: fix in state channel tests } diff --git a/test/integration/Middleware.ts b/test/integration/Middleware.ts index 1ded1cff17..ab761eb061 100644 --- a/test/integration/Middleware.ts +++ b/test/integration/Middleware.ts @@ -42,6 +42,7 @@ describe('Middleware API', () => { payload: { block_hash: 'mh_LAo6Cg6d8LGDpxJ3se2aGJZbCubDZyC6GonHK58MKiW4a4LWb', block_height: 779178, + encoded_tx: 'tx_+QEKCwHAuQEE+QEBUQKhAR1BkBtnVYcqjIhl7aOh9hEy9W96OFTeeQreTa3ExE/auG8rEWzyVws7Ap8AoLb4BE1sdD+LZw3SM+libDajr+a976yRMKi9b7k5whrinwEBAFGw3Ke65y52/KhwL5lYHOlRuOIZZy2V190M5H1ywIgN5fAylDfLImUL3WDwC4UAHa6EcyMc3Pl8apaHFuO79AMDhkduhMz4AILDUIQ7msoAuFr4WAsBwLhT+FEMAaEBHUGQG2dVhyqMiGXto6H2ETL1b3o4VN55Ct5NrcTET9qhAUCcLjbyYA3yE1vkfr0zC0M4oNrQ3lNoPHDD6EzUnVzAcIYPJvVhyAAAAIAv4MYN', hash: 'th_YHj5aB6JzHciY5f6jqgtso8u2iY9p6MT9RV96FwXQNS1MpSML', micro_index: 18, micro_time: 1684995426848, @@ -79,6 +80,7 @@ describe('Middleware API', () => { payload: { block_hash: 'mh_2R1PVwTNP3Jha7oRby9Me3SRBP4R9he6RMH6eCCJGyVBHAzy5f', block_height: 779178, + encoded_tx: 'tx_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', hash: 'th_AScnu6AAGHvfewMELKvmc6KH9jaMfzopGpcFFo1HAoS7ne1fD', micro_index: 11, micro_time: 1684995366595, @@ -118,6 +120,7 @@ describe('Middleware API', () => { payload: { block_hash: 'mh_25snWYwTkU1xjPCcH592XVNzL894qSpF4yqnt8tABKGEVm6nSz', block_height: 779178, + encoded_tx: 'tx_+K4LAfhCuEBjZgd36W2H8rB5KZzut7wvRnAsjJSD+CEg8Dbm8ivFXmDzKFauG8QJpnm9kmVnNl0xOI7xVsm0brXYTMNuAmUDuGb4ZAwBoQHhMrjx3begTmO3+pZHmlS7xSWlMafxvAzkkhIZAwZ/sKEBHUGQG2dVhyqMiGXto6H2ETL1b3o4VN55Ct5NrcTET9qIRWORgkT0AACGD39vJaAAAIKQmIlGYXVjZXQgVHiaKLKm', hash: 'th_242zV1qXwag6iBH3Pd8zn3DQC37h4uP38CoFjkaTgT19AVKMHo', micro_index: 7, micro_time: 1684995336526, diff --git a/test/integration/MiddlewareSubscriber.ts b/test/integration/MiddlewareSubscriber.ts index f60f27dcb9..ae73067091 100644 --- a/test/integration/MiddlewareSubscriber.ts +++ b/test/integration/MiddlewareSubscriber.ts @@ -125,7 +125,7 @@ describe('MiddlewareSubscriber', () => { }), ]); expect(transaction).to.be.eql(await fetchNodeRaw(`transactions/${hash}`)); - }).timeout(80_000); + }); // TODO: enable after fixing https://github.com/aeternity/ae_mdw/issues/1337 it.skip('subscribes for account', async () => { @@ -138,7 +138,7 @@ describe('MiddlewareSubscriber', () => { }); }); expect(transaction).to.be.eql(await fetchNodeRaw(`transactions/${hash}`)); - }).timeout(80_000); + }); // TODO: enable after solving https://github.com/aeternity/ae_mdw/issues/1336 it.skip('subscribes for micro block', async () => { @@ -153,7 +153,7 @@ describe('MiddlewareSubscriber', () => { }), ]); expect(microBlock).to.be.eql(await fetchNodeRaw(`micro-blocks/hash/${blockHash}/header`)); - }).timeout(80_000); + }); // TODO: enable after solving https://github.com/aeternity/ae_mdw/issues/1336 it.skip('subscribes simultaneously for micro block', async () => { @@ -177,5 +177,5 @@ describe('MiddlewareSubscriber', () => { ]); expect(transaction).to.be.eql(await fetchNodeRaw(`transactions/${hash}`)); expect(microBlock).to.be.eql(await fetchNodeRaw(`micro-blocks/hash/${blockHash}/header`)); - }).timeout(80_000); + }); }); diff --git a/test/integration/compiler.ts b/test/integration/compiler.ts index 9f3049627f..00b20972ec 100644 --- a/test/integration/compiler.ts +++ b/test/integration/compiler.ts @@ -166,9 +166,9 @@ describe('CompilerHttp', () => { }); it('throws exception if used invalid compiler url', async () => { - const c = new CompilerHttpNode('https://compiler.aepps.comas'); + const c = new CompilerHttpNode('https://compilaer.aepps.com'); await expect(c.compileBySourceCode('test')) - .to.be.rejectedWith('getaddrinfo ENOTFOUND compiler.aepps.comas'); + .to.be.rejectedWith('getaddrinfo ENOTFOUND compilaer.aepps.com'); }); describe('getFileSystem', () => { diff --git a/test/integration/rpc.ts b/test/integration/rpc.ts index cd20965aad..e62c27847c 100644 --- a/test/integration/rpc.ts +++ b/test/integration/rpc.ts @@ -73,8 +73,7 @@ const getConnections = (): { walletWindow: ImplPostMessage; aeppWindow: ImplPost return { walletWindow, aeppWindow }; }; -describe('Aepp<->Wallet', function aeppWallet() { - this.timeout(8000); +describe('Aepp<->Wallet', () => { const connections = getConnections(); const connectionFromWalletToAepp = new BrowserWindowMessageConnection({ self: connections.walletWindow, From c8fe1489c86ee714d7129dc15bb1835727e0385d Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 17 Jul 2024 16:04:20 +1000 Subject: [PATCH 12/12] chore(release): 13.3.3 --- docs/CHANGELOG.md | 15 +++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index dfd0f77442..2e37f93b38 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [13.3.3](https://github.com/aeternity/aepp-sdk-js/compare/v13.3.2...v13.3.3) (2024-07-17) + + +### Bug Fixes + +* **account:** improve Account:publicKey type ([0524553](https://github.com/aeternity/aepp-sdk-js/commit/0524553267162be30476b2ccebdd3f2633e9bb73)) +* **aens:** validate minus chars in name as node does ([15063c6](https://github.com/aeternity/aepp-sdk-js/commit/15063c68bbd4f6918648d9f23c069861d39dad98)) +* **aepp:** don't require subscription to request addresses ([8ce976e](https://github.com/aeternity/aepp-sdk-js/commit/8ce976e470fe67487079534671d854ccd7f0d080)) +* **channel:** `channelId` type, more accurate types ([2b064d8](https://github.com/aeternity/aepp-sdk-js/commit/2b064d8a2969f93c33c345e1822aaea5678e5e09)) +* **channel:** accept `host` only if initiator ([cfdfd72](https://github.com/aeternity/aepp-sdk-js/commit/cfdfd725f3753b06d3b458d971c980ac9b0f3596)) +* **channel:** remove `statePassword` unsupported on node side ([74db9bb](https://github.com/aeternity/aepp-sdk-js/commit/74db9bb68df997a10c1f7e4319616bb9b2a5612d)) +* don't allow upgrades `@azure/core-rest-pipeline` ([03058d4](https://github.com/aeternity/aepp-sdk-js/commit/03058d4a26d2573aa5dd33915c86eb6140de42ff)) +* don't allow upgrades `@ledgerhq/hw-transport` to 6.31.0 ([1ef43e6](https://github.com/aeternity/aepp-sdk-js/commit/1ef43e63fd2a75b891d3b13de03db67b6e5fac0d)) +* **wallet:** origin if opened over file:// (cordova) ([4ee44be](https://github.com/aeternity/aepp-sdk-js/commit/4ee44bef2fab01a97771ed46e40f9fee3b343aad)) + ### [13.3.2](https://github.com/aeternity/aepp-sdk-js/compare/v13.3.1...v13.3.2) (2024-04-22) diff --git a/package-lock.json b/package-lock.json index 1b4cf22a29..ac02ace3fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aeternity/aepp-sdk", - "version": "13.3.2", + "version": "13.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aeternity/aepp-sdk", - "version": "13.3.2", + "version": "13.3.3", "license": "ISC", "dependencies": { "@aeternity/aepp-calldata": "^1.7.0", diff --git a/package.json b/package.json index 5205569e43..9b8e7ba599 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aeternity/aepp-sdk", - "version": "13.3.2", + "version": "13.3.3", "description": "SDK for the æternity blockchain", "main": "dist/aepp-sdk.js", "types": "es/index.d.ts",