Skip to content

Commit

Permalink
fix-issue-364: update devDeploy to create account and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
fospring committed Sep 4, 2023
1 parent f307517 commit ebffc67
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion tests/__tests__/bytes.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 2 additions & 4 deletions tests/__tests__/function-params.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/lookup-map.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/lookup-set.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/test-date-serialization.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/test-middlewares.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/unordered-map.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/unordered-set.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit ebffc67

Please sign in to comment.