From 7367867feed298e6ad76582b9a68dfe99b557f9b Mon Sep 17 00:00:00 2001 From: blaineheffron Date: Tue, 28 May 2024 18:17:34 -0400 Subject: [PATCH 1/9] convert ava tests to mocha, remove ava dependency Signed-off-by: blaineheffron --- package.json | 19 +- .../src/test-contract-client-constructor.js | 71 ++- test/e2e/src/test-custom-types.js | 455 ++++++++-------- test/e2e/src/test-hello-world.js | 55 +- test/e2e/src/test-methods-as-args.js | 12 +- test/e2e/src/test-swap.js | 310 +++++------ yarn.lock | 508 ++---------------- 7 files changed, 494 insertions(+), 936 deletions(-) diff --git a/package.json b/package.json index 91e876e72..c0e1d331c 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/ jsdoc/ test/e2e/.soroban", "docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json --verbose", "test": "yarn build:test && yarn test:node && yarn test:integration && yarn test:browser", - "test:e2e": "./test/e2e/initialize.sh && ava", + "test:e2e": "./test/e2e/initialize.sh && yarn _nyc mocha --recursive 'test/e2e/src/test-*.js'", "test:node": "yarn _nyc mocha --recursive 'test/unit/**/*.js'", "test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'", "test:browser": "karma start config/karma.conf.js", @@ -75,14 +75,15 @@ "reporter": "spec", "require": [ "@babel/register", - "test/test-nodejs.js" + "test/test-nodejs.js", + "dotenv/config" ], "exclude": [ "test/test-browser.js" ], "sort": true, "recursive": true, - "timeout": 30000 + "timeout": 120000 }, "nyc": { "instrument": false, @@ -111,8 +112,7 @@ "@types/randombytes": "^2.0.1", "@types/sinon": "^17.0.2", "@types/urijs": "^1.19.20", - "@typescript-eslint/parser": "^7.11.0", - "ava": "^5.3.1", + "@typescript-eslint/parser": "^7.7.1", "axios-mock-adapter": "^1.22.0", "babel-loader": "^9.1.3", "babel-plugin-istanbul": "^6.1.1", @@ -169,14 +169,5 @@ "randombytes": "^2.1.0", "toml": "^3.0.0", "urijs": "^1.19.1" - }, - "ava": { - "files": [ - "./test/e2e/src/test-*" - ], - "require": [ - "dotenv/config" - ], - "timeout": "2m" } } diff --git a/test/e2e/src/test-contract-client-constructor.js b/test/e2e/src/test-contract-client-constructor.js index 60e0069bd..39d7ce721 100644 --- a/test/e2e/src/test-contract-client-constructor.js +++ b/test/e2e/src/test-contract-client-constructor.js @@ -1,18 +1,12 @@ -const test = require("ava"); +const assert = require("assert"); const { spawnSync } = require("node:child_process"); const { contracts, networkPassphrase, rpcUrl, - friendbotUrl, + generateFundedKeypair, } = require("./util"); -const { Address, contract, Keypair } = require("../../.."); - -async function generateFundedKeypair() { - const keypair = Keypair.random(); - await fetch(`${friendbotUrl}/friendbot?addr=${keypair.publicKey()}`); - return keypair; -} +const { Address, contract } = require("../../.."); /** * Generates a Client for the contract with the given name. @@ -56,6 +50,7 @@ async function clientFromConstructor( } // TODO: do this with js-stellar-sdk, instead of shelling out to the CLI + contractId = contractId ?? spawnSync( @@ -104,33 +99,37 @@ async function clientForFromTest(contractId, publicKey, keypair) { return contract.Client.from(options); } -test.before(async (t) => { - const { client, keypair, contractId } = - await clientFromConstructor("customTypes"); - const publicKey = keypair.publicKey(); - const addr = Address.fromString(publicKey); - t.context = { client, publicKey, addr, contractId, keypair }; // eslint-disable-line no-param-reassign -}); +describe('Contract Tests', function() { + let context = {}; -test("hello from constructor", async (t) => { - const { result } = await t.context.client.hello({ hello: "tests" }); - t.is(result, "tests"); -}); + before(async function() { + const { client, keypair, contractId } = + await clientFromConstructor("customTypes"); + const publicKey = keypair.publicKey(); + const addr = Address.fromString(publicKey); + context = { client, publicKey, addr, contractId, keypair }; + }); -test("from", async (t) => { - // objects with different constructors will not pass deepEqual check - function constructorWorkaround(object) { - return JSON.parse(JSON.stringify(object)); - } + it("hello from constructor", async function() { + const { result } = await context.client.hello({ hello: "tests" }); + assert.strictEqual(result, "tests"); + }); - const clientFromFrom = await clientForFromTest( - t.context.contractId, - t.context.publicKey, - t.context.keypair, - ); - t.deepEqual( - constructorWorkaround(clientFromFrom), - constructorWorkaround(t.context.client), - ); - t.deepEqual(t.context.client.spec.entries, clientFromFrom.spec.entries); -}); + it("from", async function() { + // objects with different constructors will not pass deepEqual check + function constructorWorkaround(object) { + return JSON.parse(JSON.stringify(object)); + } + + const clientFromFrom = await clientForFromTest( + context.contractId, + context.publicKey, + context.keypair, + ); + assert.deepStrictEqual( + constructorWorkaround(clientFromFrom), + constructorWorkaround(context.client), + ); + assert.deepStrictEqual(context.client.spec.entries, clientFromFrom.spec.entries); + }); +}); \ No newline at end of file diff --git a/test/e2e/src/test-custom-types.js b/test/e2e/src/test-custom-types.js index 6fa1d7045..ea350f74d 100644 --- a/test/e2e/src/test-custom-types.js +++ b/test/e2e/src/test-custom-types.js @@ -1,226 +1,237 @@ -const test = require("ava"); +const { expect } = require('chai'); const { Address, contract } = require("../../.."); const { clientFor } = require("./util"); -test.before(async (t) => { - const { client, keypair, contractId } = await clientFor("customTypes"); - const publicKey = keypair.publicKey(); - const addr = Address.fromString(publicKey); - t.context = { client, publicKey, addr, contractId, keypair }; // eslint-disable-line no-param-reassign -}); - -test("hello", async (t) => { - const { result } = await t.context.client.hello({ hello: "tests" }); - t.is(result, "tests"); -}); -test("view method with empty keypair", async (t) => { - const { client: client2 } = await clientFor("customTypes", { - keypair: undefined, - contractId: t.context.contractId, - }); - t.is((await client2.hello({ hello: "anonymous" })).result, "anonymous"); -}); - -test("woid", async (t) => { - t.is((await t.context.client.woid()).result, null); -}); - -test("u32_fail_on_even", async (t) => { - t.deepEqual( - (await t.context.client.u32_fail_on_even({ u32_: 1 })).result, - new contract.Ok(1), - ); - t.deepEqual( - (await t.context.client.u32_fail_on_even({ u32_: 2 })).result, - new contract.Err({ message: "Please provide an odd number" }), - ); -}); - -test("u32", async (t) => { - t.is((await t.context.client.u32_({ u32_: 1 })).result, 1); // eslint-disable-line no-underscore-dangle -}); - -test("i32", async (t) => { - t.is((await t.context.client.i32_({ i32_: 1 })).result, 1); // eslint-disable-line no-underscore-dangle -}); - -test("i64", async (t) => { - t.is((await t.context.client.i64_({ i64_: 1n })).result, 1n); // eslint-disable-line no-underscore-dangle -}); - -test("strukt_hel", async (t) => { - const strukt = { a: 0, b: true, c: "world" }; - t.deepEqual((await t.context.client.strukt_hel({ strukt })).result, [ - "Hello", - "world", - ]); -}); - -test("strukt", async (t) => { - const strukt = { a: 0, b: true, c: "hello" }; - t.deepEqual((await t.context.client.strukt({ strukt })).result, strukt); -}); - -test("simple first", async (t) => { - const simple = { tag: "First", values: undefined }; - const ret = { tag: "First" }; - t.deepEqual((await t.context.client.simple({ simple })).result, ret); -}); - -test("simple second", async (t) => { - const simple = { tag: "Second", values: undefined }; - const ret = { tag: "Second" }; - t.deepEqual((await t.context.client.simple({ simple })).result, ret); -}); - -test("simple third", async (t) => { - const simple = { tag: "Third", values: undefined }; - const ret = { tag: "Third" }; - t.deepEqual((await t.context.client.simple({ simple })).result, ret); -}); - -test("complex with struct", async (t) => { - const arg = { tag: "Struct", values: [{ a: 0, b: true, c: "hello" }] }; - t.deepEqual((await t.context.client.complex({ complex: arg })).result, arg); -}); - -test("complex with tuple", async (t) => { - const arg = { - tag: "Tuple", - values: [ - [ - { a: 0, b: true, c: "hello" }, - { tag: "First", values: undefined }, + +describe("Custom Types Tests", function() { + before(async function() { + const { client, keypair, contractId } = await clientFor("customTypes"); + const publicKey = keypair.publicKey(); + const addr = Address.fromString(publicKey); + this.context = { client, publicKey, addr, contractId, keypair }; + }); + + it("hello", async function() { + const { result } = await this.context.client.hello({ hello: "tests" }); + expect(result).to.equal("tests"); + }); + + it("view method with empty keypair", async function() { + const { client: client2 } = await clientFor("customTypes", { + keypair: undefined, + contractId: this.context.contractId, + }); + const { result } = await client2.hello({ hello: "anonymous" }); + expect(result).to.equal("anonymous"); + }); + + it("woid", async function() { + const { result } = await this.context.client.woid(); + expect(result).to.be.null; + }); + + it("u32_fail_on_even", async function() { + let response = await this.context.client.u32_fail_on_even({ u32_: 1 }); + expect(response.result).to.deep.equal(new contract.Ok(1)); + + response = await this.context.client.u32_fail_on_even({ u32_: 2 }); + expect(response.result).to.deep.equal(new contract.Err({ message: "Please provide an odd number" })); + }); + + it("u32", async function() { + const { result } = await this.context.client.u32_({ u32_: 1 }); + expect(result).to.equal(1); + }); + + it("i32", async function() { + const { result } = await this.context.client.i32_({ i32_: 1 }); + expect(result).to.equal(1); + }); + + it("i64", async function() { + const { result } = await this.context.client.i64_({ i64_: 1n }); + expect(result).to.equal(1n); + }); + + it("strukt_hel", async function() { + const strukt = { a: 0, b: true, c: "world" }; + const { result } = await this.context.client.strukt_hel({ strukt }); + expect(result).to.deep.equal(["Hello", "world"]); + }); + + it("strukt", async function() { + const strukt = { a: 0, b: true, c: "hello" }; + const { result } = await this.context.client.strukt({ strukt }); + expect(result).to.deep.equal(strukt); + }); + + it("simple first", async function() { + const simple = { tag: "First", values: undefined }; + const { result } = await this.context.client.simple({ simple }); + expect(result).to.deep.equal({ tag: "First" }); + }); + + it("simple second", async function() { + const simple = { tag: "Second", values: undefined }; + const { result } = await this.context.client.simple({ simple }); + expect(result).to.deep.equal({ tag: "Second" }); + }); + + it("simple third", async function() { + const simple = { tag: "Third", values: undefined }; + const { result } = await this.context.client.simple({ simple }); + expect(result).to.deep.equal({ tag: "Third" }); + }); + + it("complex with struct", async function() { + const arg = { tag: "Struct", values: [{ a: 0, b: true, c: "hello" }] }; + const { result } = await this.context.client.complex({ complex: arg }); + expect(result).to.deep.equal(arg); + }); + + it("complex with tuple", async function() { + const arg = { + tag: "Tuple", + values: [ + [ + { a: 0, b: true, c: "hello" }, + { tag: "First", values: undefined }, + ], ], - ], - }; - const ret = { - tag: "Tuple", - values: [[{ a: 0, b: true, c: "hello" }, { tag: "First" }]], - }; - t.deepEqual((await t.context.client.complex({ complex: arg })).result, ret); -}); - -test("complex with enum", async (t) => { - const arg = { tag: "Enum", values: [{ tag: "First", values: undefined }] }; - const ret = { tag: "Enum", values: [{ tag: "First" }] }; - t.deepEqual((await t.context.client.complex({ complex: arg })).result, ret); -}); - -test("complex with asset", async (t) => { - const arg = { tag: "Asset", values: [t.context.publicKey, 1n] }; - t.deepEqual((await t.context.client.complex({ complex: arg })).result, arg); -}); - -test("complex with void", async (t) => { - const complex = { tag: "Void", values: undefined }; - const ret = { tag: "Void" }; - t.deepEqual((await t.context.client.complex({ complex })).result, ret); -}); - -test("addresse", async (t) => { - t.deepEqual( - (await t.context.client.addresse({ addresse: t.context.publicKey })).result, - t.context.addr.toString(), - ); -}); - -test("bytes", async (t) => { - const bytes = Buffer.from("hello"); - t.deepEqual((await t.context.client.bytes({ bytes })).result, bytes); -}); - -test("bytesN", async (t) => { - const bytesN = Buffer.from("123456789"); // what's the correct way to construct bytesN? - t.deepEqual( - (await t.context.client.bytes_n({ bytes_n: bytesN })).result, - bytesN, - ); -}); - -test("card", async (t) => { - const card = 11; - t.is((await t.context.client.card({ card })).result, card); -}); - -test("boolean", async (t) => { - t.is((await t.context.client.boolean({ boolean: true })).result, true); -}); - -test("not", async (t) => { - t.is((await t.context.client.not({ boolean: true })).result, false); -}); - -test("i128", async (t) => { - t.is((await t.context.client.i128({ i128: -1n })).result, -1n); -}); - -test("u128", async (t) => { - t.is((await t.context.client.u128({ u128: 1n })).result, 1n); -}); - -test("multi_args", async (t) => { - t.is((await t.context.client.multi_args({ a: 1, b: true })).result, 1); - t.is((await t.context.client.multi_args({ a: 1, b: false })).result, 0); -}); - -test("map", async (t) => { - const map = new Map(); - map.set(1, true); - map.set(2, false); - // map.set(3, 'hahaha') // should throw an error - t.deepEqual( - (await t.context.client.map({ map })).result, - Array.from(map.entries()), - ); -}); - -test("vec", async (t) => { - const vec = [1, 2, 3]; - t.deepEqual((await t.context.client.vec({ vec })).result, vec); -}); - -test("tuple", async (t) => { - const tuple = ["hello", 1]; - t.deepEqual((await t.context.client.tuple({ tuple })).result, tuple); -}); - -test("option", async (t) => { - // this makes sense - t.deepEqual((await t.context.client.option({ option: 1 })).result, 1); - - // this passes but shouldn't - t.deepEqual( - (await t.context.client.option({ option: undefined })).result, - undefined, - ); - - // this is the behavior we probably want, but fails - // t.deepEqual(await t.context.client.option(), undefined) // typing and implementation require the object - // t.deepEqual((await t.context.client.option({})).result, undefined) // typing requires argument; implementation would be fine with this - // t.deepEqual((await t.context.client.option({ option: undefined })).result, undefined) -}); - -test("u256", async (t) => { - t.is((await t.context.client.u256({ u256: 1n })).result, 1n); -}); - -test("i256", async (t) => { - t.is((await t.context.client.i256({ i256: -1n })).result, -1n); -}); - -test("string", async (t) => { - t.is((await t.context.client.string({ string: "hello" })).result, "hello"); -}); - -test("tuple_strukt", async (t) => { - const arg = [ - { a: 0, b: true, c: "hello" }, - { tag: "First", values: undefined }, - ]; - const res = [{ a: 0, b: true, c: "hello" }, { tag: "First" }]; - t.deepEqual( - (await t.context.client.tuple_strukt({ tuple_strukt: arg })).result, - res, - ); -}); + }; + const ret = { + tag: "Tuple", + values: [[{ a: 0, b: true, c: "hello" }, { tag: "First" }]], + }; + const { result } = await this.context.client.complex({ complex: arg }); + expect(result).to.deep.equal(ret); + }); + + it("complex with enum", async function() { + const arg = { tag: "Enum", values: [{ tag: "First", values: undefined }] }; + const ret = { tag: "Enum", values: [{ tag: "First" }] }; + const { result } = await this.context.client.complex({ complex: arg }); + expect(result).to.deep.equal(ret); + }); + + it("complex with asset", async function() { + const arg = { tag: "Asset", values: [this.context.publicKey, 1n] }; + const { result } = await this.context.client.complex({ complex: arg }); + expect(result).to.deep.equal(arg); + }); + + it("complex with void", async function() { + const complex = { tag: "Void", values: undefined }; + const ret = { tag: "Void" }; + const { result } = await this.context.client.complex({ complex }); + expect(result).to.deep.equal(ret); + }); + + it("addresse", async function() { + const { result } = await this.context.client.addresse({ addresse: this.context.publicKey }); + expect(result).to.equal(this.context.addr.toString()); + }); + + it("bytes", async function() { + const bytes = Buffer.from("hello"); + const { result } = await this.context.client.bytes({ bytes }); + expect(result).to.deep.equal(bytes); + }); + + it("bytesN", async function() { + const bytesN = Buffer.from("123456789"); // what's the correct way to construct bytesN? + const { result } = await this.context.client.bytes_n({ bytes_n: bytesN }); + expect(result).to.deep.equal(bytesN); + }); + + it("card", async function() { + const card = 11; + const { result } = await this.context.client.card({ card }); + expect(result).to.equal(card); + }); + + it("boolean", async function() { + const { result } = await this.context.client.boolean({ boolean: true }); + expect(result).to.equal(true); + }); + + it("not", async function() { + const { result } = await this.context.client.not({ boolean: true }); + expect(result).to.equal(false); + }); + + it("i128", async function() { + const { result } = await this.context.client.i128({ i128: -1n }); + expect(result).to.equal(-1n); + }); + + it("u128", async function() { + const { result } = await this.context.client.u128({ u128: 1n }); + expect(result).to.equal(1n); + }); + + it("multi_args", async function() { + let response = await this.context.client.multi_args({ a: 1, b: true }); + expect(response.result).to.equal(1); + + response = await this.context.client.multi_args({ a: 1, b: false }); + expect(response.result).to.equal(0); + }); + + it("map", async function() { + const map = new Map(); + map.set(1, true); + map.set(2, false); + const { result } = await this.context.client.map({ map }); + expect(result).to.deep.equal(Array.from(map.entries())); + }); + + it("vec", async function() { + const vec = [1, 2, 3]; + const { result } = await this.context.client.vec({ vec }); + expect(result).to.deep.equal(vec); + }); + + it("tuple", async function() { + const tuple = ["hello", 1]; + const { result } = await this.context.client.tuple({ tuple }); + expect(result).to.deep.equal(tuple); + }); + + it("option", async function() { + let response = await this.context.client.option({ option: 1 }); + expect(response.result).to.equal(1); + + response = await this.context.client.option({ option: undefined }); + expect(response.result).to.equal(undefined); + // this is the behavior we probably want, but fails + // t.deepEqual(await t.context.client.option(), undefined) // typing and implementation require the object + // t.deepEqual((await t.context.client.option({})).result, undefined) // typing requires argument; implementation would be fine with this + // t.deepEqual((await t.context.client.option({ option: undefined })).result, undefined) + }); + + it("u256", async function() { + const { result } = await this.context.client.u256({ u256: 1n }); + expect(result).to.equal(1n); + }); + + it("i256", async function() { + const { result } = await this.context.client.i256({ i256: -1n }); + expect(result).to.equal(-1n); + }); + + it("string", async function() { + const { result } = await this.context.client.string({ string: "hello" }); + expect(result).to.equal("hello"); + }); + + it("tuple strukt", async function() { + const arg = [ + { a: 0, b: true, c: "hello" }, + { tag: "First", values: undefined }, + ]; + const res = [{ a: 0, b: true, c: "hello" }, { tag: "First" }]; + const result = await this.context.client.tuple_strukt({ tuple_strukt: arg }); + expect(result.result).to.deep.equal(res); + }); +}); \ No newline at end of file diff --git a/test/e2e/src/test-hello-world.js b/test/e2e/src/test-hello-world.js index 7ce24ec9a..7d6317be1 100644 --- a/test/e2e/src/test-hello-world.js +++ b/test/e2e/src/test-hello-world.js @@ -1,33 +1,34 @@ -const test = require("ava"); +const { expect } = require("chai"); const { clientFor } = require("./util"); -test("hello", async (t) => { - const { client } = await clientFor("helloWorld"); - t.deepEqual((await client.hello({ world: "tests" })).result, [ - "Hello", - "tests", - ]); -}); +describe("helloWorld client", function() { + it("should return properly formed hello response", async function() { + const { client } = await clientFor("helloWorld"); + const response = await client.hello({ world: "tests" }); + expect(response.result).to.deep.equal(["Hello", "tests"]); + }); -test("auth", async (t) => { - const { client, keypair } = await clientFor("helloWorld"); - const publicKey = keypair.publicKey(); - const { result } = await client.auth({ addr: publicKey, world: "lol" }); - t.deepEqual(result, publicKey); -}); + it("should authenticate the user correctly", async function() { + const { client, keypair } = await clientFor("helloWorld"); + const publicKey = keypair.publicKey(); + const { result } = await client.auth({ addr: publicKey, world: "lol" }); + expect(result).to.equal(publicKey); + }); -test("inc", async (t) => { - const { client } = await clientFor("helloWorld"); - const { result: startingBalance } = await client.get_count(); - const inc = await client.inc(); - t.is((await inc.signAndSend()).result, startingBalance + 1); - t.is(startingBalance, 0); - t.is((await client.get_count()).result, startingBalance + 1); -}); + it("should increment the counter correctly", async function() { + const { client } = await clientFor("helloWorld"); + const { result: startingBalance } = await client.get_count(); + const inc = await client.inc(); + const incrementResponse = await inc.signAndSend(); + expect(incrementResponse.result).to.equal(startingBalance + 1); + expect(startingBalance).to.equal(0); // Assuming the counter starts at 0 + const { result: newBalance } = await client.get_count(); + expect(newBalance).to.equal(startingBalance + 1); + }); -test("options for methods with no arguments", async (t) => { - const { client } = await clientFor("helloWorld"); - // check that options object is FIRST, no need to pass `undefined` for the first argument - const inc = await client.inc({ simulate: false }); - t.falsy(inc.simulation); + it("should accept options object for methods with no arguments", async function() { + const { client } = await clientFor("helloWorld"); + const inc = await client.inc({ simulate: false }); + expect(inc.simulation).to.be.undefined; + }); }); diff --git a/test/e2e/src/test-methods-as-args.js b/test/e2e/src/test-methods-as-args.js index 1009deb53..1f4b5b5ef 100644 --- a/test/e2e/src/test-methods-as-args.js +++ b/test/e2e/src/test-methods-as-args.js @@ -1,4 +1,4 @@ -const test = require("ava"); +const { expect } = require("chai"); const { clientFor } = require("./util"); // this test checks that apps can pass methods as arguments to other methods and have them still work @@ -6,8 +6,10 @@ function callMethod(method, args) { return method(args); } -test("methods-as-args", async (t) => { - const { client } = await clientFor("helloWorld"); - const { result } = await callMethod(client.hello, { world: "tests" }); - t.deepEqual(result, ["Hello", "tests"]); +describe("methods-as-args", function() { + it("should pass methods as arguments and have them still work", async function() { + const { client } = await clientFor("helloWorld"); + const { result } = await callMethod(client.hello, { world: "tests" }); + expect(result).to.deep.equal(["Hello", "tests"]); + }); }); diff --git a/test/e2e/src/test-swap.js b/test/e2e/src/test-swap.js index f1f651f31..55795ad29 100644 --- a/test/e2e/src/test-swap.js +++ b/test/e2e/src/test-swap.js @@ -1,183 +1,153 @@ -const test = require("ava"); +const { expect } = require('chai'); +const { describe, it, before } = require('mocha'); const { contract, rpc } = require("../../.."); const { clientFor, generateFundedKeypair } = require("./util"); const amountAToSwap = 2n; const amountBToSwap = 1n; -test.before(async (t) => { - const alice = await generateFundedKeypair(); - const bob = await generateFundedKeypair(); - - const { - client: tokenA, - contractId: tokenAId, - keypair: root, - } = await clientFor("token"); - const { client: tokenB, contractId: tokenBId } = await clientFor("token", { - keypair: root, - }); - const { client: swapContractAsRoot, contractId: swapId } = await clientFor( - "swap", - { keypair: root }, - ); - await ( - await tokenA.initialize({ - admin: root.publicKey(), - decimal: 0, - name: "Token A", - symbol: "A", - }) - ).signAndSend(); - await ( - await tokenA.mint({ amount: amountAToSwap, to: alice.publicKey() }) - ).signAndSend(); - - await ( - await tokenB.initialize({ - admin: root.publicKey(), - decimal: 0, - name: "Token B", - symbol: "B", - }) - ).signAndSend(); - await ( - await tokenB.mint({ amount: amountBToSwap, to: bob.publicKey() }) - ).signAndSend(); - - t.context = { - // eslint-disable-line no-param-reassign - root, - alice, - bob, - swapContractAsRoot, - swapId, - tokenA, - tokenAId, - tokenB, - tokenBId, - }; -}); +describe("Swap Contract Tests", function () { + let context = {}; -test("calling `signAndSend()` too soon throws descriptive error", async (t) => { - const tx = await t.context.swapContractAsRoot.swap({ - a: t.context.alice.publicKey(), - b: t.context.bob.publicKey(), - token_a: t.context.tokenAId, - token_b: t.context.tokenBId, - amount_a: amountAToSwap, - min_a_for_b: amountAToSwap, - amount_b: amountBToSwap, - min_b_for_a: amountBToSwap, - }); - const error = await t.throwsAsync(tx.signAndSend()); - t.true( - error instanceof contract.AssembledTransaction.Errors.NeedsMoreSignatures, - `error is not of type 'NeedsMoreSignaturesError'; instead it is of type '${error?.constructor.name}'`, - ); - if (error) t.regex(error.message, /needsNonInvokerSigningBy/); -}); + before(async function () { + const alice = await generateFundedKeypair(); + const bob = await generateFundedKeypair(); -test("alice swaps bob 10 A for 1 B", async (t) => { - const tx = await t.context.swapContractAsRoot.swap({ - a: t.context.alice.publicKey(), - b: t.context.bob.publicKey(), - token_a: t.context.tokenAId, - token_b: t.context.tokenBId, - amount_a: amountAToSwap, - min_a_for_b: amountAToSwap, - amount_b: amountBToSwap, - min_b_for_a: amountBToSwap, - }); + const { + client: tokenA, + contractId: tokenAId, + keypair: root, + } = await clientFor("token"); + const { client: tokenB, contractId: tokenBId } = await clientFor("token", { + keypair: root, + }); + const { client: swapContractAsRoot, contractId: swapId } = await clientFor( + "swap", + { keypair: root }, + ); + await ( + await tokenA.initialize({ + admin: root.publicKey(), + decimal: 0, + name: "Token A", + symbol: "A", + }) + ).signAndSend(); + await ( + await tokenA.mint({ amount: amountAToSwap, to: alice.publicKey() }) + ).signAndSend(); + + await ( + await tokenB.initialize({ + admin: root.publicKey(), + decimal: 0, + name: "Token B", + symbol: "B", + }) + ).signAndSend(); + await ( + await tokenB.mint({ amount: amountBToSwap, to: bob.publicKey() }) + ).signAndSend(); - const needsNonInvokerSigningBy = await tx.needsNonInvokerSigningBy(); - t.is(needsNonInvokerSigningBy.length, 2); - t.is( - needsNonInvokerSigningBy.indexOf(t.context.alice.publicKey()), - 0, - "needsNonInvokerSigningBy does not have alice's public key!", - ); - t.is( - needsNonInvokerSigningBy.indexOf(t.context.bob.publicKey()), - 1, - "needsNonInvokerSigningBy does not have bob's public key!", - ); - - // root serializes & sends to alice - const jsonFromRoot = tx.toJSON(); - const { client: clientAlice } = await clientFor("swap", { - keypair: t.context.alice, - contractId: t.context.swapId, + context = { + root, + alice, + bob, + swapContractAsRoot, + swapId, + tokenA, + tokenAId, + tokenB, + tokenBId, + }; }); - const txAlice = clientAlice.txFromJSON(jsonFromRoot); - await txAlice.signAuthEntries(); - - // alice serializes & sends to bob - const jsonFromAlice = txAlice.toJSON(); - const { client: clientBob } = await clientFor("swap", { - keypair: t.context.bob, - contractId: t.context.swapId, + + it("calling `signAndSend()` too soon throws descriptive error", async function() { + const tx = await context.swapContractAsRoot.swap({ + a: context.alice.publicKey(), + b: context.bob.publicKey(), + token_a: context.tokenAId, + token_b: context.tokenBId, + amount_a: amountAToSwap, + min_a_for_b: amountAToSwap, + amount_b: amountBToSwap, + min_b_for_a: amountBToSwap, + }); + await expect(tx.signAndSend()).to.be.rejectedWith(contract.AssembledTransaction.Errors.NeedsMoreSignatures).then((error) => { + // Further assertions on the error object + expect(error).to.be.instanceOf(contract.AssembledTransaction.Errors.NeedsMoreSignatures, + `error is not of type 'NeedsMoreSignaturesError'; instead it is of type '${error?.constructor.name}'`); + + if (error) { + // Using regex to check the error message + expect(error.message).to.match(/needsNonInvokerSigningBy/); + } + }); + /*const error = await expect(await tx.signAndSend()).to.be.rejectedWith(contract.AssembledTransaction.Errors.NeedsMoreSignatures); + expect(error).to.be.an.instanceof(contract.AssembledTransaction.Errors.NeedsMoreSignatures, + `error is not of type 'NeedsMoreSignaturesError'; instead it is of type '${error?.constructor.name}'`); + expect(error).to.have.property('message').that.matches(/needsNonInvokerSigningBy/);*/ }); - const txBob = clientBob.txFromJSON(jsonFromAlice); - await txBob.signAuthEntries(); - - // bob serializes & sends back to root - const jsonFromBob = txBob.toJSON(); - const { client: clientRoot } = await clientFor("swap", { - keypair: t.context.root, - contractId: t.context.swapId, + + it("alice swaps bob 10 A for 1 B", async function() { + const tx = await context.swapContractAsRoot.swap({ + a: context.alice.publicKey(), + b: context.bob.publicKey(), + token_a: context.tokenAId, + token_b: context.tokenBId, + amount_a: amountAToSwap, + min_a_for_b: amountAToSwap, + amount_b: amountBToSwap, + min_b_for_a: amountBToSwap, + }); + + const needsNonInvokerSigningBy = await tx.needsNonInvokerSigningBy(); + expect(needsNonInvokerSigningBy).to.have.lengthOf(2); + expect(needsNonInvokerSigningBy.indexOf(context.alice.publicKey())).to.equal(0, "needsNonInvokerSigningBy does not have alice's public key!"); + expect(needsNonInvokerSigningBy.indexOf(context.bob.publicKey())).to.equal(1, "needsNonInvokerSigningBy does not have bob's public key!"); + + // root serializes & sends to alice + const jsonFromRoot = tx.toJSON(); + const { client: clientAlice } = await clientFor("swap", { + keypair: context.alice, + contractId: context.swapId, + }); + const txAlice = clientAlice.txFromJSON(jsonFromRoot); + await txAlice.signAuthEntries(); + + // alice serializes & sends to bob + const jsonFromAlice = txAlice.toJSON(); + const { client: clientBob } = await clientFor("swap", { + keypair: context.bob, + contractId: context.swapId, + }); + const txBob = clientBob.txFromJSON(jsonFromAlice); + await txBob.signAuthEntries(); + + // bob serializes & sends back to root + const jsonFromBob = txBob.toJSON(); + const { client: clientRoot } = await clientFor("swap", { + keypair: context.root, + contractId: context.swapId, + }); + const txRoot = clientRoot.txFromJSON(jsonFromBob); + + const result = await txRoot.signAndSend(); + + expect(result).to.have.property('sendTransactionResponse'); + expect(result.sendTransactionResponse).to.have.property('status', 'PENDING'); + expect(result).to.have.property('getTransactionResponseAll').that.is.an('array').that.is.not.empty; + expect(result.getTransactionResponse).to.have.property('status').that.is.not.equal('FAILED'); + expect(result.getTransactionResponse).to.have.property('status', rpc.Api.GetTransactionStatus.SUCCESS); + + const aliceTokenABalance = await context.tokenA.balance({ id: context.alice.publicKey() }); + const aliceTokenBBalance = await context.tokenB.balance({ id: context.alice.publicKey() }); + const bobTokenABalance = await context.tokenA.balance({ id: context.bob.publicKey() }); + const bobTokenBBalance = await context.tokenB.balance({ id: context.bob.publicKey() }); + + expect(aliceTokenABalance.result).to.equal(0n); + expect(aliceTokenBBalance.result).to.equal(amountBToSwap); + expect(bobTokenABalance.result).to.equal(amountAToSwap); + expect(bobTokenBBalance.result).to.equal(0n); }); - const txRoot = clientRoot.txFromJSON(jsonFromBob); - - const result = await txRoot.signAndSend(); - - t.truthy( - result.sendTransactionResponse, - `tx failed: ${JSON.stringify(result, null, 2)}`, - ); - t.is( - result.sendTransactionResponse.status, - "PENDING", - `tx failed: ${JSON.stringify(result, null, 2)}`, - ); - t.truthy( - result.getTransactionResponseAll?.length, - `tx failed: ${JSON.stringify(result.getTransactionResponseAll, null, 2)}`, - ); - t.not( - result.getTransactionResponse.status, - "FAILED", - `tx failed: ${JSON.stringify( - result.getTransactionResponse.resultXdr - .result() - .value() - .map((op) => op.value()?.value().switch()), - null, - 2, - )}`, - ); - t.is( - result.getTransactionResponse.status, - rpc.Api.GetTransactionStatus.SUCCESS, - `tx failed: ${JSON.stringify(result.getTransactionResponse, null, 2)}`, - ); - - t.is( - (await t.context.tokenA.balance({ id: t.context.alice.publicKey() })) - .result, - 0n, - ); - t.is( - (await t.context.tokenB.balance({ id: t.context.alice.publicKey() })) - .result, - amountBToSwap, - ); - t.is( - (await t.context.tokenA.balance({ id: t.context.bob.publicKey() })).result, - amountAToSwap, - ); - t.is( - (await t.context.tokenB.balance({ id: t.context.bob.publicKey() })).result, - 0n, - ); }); diff --git a/yarn.lock b/yarn.lock index 2076ea947..4a4471495 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1634,15 +1634,15 @@ "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" -"@typescript-eslint/parser@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.11.0.tgz#525ad8bee54a8f015f134edd241d91b84ab64839" - integrity sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg== - dependencies: - "@typescript-eslint/scope-manager" "7.11.0" - "@typescript-eslint/types" "7.11.0" - "@typescript-eslint/typescript-estree" "7.11.0" - "@typescript-eslint/visitor-keys" "7.11.0" +"@typescript-eslint/parser@^7.7.1": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.12.0.tgz#8761df3345528b35049353db80010b385719b1c3" + integrity sha512-dm/J2UDY3oV3TKius2OUZIFHsomQmpHtsV0FTh1WO8EKgHLQ1QCADUqscPgTpU+ih1e21FQSRjXckHn3txn6kQ== + dependencies: + "@typescript-eslint/scope-manager" "7.12.0" + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/typescript-estree" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" debug "^4.3.4" "@typescript-eslint/scope-manager@6.21.0": @@ -1653,13 +1653,13 @@ "@typescript-eslint/types" "6.21.0" "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/scope-manager@7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.11.0.tgz#cf5619b01de62a226a59add15a02bde457335d1d" - integrity sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw== +"@typescript-eslint/scope-manager@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.12.0.tgz#259c014362de72dd34f995efe6bd8dda486adf58" + integrity sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg== dependencies: - "@typescript-eslint/types" "7.11.0" - "@typescript-eslint/visitor-keys" "7.11.0" + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" "@typescript-eslint/type-utils@6.21.0": version "6.21.0" @@ -1676,7 +1676,12 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== -"@typescript-eslint/types@7.11.0", "@typescript-eslint/types@^7.2.0": +"@typescript-eslint/types@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.12.0.tgz#bf208f971a8da1e7524a5d9ae2b5f15192a37981" + integrity sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg== + +"@typescript-eslint/types@^7.2.0": version "7.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.11.0.tgz#5e9702a5e8b424b7fc690e338d359939257d6722" integrity sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w== @@ -1695,13 +1700,13 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/typescript-estree@7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.11.0.tgz#7cbc569bc7336c3a494ceaf8204fdee5d5dbb7fa" - integrity sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ== +"@typescript-eslint/typescript-estree@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.12.0.tgz#e6c1074f248b3db6573ab6a7c47a39c4cd498ff9" + integrity sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ== dependencies: - "@typescript-eslint/types" "7.11.0" - "@typescript-eslint/visitor-keys" "7.11.0" + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -1730,12 +1735,12 @@ "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" -"@typescript-eslint/visitor-keys@7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.11.0.tgz#2c50cd292e67645eec05ac0830757071b4a4d597" - integrity sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ== +"@typescript-eslint/visitor-keys@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.12.0.tgz#c053b55a996679528beeedd8e565710ce1ae1ad3" + integrity sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ== dependencies: - "@typescript-eslint/types" "7.11.0" + "@typescript-eslint/types" "7.12.0" eslint-visitor-keys "^3.4.3" "@ungap/structured-clone@^1.2.0": @@ -1914,7 +1919,7 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.1.1, acorn-walk@^8.2.0: +acorn-walk@^8.1.1: version "8.3.2" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== @@ -1932,14 +1937,6 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -aggregate-error@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-4.0.1.tgz#25091fe1573b9e0be892aeda15c7c66a545f758e" - integrity sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w== - dependencies: - clean-stack "^4.0.0" - indent-string "^5.0.0" - ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -2091,11 +2088,6 @@ array-buffer-byte-length@^1.0.1: call-bind "^1.0.5" is-array-buffer "^3.0.4" -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - integrity sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw== - array-includes@^3.1.7: version "3.1.8" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" @@ -2159,16 +2151,6 @@ arraybuffer.prototype.slice@^1.0.3: is-array-buffer "^3.0.4" is-shared-array-buffer "^1.0.2" -arrgv@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/arrgv/-/arrgv-1.0.2.tgz#025ed55a6a433cad9b604f8112fc4292715a6ec0" - integrity sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw== - -arrify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-3.0.0.tgz#ccdefb8eaf2a1d2ab0da1ca2ce53118759fd46bc" - integrity sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw== - asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -2216,55 +2198,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -ava@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/ava/-/ava-5.3.1.tgz#335737dd963b7941b90214836cea2e8de1f4d5f4" - integrity sha512-Scv9a4gMOXB6+ni4toLuhAm9KYWEjsgBglJl+kMGI5+IVDt120CCDZyB5HNU9DjmLI2t4I0GbnxGLmmRfGTJGg== - dependencies: - acorn "^8.8.2" - acorn-walk "^8.2.0" - ansi-styles "^6.2.1" - arrgv "^1.0.2" - arrify "^3.0.0" - callsites "^4.0.0" - cbor "^8.1.0" - chalk "^5.2.0" - chokidar "^3.5.3" - chunkd "^2.0.1" - ci-info "^3.8.0" - ci-parallel-vars "^1.0.1" - clean-yaml-object "^0.1.0" - cli-truncate "^3.1.0" - code-excerpt "^4.0.0" - common-path-prefix "^3.0.0" - concordance "^5.0.4" - currently-unhandled "^0.4.1" - debug "^4.3.4" - emittery "^1.0.1" - figures "^5.0.0" - globby "^13.1.4" - ignore-by-default "^2.1.0" - indent-string "^5.0.0" - is-error "^2.2.2" - is-plain-object "^5.0.0" - is-promise "^4.0.0" - matcher "^5.0.0" - mem "^9.0.2" - ms "^2.1.3" - p-event "^5.0.1" - p-map "^5.5.0" - picomatch "^2.3.1" - pkg-conf "^4.0.0" - plur "^5.1.0" - pretty-ms "^8.0.0" - resolve-cwd "^3.0.0" - stack-utils "^2.0.6" - strip-ansi "^7.0.1" - supertap "^3.0.1" - temp-dir "^3.0.0" - write-file-atomic "^5.0.1" - yargs "^17.7.2" - available-typed-arrays@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" @@ -2394,11 +2327,6 @@ bluebird@^3.7.2: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -blueimp-md5@^2.10.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz#b53feea5498dcb53dc6ec4b823adb84b729c4af0" - integrity sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w== - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -2600,11 +2528,6 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -callsites@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-4.1.0.tgz#de72b98612eed4e1e2564c952498677faa9d86c2" - integrity sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw== - camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -2632,13 +2555,6 @@ catharsis@^0.9.0: dependencies: lodash "^4.17.15" -cbor@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" - integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== - dependencies: - nofilter "^3.1.0" - chai-as-promised@^7.1.1: version "7.1.2" resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.2.tgz#70cd73b74afd519754161386421fb71832c6d041" @@ -2690,7 +2606,7 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^5.2.0, chalk@^5.3.0, chalk@~5.3.0: +chalk@^5.3.0, chalk@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== @@ -2734,7 +2650,7 @@ chokidar@3.5.3: optionalDependencies: fsevents "~2.3.2" -chokidar@^3.4.0, chokidar@^3.5.1, chokidar@^3.5.3: +chokidar@^3.4.0, chokidar@^3.5.1: version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== @@ -2759,21 +2675,11 @@ chrome-trace-event@^1.0.2: resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== -chunkd@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/chunkd/-/chunkd-2.0.1.tgz#49cd1d7b06992dc4f7fccd962fe2a101ee7da920" - integrity sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ== - -ci-info@^3.2.0, ci-info@^3.8.0: +ci-info@^3.2.0: version "3.9.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== -ci-parallel-vars@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz#e87ff0625ccf9d286985b29b4ada8485ca9ffbc2" - integrity sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg== - cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -2787,18 +2693,6 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -clean-stack@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-4.2.0.tgz#c464e4cde4ac789f4e0735c5d75beb49d7b30b31" - integrity sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg== - dependencies: - escape-string-regexp "5.0.0" - -clean-yaml-object@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz#63fb110dc2ce1a84dc21f6d9334876d010ae8b68" - integrity sha512-3yONmlN9CSAkzNwnRCiJQ7Q2xK5mWuEfL3PuTZcAUzhObbXsfsnMptJzXwz93nc5zn9V9TwCVMmV7w4xsm43dw== - cli-cursor@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" @@ -2827,14 +2721,6 @@ cli-table3@^0.6.3: optionalDependencies: "@colors/colors" "1.5.0" -cli-truncate@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-3.1.0.tgz#3f23ab12535e3d73e839bb43e73c9de487db1389" - integrity sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA== - dependencies: - slice-ansi "^5.0.0" - string-width "^5.0.0" - cli-truncate@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-4.0.0.tgz#6cc28a2924fee9e25ce91e973db56c7066e6172a" @@ -2861,15 +2747,6 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -2879,13 +2756,6 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -code-excerpt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-4.0.0.tgz#2de7d46e98514385cb01f7b3b741320115f4c95e" - integrity sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA== - dependencies: - convert-to-spaces "^2.0.1" - code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -2999,20 +2869,6 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -concordance@^5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.4.tgz#9896073261adced72f88d60e4d56f8efc4bbbbd2" - integrity sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw== - dependencies: - date-time "^3.1.0" - esutils "^2.0.3" - fast-diff "^1.2.0" - js-string-escape "^1.0.1" - lodash "^4.17.15" - md5-hex "^3.0.1" - semver "^7.3.2" - well-known-symbols "^2.0.0" - confusing-browser-globals@^1.0.10: version "1.0.11" resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" @@ -3058,11 +2914,6 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -convert-to-spaces@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz#61a6c98f8aa626c16b296b862a91412a33bceb6b" - integrity sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ== - cookie@~0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" @@ -3167,13 +3018,6 @@ crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - integrity sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng== - dependencies: - array-find-index "^1.0.1" - custom-event@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" @@ -3218,13 +3062,6 @@ date-format@^4.0.14: resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.14.tgz#7a8e584434fb169a521c8b7aa481f355810d9400" integrity sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg== -date-time@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e" - integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg== - dependencies: - time-zone "^1.0.0" - debug@2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -3399,11 +3236,6 @@ dotenv@^16.4.5: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" - integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -3435,11 +3267,6 @@ elliptic@^6.5.3, elliptic@^6.5.5: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emittery@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-1.0.3.tgz#c9d2a9c689870f15251bb13b31c67715c26d69ac" - integrity sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA== - emoji-regex@^10.3.0: version "10.3.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" @@ -3450,11 +3277,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - emojilib@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/emojilib/-/emojilib-2.4.0.tgz#ac518a8bb0d5f76dda57289ccb2fdf9d39ae721e" @@ -3630,11 +3452,6 @@ escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@5.0.0, escape-string-regexp@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" - integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -3884,7 +3701,7 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -esutils@^2.0.2, esutils@^2.0.3: +esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== @@ -3957,7 +3774,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2, fast-diff@^1.2.0: +fast-diff@^1.1.2: version "1.3.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== @@ -3967,7 +3784,7 @@ fast-fifo@^1.1.0, fast-fifo@^1.2.0: resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== -fast-glob@^3.2.9, fast-glob@^3.3.0: +fast-glob@^3.2.9: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -4010,14 +3827,6 @@ fflate@^0.8.2: resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== -figures@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-5.0.0.tgz#126cd055052dea699f8a54e8c9450e6ecfc44d5f" - integrity sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg== - dependencies: - escape-string-regexp "^5.0.0" - is-unicode-supported "^1.2.0" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -4094,7 +3903,7 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^6.0.0, find-up@^6.3.0: +find-up@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== @@ -4400,17 +4209,6 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -globby@^13.1.4: - version "13.2.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-13.2.2.tgz#63b90b1bf68619c2135475cbd4e71e66aa090592" - integrity sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w== - dependencies: - dir-glob "^3.0.1" - fast-glob "^3.3.0" - ignore "^5.2.4" - merge2 "^1.4.1" - slash "^4.0.0" - gopd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" @@ -4622,11 +4420,6 @@ ieee754@^1.2.1: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore-by-default@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-2.1.0.tgz#c0e0de1a99b6065bdc93315a6f728867981464db" - integrity sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw== - ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" @@ -4658,11 +4451,6 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -indent-string@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" - integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -4695,11 +4483,6 @@ ip-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" integrity sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw== -irregular-plurals@^3.3.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-3.5.0.tgz#0835e6639aa8425bdc8b0d33d0dc4e89d9c01d2b" - integrity sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ== - is-arguments@^1.0.4: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" @@ -4774,11 +4557,6 @@ is-docker@^2.0.0: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-error@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/is-error/-/is-error-2.2.2.tgz#c10ade187b3c93510c5470a5567833ee25649843" - integrity sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -4871,16 +4649,6 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -is-promise@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" - integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -4937,11 +4705,6 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-unicode-supported@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz#d824984b616c292a2e198207d4a609983842f714" - integrity sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ== - is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" @@ -5098,11 +4861,6 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -js-string-escape@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - integrity sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg== - js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -5115,7 +4873,7 @@ js-yaml@4.1.0, js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.12.1, js-yaml@^3.13.1, js-yaml@^3.14.1: +js-yaml@^3.12.1, js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5412,11 +5170,6 @@ listr2@~8.2.1: rfdc "^1.3.1" wrap-ansi "^9.0.0" -load-json-file@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-7.0.1.tgz#a3c9fde6beffb6bedb5acf104fad6bb1604e1b00" - integrity sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ== - loader-runner@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" @@ -5576,13 +5329,6 @@ manage-path@2.0.0: resolved "https://registry.yarnpkg.com/manage-path/-/manage-path-2.0.0.tgz#f4cf8457b926eeee2a83b173501414bc76eb9597" integrity sha512-NJhyB+PJYTpxhxZJ3lecIGgh4kwIY2RAh44XvAz9UlqthlQwtPBf62uBVR8XaD8CRuSjQ6TnZH2lNJkbLPZM2A== -map-age-cleaner@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - markdown-it-anchor@^8.6.7: version "8.6.7" resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634" @@ -5622,20 +5368,6 @@ marked@^9.1.2: resolved "https://registry.yarnpkg.com/marked/-/marked-9.1.6.tgz#5d2a3f8180abfbc5d62e3258a38a1c19c0381695" integrity sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q== -matcher@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/matcher/-/matcher-5.0.0.tgz#cd82f1c7ae7ee472a9eeaf8ec7cac45e0fe0da62" - integrity sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw== - dependencies: - escape-string-regexp "^5.0.0" - -md5-hex@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c" - integrity sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw== - dependencies: - blueimp-md5 "^2.10.0" - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -5655,14 +5387,6 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== -mem@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/mem/-/mem-9.0.2.tgz#bbc2d40be045afe30749681e8f5d554cee0c0354" - integrity sha512-F2t4YIv9XQUBHt6AOJ0y7lSmP1+cY7Fm1DRh9GClTGzKST7UWLMx6ly9WZdLH/G/ppM5RL4MlQfRT71ri9t19A== - dependencies: - map-age-cleaner "^0.1.3" - mimic-fn "^4.0.0" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -5844,7 +5568,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.1.1, ms@^2.1.3: +ms@2.1.3, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -5941,11 +5665,6 @@ node-releases@^2.0.14: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== -nofilter@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" - integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== - "normalize-package-data@~1.0.1 || ^2.0.0 || ^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" @@ -6169,18 +5888,6 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw== - -p-event@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/p-event/-/p-event-5.0.1.tgz#614624ec02ae7f4f13d09a721c90586184af5b0c" - integrity sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ== - dependencies: - p-timeout "^5.0.2" - p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -6237,18 +5944,6 @@ p-map@^3.0.0: dependencies: aggregate-error "^3.0.0" -p-map@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-5.5.0.tgz#054ca8ca778dfa4cf3f8db6638ccb5b937266715" - integrity sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg== - dependencies: - aggregate-error "^4.0.0" - -p-timeout@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-5.1.0.tgz#b3c691cf4415138ce2d9cfe071dba11f0fee085b" - integrity sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew== - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -6288,11 +5983,6 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.7: pbkdf2 "^3.1.2" safe-buffer "^5.2.1" -parse-ms@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-3.0.0.tgz#3ea24a934913345fcc3656deda72df921da3a70e" - integrity sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw== - parse5-htmlparser2-tree-adapter@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" @@ -6411,14 +6101,6 @@ pirates@^4.0.6: resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== -pkg-conf@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-4.0.0.tgz#63ace00cbacfa94c2226aee133800802d3e3b80c" - integrity sha512-7dmgi4UY4qk+4mj5Cd8v/GExPo0K+SlY+hulOSdfZ/T6jVH6//y7NtzZo5WrfhDBxuQ0jCa7fLZmNaNh7EWL/w== - dependencies: - find-up "^6.0.0" - load-json-file "^7.0.0" - pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -6440,13 +6122,6 @@ pkg-dir@^7.0.0: dependencies: find-up "^6.3.0" -plur@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/plur/-/plur-5.1.0.tgz#bff58c9f557b9061d60d8ebf93959cf4b08594ae" - integrity sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg== - dependencies: - irregular-plurals "^3.3.0" - possible-typed-array-names@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" @@ -6469,13 +6144,6 @@ prettier@^3.2.5: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== -pretty-ms@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-8.0.0.tgz#a35563b2a02df01e595538f86d7de54ca23194a3" - integrity sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q== - dependencies: - parse-ms "^3.0.0" - process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -6888,7 +6556,7 @@ schema-utils@^4.0.0, schema-utils@^4.2.0: ajv-formats "^2.1.1" ajv-keywords "^5.1.0" -"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.2, semver@^7.3.4, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2: +"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== @@ -6903,13 +6571,6 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -serialize-error@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18" - integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw== - dependencies: - type-fest "^0.13.1" - serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" @@ -7003,7 +6664,7 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -signal-exit@^4.0.1, signal-exit@^4.1.0: +signal-exit@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== @@ -7042,11 +6703,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slash@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" - integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== - slice-ansi@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" @@ -7200,13 +6856,6 @@ ssri@^8.0.0: dependencies: minipass "^3.1.1" -stack-utils@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" - integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== - dependencies: - escape-string-regexp "^2.0.0" - statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -7268,7 +6917,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7277,15 +6926,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" - integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== - dependencies: - eastasianwidth "^0.2.0" - emoji-regex "^9.2.2" - strip-ansi "^7.0.1" - string-width@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.1.0.tgz#d994252935224729ea3719c49f7206dc9c46550a" @@ -7351,7 +6991,7 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-ansi@^7.0.1, strip-ansi@^7.1.0: +strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== @@ -7394,16 +7034,6 @@ superagent@^8.0.9: qs "^6.11.0" semver "^7.3.8" -supertap@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/supertap/-/supertap-3.0.1.tgz#aa89e4522104402c6e8fe470a7d2db6dc4037c6a" - integrity sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw== - dependencies: - indent-string "^5.0.0" - js-yaml "^3.14.1" - serialize-error "^7.0.1" - strip-ansi "^7.0.1" - supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -7477,11 +7107,6 @@ tar@^6.2.1: mkdirp "^1.0.3" yallist "^4.0.0" -temp-dir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-3.0.0.tgz#7f147b42ee41234cc6ba3138cd8e8aa2302acffa" - integrity sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw== - terser-webpack-plugin@^5.3.10: version "5.3.10" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" @@ -7531,11 +7156,6 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" -time-zone@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d" - integrity sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA== - timers-browserify@^2.0.12: version "2.0.12" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" @@ -7656,11 +7276,6 @@ type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -8049,11 +7664,6 @@ webpack@^5.91.0: watchpack "^2.4.1" webpack-sources "^3.2.3" -well-known-symbols@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-2.0.0.tgz#e9c7c07dbd132b7b84212c8174391ec1f9871ba5" - integrity sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q== - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -8173,14 +7783,6 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write-file-atomic@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.1.tgz#68df4717c55c6fa4281a7860b4c2ba0a6d2b11e7" - integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^4.0.1" - ws@~8.11.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" @@ -8239,11 +7841,6 @@ yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" @@ -8284,19 +7881,6 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^17.7.2: - version "17.7.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" From a5300d536e3396ba4de1fe6eaf92244ab47db74a Mon Sep 17 00:00:00 2001 From: Blaine Heffron Date: Wed, 29 May 2024 17:46:58 -0400 Subject: [PATCH 2/9] Update test/e2e/src/test-contract-client-constructor.js remove line Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Signed-off-by: blaineheffron --- test/e2e/src/test-contract-client-constructor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/src/test-contract-client-constructor.js b/test/e2e/src/test-contract-client-constructor.js index 39d7ce721..cb8d7a7ae 100644 --- a/test/e2e/src/test-contract-client-constructor.js +++ b/test/e2e/src/test-contract-client-constructor.js @@ -50,7 +50,6 @@ async function clientFromConstructor( } // TODO: do this with js-stellar-sdk, instead of shelling out to the CLI - contractId = contractId ?? spawnSync( From b0438df15ded3b89f5f85c3d660a5e115d2042b2 Mon Sep 17 00:00:00 2001 From: blaineheffron Date: Wed, 29 May 2024 17:48:29 -0400 Subject: [PATCH 3/9] some missed changes Signed-off-by: blaineheffron --- test/e2e/src/test-contract-client-constructor.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/e2e/src/test-contract-client-constructor.js b/test/e2e/src/test-contract-client-constructor.js index cb8d7a7ae..92a4fab04 100644 --- a/test/e2e/src/test-contract-client-constructor.js +++ b/test/e2e/src/test-contract-client-constructor.js @@ -1,4 +1,4 @@ -const assert = require("assert"); +const { expect } = require("chai"); const { spawnSync } = require("node:child_process"); const { contracts, @@ -111,7 +111,7 @@ describe('Contract Tests', function() { it("hello from constructor", async function() { const { result } = await context.client.hello({ hello: "tests" }); - assert.strictEqual(result, "tests"); + expect(result).to.equal("tests"); }); it("from", async function() { @@ -125,10 +125,9 @@ describe('Contract Tests', function() { context.publicKey, context.keypair, ); - assert.deepStrictEqual( - constructorWorkaround(clientFromFrom), + expect(constructorWorkaround(clientFromFrom)).to.deep.equal( constructorWorkaround(context.client), ); - assert.deepStrictEqual(context.client.spec.entries, clientFromFrom.spec.entries); + expect(context.client.spec.entries).to.deep.equal(clientFromFrom.spec.entries); }); -}); \ No newline at end of file +}); From d6324ed8277f3275d90c6a3016976280f2d98143 Mon Sep 17 00:00:00 2001 From: blaineheffron Date: Wed, 29 May 2024 17:59:38 -0400 Subject: [PATCH 4/9] better descriptions Signed-off-by: blaineheffron --- .../src/test-contract-client-constructor.js | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/e2e/src/test-contract-client-constructor.js b/test/e2e/src/test-contract-client-constructor.js index 92a4fab04..3fe13f098 100644 --- a/test/e2e/src/test-contract-client-constructor.js +++ b/test/e2e/src/test-contract-client-constructor.js @@ -98,36 +98,35 @@ async function clientForFromTest(contractId, publicKey, keypair) { return contract.Client.from(options); } -describe('Contract Tests', function() { - let context = {}; +describe('Client', function() { before(async function() { const { client, keypair, contractId } = await clientFromConstructor("customTypes"); const publicKey = keypair.publicKey(); const addr = Address.fromString(publicKey); - context = { client, publicKey, addr, contractId, keypair }; + this.context = { client, publicKey, addr, contractId, keypair }; }); - it("hello from constructor", async function() { - const { result } = await context.client.hello({ hello: "tests" }); + it("can be constructed with `new Client`", async function() { + const { result } = await this.context.client.hello({ hello: "tests" }); expect(result).to.equal("tests"); }); - it("from", async function() { + it("can be constructed with `from`", async function() { // objects with different constructors will not pass deepEqual check function constructorWorkaround(object) { return JSON.parse(JSON.stringify(object)); } const clientFromFrom = await clientForFromTest( - context.contractId, - context.publicKey, - context.keypair, + this.context.contractId, + this.context.publicKey, + this.context.keypair, ); expect(constructorWorkaround(clientFromFrom)).to.deep.equal( - constructorWorkaround(context.client), + constructorWorkaround(this.context.client), ); - expect(context.client.spec.entries).to.deep.equal(clientFromFrom.spec.entries); + expect(this.context.client.spec.entries).to.deep.equal(clientFromFrom.spec.entries); }); }); From e8f98152a8472c434601f2d955bcb300b1b03023 Mon Sep 17 00:00:00 2001 From: blaineheffron Date: Wed, 29 May 2024 18:12:34 -0400 Subject: [PATCH 5/9] one liners Signed-off-by: blaineheffron --- test/e2e/src/test-custom-types.js | 93 +++++++++++-------------------- 1 file changed, 31 insertions(+), 62 deletions(-) diff --git a/test/e2e/src/test-custom-types.js b/test/e2e/src/test-custom-types.js index ea350f74d..778a4eeb0 100644 --- a/test/e2e/src/test-custom-types.js +++ b/test/e2e/src/test-custom-types.js @@ -12,8 +12,7 @@ describe("Custom Types Tests", function() { }); it("hello", async function() { - const { result } = await this.context.client.hello({ hello: "tests" }); - expect(result).to.equal("tests"); + expect((await this.context.client.hello({ hello: "tests" })).result).to.equal("tests"); }); it("view method with empty keypair", async function() { @@ -21,13 +20,11 @@ describe("Custom Types Tests", function() { keypair: undefined, contractId: this.context.contractId, }); - const { result } = await client2.hello({ hello: "anonymous" }); - expect(result).to.equal("anonymous"); + expect((await client2.hello({ hello: "anonymous" })).result).to.equal("anonymous"); }); it("woid", async function() { - const { result } = await this.context.client.woid(); - expect(result).to.be.null; + expect((await this.context.client.woid()).result).to.be.null; }); it("u32_fail_on_even", async function() { @@ -39,54 +36,45 @@ describe("Custom Types Tests", function() { }); it("u32", async function() { - const { result } = await this.context.client.u32_({ u32_: 1 }); - expect(result).to.equal(1); + expect((await this.context.client.u32_({ u32_: 1 })).result).to.equal(1); }); it("i32", async function() { - const { result } = await this.context.client.i32_({ i32_: 1 }); - expect(result).to.equal(1); + expect((await this.context.client.i32_({ i32_: 1 })).result).to.equal(1); }); it("i64", async function() { - const { result } = await this.context.client.i64_({ i64_: 1n }); - expect(result).to.equal(1n); + expect((await this.context.client.i64_({ i64_: 1n })).result).to.equal(1n); }); it("strukt_hel", async function() { const strukt = { a: 0, b: true, c: "world" }; - const { result } = await this.context.client.strukt_hel({ strukt }); - expect(result).to.deep.equal(["Hello", "world"]); + expect((await this.context.client.strukt_hel({ strukt })).result).to.deep.equal(["Hello", "world"]); }); it("strukt", async function() { const strukt = { a: 0, b: true, c: "hello" }; - const { result } = await this.context.client.strukt({ strukt }); - expect(result).to.deep.equal(strukt); + expect((await this.context.client.strukt({ strukt })).result).to.deep.equal(strukt); }); it("simple first", async function() { const simple = { tag: "First", values: undefined }; - const { result } = await this.context.client.simple({ simple }); - expect(result).to.deep.equal({ tag: "First" }); + expect((await this.context.client.simple({ simple })).result).to.deep.equal({ tag: "First" }); }); it("simple second", async function() { const simple = { tag: "Second", values: undefined }; - const { result } = await this.context.client.simple({ simple }); - expect(result).to.deep.equal({ tag: "Second" }); + expect((await this.context.client.simple({ simple })).result).to.deep.equal({ tag: "Second" }); }); it("simple third", async function() { const simple = { tag: "Third", values: undefined }; - const { result } = await this.context.client.simple({ simple }); - expect(result).to.deep.equal({ tag: "Third" }); + expect((await this.context.client.simple({ simple })).result).to.deep.equal({ tag: "Third" }); }); it("complex with struct", async function() { const arg = { tag: "Struct", values: [{ a: 0, b: true, c: "hello" }] }; - const { result } = await this.context.client.complex({ complex: arg }); - expect(result).to.deep.equal(arg); + expect((await this.context.client.complex({ complex: arg })).result).to.deep.equal(arg); }); it("complex with tuple", async function() { @@ -103,71 +91,59 @@ describe("Custom Types Tests", function() { tag: "Tuple", values: [[{ a: 0, b: true, c: "hello" }, { tag: "First" }]], }; - const { result } = await this.context.client.complex({ complex: arg }); - expect(result).to.deep.equal(ret); + expect((await this.context.client.complex({ complex: arg })).result).to.deep.equal(ret); }); it("complex with enum", async function() { const arg = { tag: "Enum", values: [{ tag: "First", values: undefined }] }; const ret = { tag: "Enum", values: [{ tag: "First" }] }; - const { result } = await this.context.client.complex({ complex: arg }); - expect(result).to.deep.equal(ret); + expect((await this.context.client.complex({ complex: arg })).result).to.deep.equal(ret); }); it("complex with asset", async function() { const arg = { tag: "Asset", values: [this.context.publicKey, 1n] }; - const { result } = await this.context.client.complex({ complex: arg }); - expect(result).to.deep.equal(arg); + expect((await this.context.client.complex({ complex: arg })).result).to.deep.equal(arg); }); it("complex with void", async function() { const complex = { tag: "Void", values: undefined }; const ret = { tag: "Void" }; - const { result } = await this.context.client.complex({ complex }); - expect(result).to.deep.equal(ret); + expect((await this.context.client.complex({ complex })).result).to.deep.equal(ret); }); it("addresse", async function() { - const { result } = await this.context.client.addresse({ addresse: this.context.publicKey }); - expect(result).to.equal(this.context.addr.toString()); + expect((await this.context.client.addresse({ addresse: this.context.publicKey })).result).to.equal(this.context.addr.toString()); }); it("bytes", async function() { const bytes = Buffer.from("hello"); - const { result } = await this.context.client.bytes({ bytes }); - expect(result).to.deep.equal(bytes); + expect((await this.context.client.bytes({ bytes })).result).to.deep.equal(bytes); }); it("bytesN", async function() { const bytesN = Buffer.from("123456789"); // what's the correct way to construct bytesN? - const { result } = await this.context.client.bytes_n({ bytes_n: bytesN }); - expect(result).to.deep.equal(bytesN); + expect((await this.context.client.bytes_n({ bytes_n: bytesN })).result).to.deep.equal(bytesN); }); it("card", async function() { const card = 11; - const { result } = await this.context.client.card({ card }); - expect(result).to.equal(card); + expect((await this.context.client.card({ card })).result).to.equal(card); }); it("boolean", async function() { - const { result } = await this.context.client.boolean({ boolean: true }); - expect(result).to.equal(true); + expect((await this.context.client.boolean({ boolean: true })).result).to.equal(true); }); it("not", async function() { - const { result } = await this.context.client.not({ boolean: true }); - expect(result).to.equal(false); + expect((await this.context.client.not({ boolean: true })).result).to.equal(false); }); it("i128", async function() { - const { result } = await this.context.client.i128({ i128: -1n }); - expect(result).to.equal(-1n); + expect((await this.context.client.i128({ i128: -1n })).result).to.equal(-1n); }); it("u128", async function() { - const { result } = await this.context.client.u128({ u128: 1n }); - expect(result).to.equal(1n); + expect((await this.context.client.u128({ u128: 1n })).result).to.equal(1n); }); it("multi_args", async function() { @@ -182,20 +158,17 @@ describe("Custom Types Tests", function() { const map = new Map(); map.set(1, true); map.set(2, false); - const { result } = await this.context.client.map({ map }); - expect(result).to.deep.equal(Array.from(map.entries())); + expect((await this.context.client.map({ map })).result).to.deep.equal(Array.from(map.entries())); }); it("vec", async function() { const vec = [1, 2, 3]; - const { result } = await this.context.client.vec({ vec }); - expect(result).to.deep.equal(vec); + expect((await this.context.client.vec({ vec })).result).to.deep.equal(vec); }); it("tuple", async function() { const tuple = ["hello", 1]; - const { result } = await this.context.client.tuple({ tuple }); - expect(result).to.deep.equal(tuple); + expect((await this.context.client.tuple({ tuple })).result).to.deep.equal(tuple); }); it("option", async function() { @@ -211,18 +184,15 @@ describe("Custom Types Tests", function() { }); it("u256", async function() { - const { result } = await this.context.client.u256({ u256: 1n }); - expect(result).to.equal(1n); + expect((await this.context.client.u256({ u256: 1n })).result).to.equal(1n); }); it("i256", async function() { - const { result } = await this.context.client.i256({ i256: -1n }); - expect(result).to.equal(-1n); + expect((await this.context.client.i256({ i256: -1n })).result).to.equal(-1n); }); it("string", async function() { - const { result } = await this.context.client.string({ string: "hello" }); - expect(result).to.equal("hello"); + expect((await this.context.client.string({ string: "hello" })).result).to.equal("hello"); }); it("tuple strukt", async function() { @@ -231,7 +201,6 @@ describe("Custom Types Tests", function() { { tag: "First", values: undefined }, ]; const res = [{ a: 0, b: true, c: "hello" }, { tag: "First" }]; - const result = await this.context.client.tuple_strukt({ tuple_strukt: arg }); - expect(result.result).to.deep.equal(res); + expect((await this.context.client.tuple_strukt({ tuple_strukt: arg })).result).to.deep.equal(res); }); }); \ No newline at end of file From c5946b3399bb459d7205db2ebbfd0df9ea7bcd24 Mon Sep 17 00:00:00 2001 From: Blaine Heffron Date: Wed, 29 May 2024 18:13:22 -0400 Subject: [PATCH 6/9] Update test/e2e/src/test-hello-world.js more precise wording Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Signed-off-by: blaineheffron --- test/e2e/src/test-hello-world.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/src/test-hello-world.js b/test/e2e/src/test-hello-world.js index 7d6317be1..50b50f4f7 100644 --- a/test/e2e/src/test-hello-world.js +++ b/test/e2e/src/test-hello-world.js @@ -26,7 +26,7 @@ describe("helloWorld client", function() { expect(newBalance).to.equal(startingBalance + 1); }); - it("should accept options object for methods with no arguments", async function() { + it("should accept only options object for methods with no arguments", async function() { const { client } = await clientFor("helloWorld"); const inc = await client.inc({ simulate: false }); expect(inc.simulation).to.be.undefined; From 91daf07caace9fb78ca50c009ab0c61cf8fe1dee Mon Sep 17 00:00:00 2001 From: blaineheffron Date: Wed, 29 May 2024 18:17:58 -0400 Subject: [PATCH 7/9] remove comments, unify naming Signed-off-by: blaineheffron --- test/e2e/src/test-swap.js | 51 ++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/test/e2e/src/test-swap.js b/test/e2e/src/test-swap.js index 55795ad29..2a74edd8b 100644 --- a/test/e2e/src/test-swap.js +++ b/test/e2e/src/test-swap.js @@ -7,7 +7,6 @@ const amountAToSwap = 2n; const amountBToSwap = 1n; describe("Swap Contract Tests", function () { - let context = {}; before(async function () { const alice = await generateFundedKeypair(); @@ -49,7 +48,7 @@ describe("Swap Contract Tests", function () { await tokenB.mint({ amount: amountBToSwap, to: bob.publicKey() }) ).signAndSend(); - context = { + this.context = { root, alice, bob, @@ -63,11 +62,11 @@ describe("Swap Contract Tests", function () { }); it("calling `signAndSend()` too soon throws descriptive error", async function() { - const tx = await context.swapContractAsRoot.swap({ - a: context.alice.publicKey(), - b: context.bob.publicKey(), - token_a: context.tokenAId, - token_b: context.tokenBId, + const tx = await this.context.swapContractAsRoot.swap({ + a: this.context.alice.publicKey(), + b: this.context.bob.publicKey(), + token_a: this.context.tokenAId, + token_b: this.context.tokenBId, amount_a: amountAToSwap, min_a_for_b: amountAToSwap, amount_b: amountBToSwap, @@ -83,18 +82,14 @@ describe("Swap Contract Tests", function () { expect(error.message).to.match(/needsNonInvokerSigningBy/); } }); - /*const error = await expect(await tx.signAndSend()).to.be.rejectedWith(contract.AssembledTransaction.Errors.NeedsMoreSignatures); - expect(error).to.be.an.instanceof(contract.AssembledTransaction.Errors.NeedsMoreSignatures, - `error is not of type 'NeedsMoreSignaturesError'; instead it is of type '${error?.constructor.name}'`); - expect(error).to.have.property('message').that.matches(/needsNonInvokerSigningBy/);*/ }); it("alice swaps bob 10 A for 1 B", async function() { - const tx = await context.swapContractAsRoot.swap({ - a: context.alice.publicKey(), - b: context.bob.publicKey(), - token_a: context.tokenAId, - token_b: context.tokenBId, + const tx = await this.context.swapContractAsRoot.swap({ + a: this.context.alice.publicKey(), + b: this.context.bob.publicKey(), + token_a: this.context.tokenAId, + token_b: this.context.tokenBId, amount_a: amountAToSwap, min_a_for_b: amountAToSwap, amount_b: amountBToSwap, @@ -103,14 +98,14 @@ describe("Swap Contract Tests", function () { const needsNonInvokerSigningBy = await tx.needsNonInvokerSigningBy(); expect(needsNonInvokerSigningBy).to.have.lengthOf(2); - expect(needsNonInvokerSigningBy.indexOf(context.alice.publicKey())).to.equal(0, "needsNonInvokerSigningBy does not have alice's public key!"); - expect(needsNonInvokerSigningBy.indexOf(context.bob.publicKey())).to.equal(1, "needsNonInvokerSigningBy does not have bob's public key!"); + expect(needsNonInvokerSigningBy.indexOf(this.context.alice.publicKey())).to.equal(0, "needsNonInvokerSigningBy does not have alice's public key!"); + expect(needsNonInvokerSigningBy.indexOf(this.context.bob.publicKey())).to.equal(1, "needsNonInvokerSigningBy does not have bob's public key!"); // root serializes & sends to alice const jsonFromRoot = tx.toJSON(); const { client: clientAlice } = await clientFor("swap", { - keypair: context.alice, - contractId: context.swapId, + keypair: this.context.alice, + contractId: this.context.swapId, }); const txAlice = clientAlice.txFromJSON(jsonFromRoot); await txAlice.signAuthEntries(); @@ -118,8 +113,8 @@ describe("Swap Contract Tests", function () { // alice serializes & sends to bob const jsonFromAlice = txAlice.toJSON(); const { client: clientBob } = await clientFor("swap", { - keypair: context.bob, - contractId: context.swapId, + keypair: this.context.bob, + contractId: this.context.swapId, }); const txBob = clientBob.txFromJSON(jsonFromAlice); await txBob.signAuthEntries(); @@ -127,8 +122,8 @@ describe("Swap Contract Tests", function () { // bob serializes & sends back to root const jsonFromBob = txBob.toJSON(); const { client: clientRoot } = await clientFor("swap", { - keypair: context.root, - contractId: context.swapId, + keypair: this.context.root, + contractId: this.context.swapId, }); const txRoot = clientRoot.txFromJSON(jsonFromBob); @@ -140,10 +135,10 @@ describe("Swap Contract Tests", function () { expect(result.getTransactionResponse).to.have.property('status').that.is.not.equal('FAILED'); expect(result.getTransactionResponse).to.have.property('status', rpc.Api.GetTransactionStatus.SUCCESS); - const aliceTokenABalance = await context.tokenA.balance({ id: context.alice.publicKey() }); - const aliceTokenBBalance = await context.tokenB.balance({ id: context.alice.publicKey() }); - const bobTokenABalance = await context.tokenA.balance({ id: context.bob.publicKey() }); - const bobTokenBBalance = await context.tokenB.balance({ id: context.bob.publicKey() }); + const aliceTokenABalance = await this.context.tokenA.balance({ id: this.context.alice.publicKey() }); + const aliceTokenBBalance = await this.context.tokenB.balance({ id: this.context.alice.publicKey() }); + const bobTokenABalance = await this.context.tokenA.balance({ id: this.context.bob.publicKey() }); + const bobTokenBBalance = await this.context.tokenB.balance({ id: this.context.bob.publicKey() }); expect(aliceTokenABalance.result).to.equal(0n); expect(aliceTokenBBalance.result).to.equal(amountBToSwap); From a6c2ecddae878dde6903ac85fb27c824a9dfbf71 Mon Sep 17 00:00:00 2001 From: blaineheffron Date: Thu, 30 May 2024 11:32:12 -0400 Subject: [PATCH 8/9] remove comments Signed-off-by: blaineheffron --- test/e2e/src/test-contract-client-constructor.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/e2e/src/test-contract-client-constructor.js b/test/e2e/src/test-contract-client-constructor.js index 3fe13f098..da40738a7 100644 --- a/test/e2e/src/test-contract-client-constructor.js +++ b/test/e2e/src/test-contract-client-constructor.js @@ -8,15 +8,6 @@ const { } = require("./util"); const { Address, contract } = require("../../.."); -/** - * Generates a Client for the contract with the given name. - * Also generates a new account to use as as the keypair of this contract. This - * account is funded by friendbot. You can pass in an account to re-use the - * same account with multiple contract clients. - * - * By default, will re-deploy the contract every time. Pass in the same - * `contractId` again if you want to re-use the a contract instance. - */ async function clientFromConstructor( name, { keypair = generateFundedKeypair(), contractId } = {}, From 79aaf19d443b462d2fec087bba55f456bfcaa76c Mon Sep 17 00:00:00 2001 From: Blaine Heffron Date: Mon, 3 Jun 2024 18:56:18 -0400 Subject: [PATCH 9/9] Update test/e2e/src/test-swap.js clean up nested awaits Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Signed-off-by: blaineheffron --- test/e2e/src/test-swap.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/e2e/src/test-swap.js b/test/e2e/src/test-swap.js index 2a74edd8b..129c181be 100644 --- a/test/e2e/src/test-swap.js +++ b/test/e2e/src/test-swap.js @@ -36,14 +36,12 @@ describe("Swap Contract Tests", function () { await tokenA.mint({ amount: amountAToSwap, to: alice.publicKey() }) ).signAndSend(); - await ( - await tokenB.initialize({ - admin: root.publicKey(), - decimal: 0, - name: "Token B", - symbol: "B", - }) - ).signAndSend(); + await tokenB.initialize({ + admin: root.publicKey(), + decimal: 0, + name: "Token B", + symbol: "B", + }).then(t => t.signAndSend()); await ( await tokenB.mint({ amount: amountBToSwap, to: bob.publicKey() }) ).signAndSend();