From ebffc6776ee77bb072c09562573db31b6d1e6efa Mon Sep 17 00:00:00 2001 From: Spring Chiu Date: Mon, 4 Sep 2023 23:11:53 +0800 Subject: [PATCH] fix-issue-364: update devDeploy to create account and deploy --- tests/__tests__/bytes.ava.js | 4 +++- tests/__tests__/function-params.ava.js | 6 ++---- tests/__tests__/lookup-map.ava.js | 3 ++- tests/__tests__/lookup-set.ava.js | 3 ++- tests/__tests__/test-date-serialization.ava.js | 3 ++- tests/__tests__/test-middlewares.ava.js | 3 ++- tests/__tests__/unordered-map.ava.js | 3 ++- tests/__tests__/unordered-set.ava.js | 3 ++- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/__tests__/bytes.ava.js b/tests/__tests__/bytes.ava.js index 9dbfe97e3..765911fc5 100644 --- a/tests/__tests__/bytes.ava.js +++ b/tests/__tests__/bytes.ava.js @@ -9,7 +9,9 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Deploy the test contract. - const bytesContract = await root.devDeploy("build/bytes.wasm"); + const bytesContract = await root.createSubAccount("bytes-contract"); + await bytesContract.deploy("build/bytes.wasm"); + // Test users const ali = await root.createSubAccount("ali"); const bob = await root.createSubAccount("bob"); diff --git a/tests/__tests__/function-params.ava.js b/tests/__tests__/function-params.ava.js index 72dfe9d3a..dd7a8c823 100644 --- a/tests/__tests__/function-params.ava.js +++ b/tests/__tests__/function-params.ava.js @@ -8,10 +8,8 @@ test.before(async (t) => { // Prepare sandbox for tests, create accounts, deploy contracts, etx. const root = worker.rootAccount; - // Deploy the test contract. - const functionParamsContract = await root.devDeploy( - "build/function-params.wasm" - ); + const functionParamsContract = await root.createSubAccount("function-params-contract"); + await functionParamsContract.deploy("build/function-params.wasm"); // Test users const ali = await root.createSubAccount("ali"); diff --git a/tests/__tests__/lookup-map.ava.js b/tests/__tests__/lookup-map.ava.js index f4ff27181..682157d5c 100644 --- a/tests/__tests__/lookup-map.ava.js +++ b/tests/__tests__/lookup-map.ava.js @@ -9,7 +9,8 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Deploy the test contract. - const lookupMapContract = await root.devDeploy("build/lookup-map.wasm"); + const lookupMapContract = await root.createSubAccount("lookup-map-contract"); + await lookupMapContract.deploy("build/lookup-map.wasm"); // Test users const ali = await root.createSubAccount("ali"); diff --git a/tests/__tests__/lookup-set.ava.js b/tests/__tests__/lookup-set.ava.js index 3ba227e81..fe6135252 100644 --- a/tests/__tests__/lookup-set.ava.js +++ b/tests/__tests__/lookup-set.ava.js @@ -9,7 +9,8 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Deploy the test contract. - const lookupSetContract = await root.devDeploy("build/lookup-set.wasm"); + const lookupSetContract = await root.createSubAccount("lookup-set-contract"); + await lookupSetContract.deploy("build/lookup-set.wasm"); // Test users const ali = await root.createSubAccount("ali"); const bob = await root.createSubAccount("bob"); diff --git a/tests/__tests__/test-date-serialization.ava.js b/tests/__tests__/test-date-serialization.ava.js index 46eab5f01..6508b734f 100644 --- a/tests/__tests__/test-date-serialization.ava.js +++ b/tests/__tests__/test-date-serialization.ava.js @@ -9,7 +9,8 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Create and deploy test contract - const dsContract = await root.devDeploy("build/date-serialization.wasm"); + const dsContract = await root.createSubAccount("ds-contract"); + await dsContract.deploy("build/date-serialization.wasm"); // Save state for test runs t.context.worker = worker; diff --git a/tests/__tests__/test-middlewares.ava.js b/tests/__tests__/test-middlewares.ava.js index b0679c33e..d318cf370 100644 --- a/tests/__tests__/test-middlewares.ava.js +++ b/tests/__tests__/test-middlewares.ava.js @@ -9,7 +9,8 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Deploy the contract. - const middlewares = await root.devDeploy("build/middlewares.wasm"); + const middlewares = await root.createSubAccount("middlewares-contract"); + await middlewares.deploy("build/middlewares.wasm"); // Create the init args. const args = JSON.stringify({ randomData: "anything" }); diff --git a/tests/__tests__/unordered-map.ava.js b/tests/__tests__/unordered-map.ava.js index 0d7060a6c..c32f678c4 100644 --- a/tests/__tests__/unordered-map.ava.js +++ b/tests/__tests__/unordered-map.ava.js @@ -9,7 +9,8 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Deploy the test contract. - const unorderedMapContract = await root.devDeploy("build/unordered-map.wasm"); + const unorderedMapContract = await root.createSubAccount("unordered-map-contract"); + await unorderedMapContract.deploy("build/unordered-map.wasm"); // Test users const ali = await root.createSubAccount("ali"); const bob = await root.createSubAccount("bob"); diff --git a/tests/__tests__/unordered-set.ava.js b/tests/__tests__/unordered-set.ava.js index e5b69dab2..fdbd7f3fe 100644 --- a/tests/__tests__/unordered-set.ava.js +++ b/tests/__tests__/unordered-set.ava.js @@ -9,7 +9,8 @@ test.beforeEach(async (t) => { const root = worker.rootAccount; // Deploy the test contract. - const unorderedSetContract = await root.devDeploy("build/unordered-set.wasm"); + const unorderedSetContract = await root.createSubAccount("unordered-set-contract"); + await unorderedSetContract.deploy("build/unordered-set.wasm"); // Test users const ali = await root.createSubAccount("ali");