diff --git a/yarn-project/protocol-contracts/src/class-registerer/__snapshots__/index.test.ts.snap b/yarn-project/protocol-contracts/src/class-registerer/__snapshots__/index.test.ts.snap index 91ea0b6455b0..6292d1e68c6b 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/__snapshots__/index.test.ts.snap +++ b/yarn-project/protocol-contracts/src/class-registerer/__snapshots__/index.test.ts.snap @@ -136,7 +136,7 @@ exports[`ClassRegisterer returns canonical protocol contract 1`] = ` { "isInternal": false, "selector": FunctionSelector { - "value": 595568763, + "value": 588837637, }, "vkHash": Fr { "asBigInt": 0n, @@ -182,7 +182,7 @@ exports[`ClassRegisterer returns canonical protocol contract 1`] = ` { "isInternal": false, "selector": FunctionSelector { - "value": 588837637, + "value": 595568763, }, "vkHash": Fr { "asBigInt": 0n, @@ -228,7 +228,7 @@ exports[`ClassRegisterer returns canonical protocol contract 1`] = ` { "isInternal": false, "selector": FunctionSelector { - "value": 2432309179, + "value": 1669488881, }, "vkHash": Fr { "asBigInt": 0n, @@ -274,7 +274,7 @@ exports[`ClassRegisterer returns canonical protocol contract 1`] = ` { "isInternal": false, "selector": FunctionSelector { - "value": 1669488881, + "value": 2432309179, }, "vkHash": Fr { "asBigInt": 0n, diff --git a/yarn-project/protocol-contracts/src/class-registerer/index.test.ts b/yarn-project/protocol-contracts/src/class-registerer/index.test.ts index 3ec33b4a2ea2..bfe56c7340cb 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/index.test.ts +++ b/yarn-project/protocol-contracts/src/class-registerer/index.test.ts @@ -5,6 +5,8 @@ import { ClassRegistererAddress, getCanonicalClassRegisterer } from './index.js' describe('ClassRegisterer', () => { it('returns canonical protocol contract', () => { const contract = getCanonicalClassRegisterer(); + contract.contractClass.privateFunctions.sort((a, b) => a.selector.value - b.selector.value); + contract.contractClass.publicFunctions.sort((a, b) => a.selector.value - b.selector.value); expect(omit(contract, 'artifact')).toMatchSnapshot(); expect(contract.address.toString()).toEqual(ClassRegistererAddress.toString()); }); diff --git a/yarn-project/protocol-contracts/src/instance-deployer/__snapshots__/index.test.ts.snap b/yarn-project/protocol-contracts/src/instance-deployer/__snapshots__/index.test.ts.snap index 75d1e78ef410..483d619e4535 100644 --- a/yarn-project/protocol-contracts/src/instance-deployer/__snapshots__/index.test.ts.snap +++ b/yarn-project/protocol-contracts/src/instance-deployer/__snapshots__/index.test.ts.snap @@ -136,7 +136,7 @@ exports[`InstanceDeployer returns canonical protocol contract 1`] = ` { "isInternal": false, "selector": FunctionSelector { - "value": 2432309179, + "value": 2285065643, }, "vkHash": Fr { "asBigInt": 0n, @@ -182,7 +182,7 @@ exports[`InstanceDeployer returns canonical protocol contract 1`] = ` { "isInternal": false, "selector": FunctionSelector { - "value": 2285065643, + "value": 2432309179, }, "vkHash": Fr { "asBigInt": 0n, diff --git a/yarn-project/protocol-contracts/src/instance-deployer/index.test.ts b/yarn-project/protocol-contracts/src/instance-deployer/index.test.ts index 5cb4a22da625..463d2b42e2a4 100644 --- a/yarn-project/protocol-contracts/src/instance-deployer/index.test.ts +++ b/yarn-project/protocol-contracts/src/instance-deployer/index.test.ts @@ -4,7 +4,11 @@ import { InstanceDeployerAddress, getCanonicalInstanceDeployer } from './index.j describe('InstanceDeployer', () => { it('returns canonical protocol contract', () => { + // TODO(@spalladino): Consider sorting functions by selector when constructing the contract + // class, or even better, when calling loadContractArtifact from the Noir output. const contract = getCanonicalInstanceDeployer(); + contract.contractClass.privateFunctions.sort((a, b) => a.selector.value - b.selector.value); + contract.contractClass.publicFunctions.sort((a, b) => a.selector.value - b.selector.value); expect(omit(contract, 'artifact')).toMatchSnapshot(); expect(contract.address.toString()).toEqual(InstanceDeployerAddress.toString()); });