From 14654403b35d8ca19f32c928fc756441855fd645 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 22 Aug 2023 15:48:59 +0000 Subject: [PATCH] fixes --- .../end-to-end/src/e2e_2_rpc_servers.test.ts | 6 +++--- .../src/e2e_multiple_accounts_1_enc_key.test.ts | 2 +- .../src/e2e_private_token_contract.test.ts | 8 ++++---- .../end-to-end/src/e2e_sandbox_example.test.ts | 13 ++++++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_2_rpc_servers.test.ts b/yarn-project/end-to-end/src/e2e_2_rpc_servers.test.ts index 64017816f1d..8cdb33e0dd4 100644 --- a/yarn-project/end-to-end/src/e2e_2_rpc_servers.test.ts +++ b/yarn-project/end-to-end/src/e2e_2_rpc_servers.test.ts @@ -113,7 +113,7 @@ describe('e2e_2_rpc_servers', () => { await expectTokenBalance(walletA, tokenAddress, userA.address, initialBalance); await expectTokenBalance(walletB, tokenAddress, userB.address, 0n); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 1); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Balance set in constructor']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Balance set in constructor']); // Transfer funds from A to B via RPC server A const contractWithWalletA = await PrivateTokenContract.at(tokenAddress, walletA); @@ -130,7 +130,7 @@ describe('e2e_2_rpc_servers', () => { await expectTokenBalance(walletA, tokenAddress, userA.address, initialBalance - transferAmount1); await expectTokenBalance(walletB, tokenAddress, userB.address, transferAmount1); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 2); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Coins transferred']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Coins transferred']); // Transfer funds from B to A via RPC server B const contractWithWalletB = await PrivateTokenContract.at(tokenAddress, walletB); @@ -147,7 +147,7 @@ describe('e2e_2_rpc_servers', () => { await expectTokenBalance(walletA, tokenAddress, userA.address, initialBalance - transferAmount1 + transferAmount2); await expectTokenBalance(walletB, tokenAddress, userB.address, transferAmount1 - transferAmount2); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 2); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Coins transferred']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Coins transferred']); }, 120_000); const deployChildContractViaServerA = async () => { diff --git a/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts b/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts index 6533534d0f5..fec8584a164 100644 --- a/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts +++ b/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts @@ -96,7 +96,7 @@ describe('e2e_multiple_accounts_1_enc_key', () => { } await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 2); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Coins transferred']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Coins transferred']); logger(`Transfer ${transferAmount} from ${sender} to ${receiver} successful`); }; diff --git a/yarn-project/end-to-end/src/e2e_private_token_contract.test.ts b/yarn-project/end-to-end/src/e2e_private_token_contract.test.ts index e769433b458..c6ef1ab8b49 100644 --- a/yarn-project/end-to-end/src/e2e_private_token_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_private_token_contract.test.ts @@ -58,7 +58,7 @@ describe('e2e_private_token_contract', () => { await expectBalance(receiver, 0n); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 1); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Balance set in constructor']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Balance set in constructor']); }, 30_000); /** @@ -81,7 +81,7 @@ describe('e2e_private_token_contract', () => { await expectBalance(owner, mintAmount); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 1); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Coins minted']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Coins minted']); }, 60_000); /** @@ -97,7 +97,7 @@ describe('e2e_private_token_contract', () => { await expectBalance(receiver, 0n); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 1); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Balance set in constructor']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Balance set in constructor']); const tx = contract.methods.transfer(transferAmount, owner, receiver).send({ origin: owner }); @@ -110,6 +110,6 @@ describe('e2e_private_token_contract', () => { await expectBalance(receiver, transferAmount); await expectsNumOfEncryptedLogsInTheLastBlockToBe(aztecNode, 2); - await expectUnencryptedLogsFromLastBlockToBe(aztecNode, ['Coins transferred']); + await expectUnencryptedLogsFromLastBlockToBe(aztecNode!, ['Coins transferred']); }, 60_000); }); diff --git a/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts b/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts index 59b56695659..6bea997895c 100644 --- a/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts +++ b/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ + /* eslint-disable import/no-duplicates */ // docs:start:imports import { @@ -10,14 +11,14 @@ import { getSchnorrAccount, mustSucceedFetch, } from '@aztec/aztec.js'; -import { PrivateTokenContract } from '@aztec/noir-contracts/types'; - // docs:end:imports /* eslint-enable @typescript-eslint/no-unused-vars */ // Note: this is a hack to make the docs use http://localhost:8080 and CI to use the SANDBOX_URL import { createAztecRpcClient as createAztecRpcClient2 } from '@aztec/aztec.js'; import { defaultFetch } from '@aztec/foundation/json-rpc/client'; +import { PrivateTokenContract } from '@aztec/noir-contracts/types'; + import { expectUnencryptedLogsFromLastBlockToBe } from './fixtures/utils.js'; const { SANDBOX_URL } = process.env; @@ -105,9 +106,11 @@ describe('e2e_sandbox_example', () => { aztecRpc, initialSupply, // the initial supply alice, // the owner of the initial supply - ).send().deployed(); + ) + .send() + .deployed(); - logger(`Contract successfully deployed at address ${contract.address!.toShortString()}`); + logger(`Contract successfully deployed at address ${contract.address!.toShortString()}`); // docs:end:Deployment // ensure that private token contract is registered in the rpc @@ -199,6 +202,6 @@ describe('e2e_sandbox_example', () => { expect(aliceBalance).toBe(initialSupply - transferQuantity); expect(bobBalance).toBe(transferQuantity + mintQuantity); - await expectUnencryptedLogsFromLastBlockToBe(aztecRpc, ["Coins minted"]); + await expectUnencryptedLogsFromLastBlockToBe(aztecRpc, ['Coins minted']); }, 60_000); });