-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Take a deep copy of circuit inputs for proving (#5777)
This PR ensures we take a copy of the circuit inputs during simulation for use in proving.
- Loading branch information
1 parent
8ebbe57
commit 785591e
Showing
10 changed files
with
158 additions
and
65 deletions.
There are no files selected for viewing
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
10 changes: 10 additions & 0 deletions
10
yarn-project/circuits.js/src/structs/kernel/public_call_data.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { makePublicCallData } from '../../tests/factories.js'; | ||
import { PublicCallData } from './public_call_data.js'; | ||
|
||
describe('PublicCallData', () => { | ||
it('PublicCallData after serialization and deserialization is equal to the original', () => { | ||
const original = makePublicCallData(123, true); | ||
const serialized = PublicCallData.fromBuffer(original.toBuffer()); | ||
expect(original).toEqual(serialized); | ||
}); | ||
}); |
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
17 changes: 17 additions & 0 deletions
17
yarn-project/circuits.js/src/structs/kernel/public_kernel_circuit_private_inputs.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { makePublicKernelCircuitPrivateInputs } from '../../tests/factories.js'; | ||
import { PublicKernelCircuitPrivateInputs } from './public_kernel_circuit_private_inputs.js'; | ||
|
||
describe('PublicKernelCircuitPrivateInputs', () => { | ||
it('PublicKernelCircuitPrivateInputs after serialization and deserialization is equal to the original', () => { | ||
const original = makePublicKernelCircuitPrivateInputs(123); | ||
const serialized = PublicKernelCircuitPrivateInputs.fromBuffer(original.toBuffer()); | ||
expect(original).toEqual(serialized); | ||
}); | ||
|
||
it('PublicKernelCircuitPrivateInputs after clone is equal to the original', () => { | ||
const original = makePublicKernelCircuitPrivateInputs(123); | ||
const serialized = original.clone(); | ||
expect(original).toEqual(serialized); | ||
expect(original).not.toBe(serialized); | ||
}); | ||
}); |
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
17 changes: 17 additions & 0 deletions
17
...-project/circuits.js/src/structs/kernel/public_kernel_tail_circuit_private_inputs.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { makePublicKernelTailCircuitPrivateInputs } from '../../tests/factories.js'; | ||
import { PublicKernelTailCircuitPrivateInputs } from './public_kernel_tail_circuit_private_inputs.js'; | ||
|
||
describe('PublicKernelTailCircuitPrivateInputs', () => { | ||
it('PublicKernelTailCircuitPrivateInputs after serialization and deserialization is equal to the original', () => { | ||
const original = makePublicKernelTailCircuitPrivateInputs(123); | ||
const serialized = PublicKernelTailCircuitPrivateInputs.fromBuffer(original.toBuffer()); | ||
expect(original).toEqual(serialized); | ||
}); | ||
|
||
it('PublicKernelTailCircuitPrivateInputs after clone is equal to the original', () => { | ||
const original = makePublicKernelTailCircuitPrivateInputs(123); | ||
const serialized = original.clone(); | ||
expect(original).toEqual(serialized); | ||
expect(original).not.toBe(serialized); | ||
}); | ||
}); |
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
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
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
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