diff --git a/yarn-project/aztec/src/test/testnet_compatibility.test.ts b/yarn-project/aztec/src/test/testnet_compatibility.test.ts new file mode 100644 index 000000000000..d76251c85bc1 --- /dev/null +++ b/yarn-project/aztec/src/test/testnet_compatibility.test.ts @@ -0,0 +1,33 @@ +import type { InitialAccountData } from '@aztec/accounts/testing'; +import { Fr } from '@aztec/aztec.js'; +import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils'; +import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree'; +import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; +import { getGenesisValues } from '@aztec/world-state/testing'; + +/** + * This test suit makes sure that the code in the monorepo is still compatible with the latest version of testnet + * Only update these values after a governance update that changes the protocol is enacted + */ +describe('Testnet compatibility', () => { + it('has expected VK tree root', () => { + expect(getVKTreeRoot()).toEqual( + Fr.fromHexString('0x2339da454741e2360c4e27c6f68767215a5b6ce150527d32d6b6c95aa92ec8c9'), + ); + }); + it('has expected Protocol Contracts tree root', () => { + expect(protocolContractTreeRoot).toEqual( + Fr.fromHexString('0x2efd3fd6b542f09e9f76c84337f46370f67729ce54c815d35866b4cb2a267203'), + ); + }); + it('has expected Genesis tree roots', async () => { + const initialAccounts: InitialAccountData[] = []; + const sponsoredFPCAddress = await getSponsoredFPCAddress(); + const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress); + const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts); + + expect(genesisArchiveRoot).toEqual( + Fr.fromHexString('0x1f9a1f495b0a8f12ebc07e1bea931ea1e2b6f862b6da9d5395ab11c5374ccabb'), + ); + }); +}); diff --git a/yarn-project/aztec/src/test/upgrade.test.ts b/yarn-project/aztec/src/test/upgrade.test.ts deleted file mode 100644 index 0464aa6efdfb..000000000000 --- a/yarn-project/aztec/src/test/upgrade.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -// TODO(#12333): Implement upgrade tests -// Also, needed to add this file so that `aztec/src/**/*.test.ts` as invoked in `yarn-project/bootstrap.sh` is not empty. -describe('Upgrade', () => { - it('should upgrade', () => { - expect(true).toBe(true); - }); -}); diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 75047dafcb3d..e87c7a112ad8 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -106,7 +106,7 @@ function test_cmds { # end-to-end: e2e tests handled separately with end-to-end/bootstrap.sh. # kv-store: Uses mocha so will need different treatment. # noir-bb-bench: A slow pain. Figure out later. - for test in !(end-to-end|kv-store|noir-bb-bench)/src/**/*.test.ts; do + for test in !(end-to-end|kv-store|noir-bb-bench|aztec)/src/**/*.test.ts; do local prefix=$hash local cmd_env="" @@ -144,6 +144,10 @@ function test_cmds { # Uses mocha for browser tests, so we have to treat it differently. echo "$hash cd yarn-project/kv-store && yarn test" echo "$hash cd yarn-project/ivc-integration && yarn test:browser" + + if [ "$CI" -eq 0 ] || [ "${TARGET_BRANCH:-}" != "next" ]; then + echo "$hash yarn-project/scripts/run_test.sh aztec/src/test/testnet_compatibility.test.ts" + fi } function test {