diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e8f705c529..d0f6a6629be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -554,6 +554,28 @@ jobs: name: "Test" command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_note_getter.test.ts + e2e-counter: + docker: + - image: aztecprotocol/alpine-build-image + resource_class: small + steps: + - *checkout + - *setup_env + - run: + name: "Test" + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_counter_contract.test.ts + + e2e-private-voting: + docker: + - image: aztecprotocol/alpine-build-image + resource_class: small + steps: + - *checkout + - *setup_env + - run: + name: "Test" + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_private_voting_contract.test.ts + e2e-multiple-accounts-1-enc-key: docker: - image: aztecprotocol/alpine-build-image @@ -1297,6 +1319,8 @@ workflows: - e2e-inclusion-proofs-contract: *e2e_test - e2e-pending-commitments-contract: *e2e_test - e2e-ordering: *e2e_test + - e2e-counter: *e2e_test + - e2e-private-voting: *e2e_test - uniswap-trade-on-l1-from-l2: *e2e_test - integration-l1-publisher: *e2e_test - integration-archiver-l1-to-l2: *e2e_test @@ -1336,6 +1360,8 @@ workflows: - e2e-inclusion-proofs-contract - e2e-pending-commitments-contract - e2e-ordering + - e2e-counter + - e2e-private-voting - uniswap-trade-on-l1-from-l2 - integration-l1-publisher - integration-archiver-l1-to-l2 diff --git a/yarn-project/end-to-end/src/e2e_counter_contract.test.ts b/yarn-project/end-to-end/src/e2e_counter_contract.test.ts new file mode 100644 index 00000000000..f47c6ba8d20 --- /dev/null +++ b/yarn-project/end-to-end/src/e2e_counter_contract.test.ts @@ -0,0 +1,39 @@ +import { AccountWallet, AztecAddress, CompleteAddress, DebugLogger, TxStatus } from '@aztec/aztec.js'; +import { CounterContract } from '@aztec/noir-contracts.js/Counter'; + +import { setup } from './fixtures/utils.js'; + +describe('e2e_counter_contract', () => { + let wallet: AccountWallet; + let accounts: CompleteAddress[]; + let logger: DebugLogger; + let teardown: () => Promise; + + let counterContract: CounterContract; + let owner: AztecAddress; + + beforeAll(async () => { + // Setup environment + ({ + teardown, + accounts, + wallets: [wallet], + logger, + } = await setup(1)); + owner = accounts[0].address; + + counterContract = await CounterContract.deploy(wallet, 0, owner).send().deployed(); + + logger(`Counter contract deployed at ${counterContract.address}`); + }, 25_000); + + afterAll(() => teardown()); + + describe('increments', () => { + it('counts', async () => { + const receipt = await counterContract.methods.increment(owner).send().wait(); + expect(receipt.status).toBe(TxStatus.MINED); + expect(await counterContract.methods.get_counter(owner).view()).toBe(1n); + }); + }); +}); diff --git a/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts b/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts new file mode 100644 index 00000000000..e76bd607092 --- /dev/null +++ b/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts @@ -0,0 +1,41 @@ +import { AccountWallet, AztecAddress, CompleteAddress, DebugLogger, Fr, TxStatus } from '@aztec/aztec.js'; +import { EasyPrivateVotingContract } from '@aztec/noir-contracts.js/EasyPrivateVoting'; + +import { setup } from './fixtures/utils.js'; + +describe('e2e_voting_contract', () => { + let wallet: AccountWallet; + let accounts: CompleteAddress[]; + let logger: DebugLogger; + let teardown: () => Promise; + + let votingContract: EasyPrivateVotingContract; + let owner: AztecAddress; + + beforeAll(async () => { + // Setup environment + ({ + teardown, + accounts, + wallets: [wallet], + logger, + } = await setup(1)); + owner = accounts[0].address; + + votingContract = await EasyPrivateVotingContract.deploy(wallet, owner).send().deployed(); + + logger(`Counter contract deployed at ${votingContract.address}`); + }, 25_000); + + afterAll(() => teardown()); + + describe('votes', () => { + it('votes', async () => { + const candidate = new Fr(1); + const tx = votingContract.methods.cast_vote(candidate).send(); + const receipt = await tx.wait(); + expect(receipt.status).toBe(TxStatus.MINED); + expect(await votingContract.methods.get_vote(candidate).view()).toBe(1n); + }); + }); +});