Skip to content

Commit

Permalink
e2e nested fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Dec 8, 2023
1 parent 496fe86 commit 1e601ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_nested_contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('e2e_nested_contract', () => {
expect(await getChildStoredValue(childContract)).toEqual(new Fr(42n));
}, 100_000);

it('enqueues multiple public calls with nested public calls', async () => {
it('enqueues multiple public calls with nested public calls', async () => {
await parentContract.methods
.enqueueCallsToPubEntryPoint(childContract.address, childContract.methods.pubIncValue.selector, 42n)
.send()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ contract Parent {
// - followed by one issued directly from this function with value 20.
#[aztec(private)]
fn enqueueCallsToChildWithNestedFirst(targetContract: AztecAddress, targetSelector: FunctionSelector) {
let enqueueCallToChildSelector = compute_selector("enqueueCallToChild((Field),(Field),Field)");
let enqueueCallToChildSelector = compute_selector("enqueueCallToChild((Field),(u32),Field)");
let _ret = context.call_private_function(context.this_address(),
enqueueCallToChildSelector,
[targetContract.to_field(), targetSelector.to_field(), 10]);
Expand All @@ -60,7 +60,7 @@ contract Parent {
#[aztec(private)]
fn enqueueCallsToChildWithNestedLast(targetContract: AztecAddress, targetSelector: FunctionSelector) {
context.call_public_function(targetContract, targetSelector, [20]);
let enqueueCallToChildSelector = compute_selector("enqueueCallToChild((Field),(Field),Field)");
let enqueueCallToChildSelector = compute_selector("enqueueCallToChild((Field),(u32),Field)");
let _ret = context.call_private_function(context.this_address(),
enqueueCallToChildSelector,
[targetContract.to_field(), targetSelector.to_field(), 10]);
Expand All @@ -76,19 +76,19 @@ contract Parent {
}

// Private function to enqueue a call to the pubEntryPoint function of this same contract, passing the target arguments provided
#[aztec(private)]
#[aztec(private)]
fn enqueueCallToPubEntryPoint(targetContract: AztecAddress, targetSelector: FunctionSelector, targetValue: Field) {
let pubEntryPointSelector = compute_selector("pubEntryPoint((Field),(Field),Field)");
let pubEntryPointSelector = compute_selector("pubEntryPoint((Field),(u32),Field)");
let thisAddress = context.this_address();
let _void = context.call_public_function(thisAddress,
pubEntryPointSelector,
[targetContract.to_field(), targetSelector.to_field(), targetValue]);
}

// Private function to enqueue two calls to the pubEntryPoint function of this same contract, passing the target arguments provided
#[aztec(private)]
#[aztec(private)]
fn enqueueCallsToPubEntryPoint(targetContract: AztecAddress, targetSelector: FunctionSelector, targetValue: Field) {
let pubEntryPointSelector = compute_selector("pubEntryPoint((Field),(Field),Field)");
let pubEntryPointSelector = compute_selector("pubEntryPoint((Field),(u32),Field)");
let thisAddress = context.this_address();

context.call_public_function(thisAddress,
Expand Down

0 comments on commit 1e601ad

Please sign in to comment.