-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Remove snapshots from protocol-contracts (#5342)
They have been a very annoying source of conflicts, and are not providing any valuable data. Let's remove them.
- Loading branch information
1 parent
1868e25
commit 31ca344
Showing
6 changed files
with
9 additions
and
151 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
yarn-project/protocol-contracts/src/class-registerer/__snapshots__/index.test.ts.snap
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
yarn-project/protocol-contracts/src/class-registerer/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; | ||
|
||
import omit from 'lodash.omit'; | ||
import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/circuits.js'; | ||
|
||
import { ClassRegistererAddress, getCanonicalClassRegisterer } from './index.js'; | ||
|
||
describe('ClassRegisterer', () => { | ||
setupCustomSnapshotSerializers(expect); | ||
it('returns canonical protocol contract', () => { | ||
const contract = getCanonicalClassRegisterer(); | ||
expect(omit(contract, 'artifact')).toMatchSnapshot(); | ||
expect(computeContractAddressFromInstance(contract.instance)).toEqual(contract.address); | ||
expect(getContractClassFromArtifact(contract.artifact).id).toEqual(contract.contractClass.id); | ||
expect(contract.address.toString()).toEqual(ClassRegistererAddress.toString()); | ||
}); | ||
}); |
49 changes: 0 additions & 49 deletions
49
yarn-project/protocol-contracts/src/gas-token/__snapshots__/index.test.ts.snap
This file was deleted.
Oops, something went wrong.
19 changes: 3 additions & 16 deletions
19
yarn-project/protocol-contracts/src/gas-token/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
import { EthAddress } from '@aztec/circuits.js'; | ||
import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; | ||
|
||
import omit from 'lodash.omit'; | ||
import { EthAddress, computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/circuits.js'; | ||
|
||
import { getCanonicalGasToken } from './index.js'; | ||
|
||
describe('GasToken', () => { | ||
setupCustomSnapshotSerializers(expect); | ||
it('returns canonical protocol contract', () => { | ||
// if you're updating the snapshots here then you'll also have to update CANONICAL_GAS_TOKEN_ADDRESS in | ||
// - noir-projects/noir-contracts/contracts/fpc_contract/src/main.nr | ||
// - noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr | ||
const contract = getCanonicalGasToken(EthAddress.ZERO); | ||
expect(omit(contract, ['artifact', 'contractClass'])).toMatchSnapshot(); | ||
|
||
// bytecode is very large | ||
expect(omit(contract.contractClass, ['packedBytecode', 'publicFunctions'])).toMatchSnapshot(); | ||
|
||
// this contract has public bytecode | ||
expect(contract.contractClass.publicFunctions.map(x => omit(x, 'bytecode'))).toMatchSnapshot(); | ||
expect(contract.contractClass.packedBytecode.length).toBeGreaterThan(0); | ||
expect(computeContractAddressFromInstance(contract.instance)).toEqual(contract.address); | ||
expect(getContractClassFromArtifact(contract.artifact).id).toEqual(contract.contractClass.id); | ||
}); | ||
}); |
33 changes: 0 additions & 33 deletions
33
yarn-project/protocol-contracts/src/instance-deployer/__snapshots__/index.test.ts.snap
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
yarn-project/protocol-contracts/src/instance-deployer/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/circuits.js'; | ||
import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; | ||
|
||
import omit from 'lodash.omit'; | ||
|
||
import { InstanceDeployerAddress, getCanonicalInstanceDeployer } from './index.js'; | ||
|
||
describe('InstanceDeployer', () => { | ||
setupCustomSnapshotSerializers(expect); | ||
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(); | ||
expect(omit(contract, 'artifact')).toMatchSnapshot(); | ||
expect(computeContractAddressFromInstance(contract.instance)).toEqual(contract.address); | ||
expect(getContractClassFromArtifact(contract.artifact).id).toEqual(contract.contractClass.id); | ||
expect(contract.address.toString()).toEqual(InstanceDeployerAddress.toString()); | ||
}); | ||
}); |