@aztec/acir-simulator
Advanced tools
Comparing version 0.7.2 to 0.7.3
{ | ||
"name": "@aztec/acir-simulator", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"exports": "./dest/index.js", | ||
"type": "module", | ||
"dependencies": { | ||
"@aztec/circuits.js": "0.7.2", | ||
"@aztec/foundation": "0.7.2", | ||
"@aztec/types": "0.7.2", | ||
"@aztec/circuits.js": "0.7.3", | ||
"@aztec/foundation": "0.7.3", | ||
"@aztec/types": "0.7.3", | ||
"@noir-lang/acvm_js": "0.26.1", | ||
@@ -11,0 +11,0 @@ "levelup": "^5.1.1", |
@@ -114,3 +114,3 @@ import { CircuitsWasm, HistoricBlockData, ReadRequestMembershipWitness, TxContext } from '@aztec/circuits.js'; | ||
); | ||
return [toACVMField(secretKey.high), toACVMField(secretKey.low)]; | ||
return [toACVMField(secretKey.low), toACVMField(secretKey.high)]; | ||
} | ||
@@ -117,0 +117,0 @@ |
@@ -13,2 +13,3 @@ import { | ||
PublicCallRequest, | ||
PublicKey, | ||
TxContext, | ||
@@ -70,2 +71,7 @@ } from '@aztec/circuits.js'; | ||
const ownerPk = GrumpkinScalar.fromString('2dcc5485a58316776299be08c78fa3788a1a7961ae30dc747fb1be17692a8d32'); | ||
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec'); | ||
let owner: AztecAddress; | ||
let recipient: AztecAddress; | ||
let ownerCompleteAddress: CompleteAddress; | ||
let recipientCompleteAddress: CompleteAddress; | ||
@@ -147,2 +153,8 @@ const treeHeights: { [name: string]: number } = { | ||
logger = createDebugLogger('aztec:test:private_execution'); | ||
ownerCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(ownerPk, Fr.random()); | ||
recipientCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(recipientPk, Fr.random()); | ||
owner = ownerCompleteAddress.address; | ||
recipient = recipientCompleteAddress.address; | ||
}); | ||
@@ -152,3 +164,7 @@ | ||
oracle = mock<DBOracle>(); | ||
oracle.getSecretKey.mockResolvedValue(ownerPk); | ||
oracle.getSecretKey.mockImplementation((contractAddress: AztecAddress, pubKey: PublicKey) => { | ||
if (pubKey.equals(ownerCompleteAddress.publicKey)) return Promise.resolve(ownerPk); | ||
if (pubKey.equals(recipientCompleteAddress.publicKey)) return Promise.resolve(recipientPk); | ||
throw new Error(`Unknown address ${pubKey}`); | ||
}); | ||
oracle.getHistoricBlockData.mockResolvedValue(blockData); | ||
@@ -174,6 +190,3 @@ | ||
const contractAddress = defaultContractAddress; | ||
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec'); | ||
const mockFirstNullifier = new Fr(1111); | ||
let owner: AztecAddress; | ||
let recipient: AztecAddress; | ||
let currentNoteIndex = 0n; | ||
@@ -205,9 +218,3 @@ | ||
beforeEach(async () => { | ||
const ownerCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(ownerPk, Fr.random()); | ||
const recipientCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(recipientPk, Fr.random()); | ||
owner = ownerCompleteAddress.address; | ||
recipient = recipientCompleteAddress.address; | ||
beforeEach(() => { | ||
oracle.getCompleteAddress.mockImplementation((address: AztecAddress) => { | ||
@@ -245,4 +252,4 @@ if (address.equals(owner)) return Promise.resolve(ownerCompleteAddress); | ||
uniqueSiloedNoteHash.toBuffer(), | ||
ownerPk.low.toBuffer(), | ||
ownerPk.high.toBuffer(), | ||
ownerPk.low.toBuffer(), | ||
]), | ||
@@ -405,6 +412,3 @@ ); | ||
const contractAddress = defaultContractAddress; | ||
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec'); | ||
const mockFirstNullifier = new Fr(1111); | ||
let owner: AztecAddress; | ||
let recipient: AztecAddress; | ||
let currentNoteIndex = 0n; | ||
@@ -436,9 +440,3 @@ | ||
beforeEach(async () => { | ||
const ownerCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(ownerPk, Fr.random()); | ||
const recipientCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(recipientPk, Fr.random()); | ||
owner = ownerCompleteAddress.address; | ||
recipient = recipientCompleteAddress.address; | ||
beforeEach(() => { | ||
oracle.getCompleteAddress.mockImplementation((address: AztecAddress) => { | ||
@@ -476,4 +474,4 @@ if (address.equals(owner)) return Promise.resolve(ownerCompleteAddress); | ||
uniqueSiloedNoteHash.toBuffer(), | ||
ownerPk.low.toBuffer(), | ||
ownerPk.high.toBuffer(), | ||
ownerPk.low.toBuffer(), | ||
]), | ||
@@ -694,9 +692,4 @@ ); | ||
const contractAddress = defaultContractAddress; | ||
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec'); | ||
let recipient: AztecAddress; | ||
beforeEach(async () => { | ||
const recipientCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(recipientPk, Fr.random()); | ||
recipient = recipientCompleteAddress.address; | ||
beforeEach(() => { | ||
oracle.getCompleteAddress.mockImplementation((address: AztecAddress) => { | ||
@@ -823,9 +816,3 @@ if (address.equals(recipient)) return Promise.resolve(recipientCompleteAddress); | ||
describe('pending commitments contract', () => { | ||
let owner: AztecAddress; | ||
beforeEach(async () => { | ||
const ownerCompleteAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(ownerPk, Fr.random()); | ||
owner = ownerCompleteAddress.address; | ||
beforeEach(() => { | ||
oracle.getCompleteAddress.mockImplementation((address: AztecAddress) => { | ||
@@ -832,0 +819,0 @@ if (address.equals(owner)) return Promise.resolve(ownerCompleteAddress); |
@@ -71,3 +71,5 @@ import { CallContext, FunctionData, MAX_NOTE_FIELDS_LENGTH, TxContext } from '@aztec/circuits.js'; | ||
if (request.origin !== contractAddress) { | ||
this.log.warn('Request origin does not match contract address in simulation'); | ||
this.log.warn( | ||
`Request origin does not match contract address in simulation. Request origin: ${request.origin}, contract address: ${contractAddress}`, | ||
); | ||
} | ||
@@ -74,0 +76,0 @@ |
743551
129
9226
+ Added@aztec/circuits.js@0.7.3(transitive)
+ Added@aztec/foundation@0.7.3(transitive)
+ Added@aztec/types@0.7.3(transitive)
- Removed@aztec/circuits.js@0.7.2(transitive)
- Removed@aztec/foundation@0.7.2(transitive)
- Removed@aztec/types@0.7.2(transitive)
Updated@aztec/circuits.js@0.7.3
Updated@aztec/foundation@0.7.3
Updated@aztec/types@0.7.3