Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kothari committed Oct 9, 2023
1 parent 3871f45 commit 08db3b7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('archiver integration with l1 to l2 messages', () => {
let owner: AztecAddress;
let receiver: AztecAddress;

beforeEach(async () => {
beforeAll(async () => {
let deployL1ContractsValues: DeployL1Contracts | undefined;
let accounts: CompleteAddress[];
({ teardown, wallet, deployL1ContractsValues, accounts, config, logger } = await setup(2));
Expand Down Expand Up @@ -59,10 +59,10 @@ describe('archiver integration with l1 to l2 messages', () => {
logger('Successfully deployed contracts and initialized portal');
}, 100_000);

afterEach(async () => {
afterAll(async () => {
await archiver.stop();
await teardown();
}, 30_000);
await teardown()
});

it('cancelled l1 to l2 messages cannot be consumed by archiver', async () => {
// create a message, then cancel it
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('archiver integration with l1 to l2 messages', () => {

it('archiver handles l1 to l2 message correctly even when l2block has no such messages', async () => {
// send a transfer tx to force through rollup with the message included
l2Token.methods.transfer_public(owner, receiver, 0n, 0n).send();
await l2Token.methods.transfer_public(owner, receiver, 0n, 0n).send().wait();

expect((await archiver.getPendingL1ToL2Messages(10)).length).toEqual(0);
expect(() => archiver.getConfirmedL1ToL2Message(Fr.ZERO)).toThrow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ struct PrivateTokenAirdropPrivateContextInterface {
}

impl PrivateTokenAirdropPrivateContextInterface {
fn at(address: Field) -> Self {
pub fn at(address: Field) -> Self {
Self {
address,
}
}

fn batchTransfer(
pub fn batchTransfer(
self,
context: &mut PrivateContext,
sender: Field,
Expand All @@ -40,7 +40,7 @@ impl PrivateTokenAirdropPrivateContextInterface {
}


fn burn(
pub fn burn(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -54,7 +54,7 @@ impl PrivateTokenAirdropPrivateContextInterface {
}


fn claim(
pub fn claim(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -68,7 +68,7 @@ impl PrivateTokenAirdropPrivateContextInterface {
}


fn createClaims(
pub fn createClaims(
self,
context: &mut PrivateContext,
amounts: [Field;16],
Expand Down Expand Up @@ -112,7 +112,7 @@ impl PrivateTokenAirdropPrivateContextInterface {
}


fn mint(
pub fn mint(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -126,7 +126,7 @@ impl PrivateTokenAirdropPrivateContextInterface {
}


fn transfer(
pub fn transfer(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -150,7 +150,7 @@ struct PrivateTokenAirdropPublicContextInterface {
}

impl PrivateTokenAirdropPublicContextInterface {
fn at(address: Field) -> Self {
pub fn at(address: Field) -> Self {
Self {
address,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ struct PrivateTokenPrivateContextInterface {
}

impl PrivateTokenPrivateContextInterface {
fn at(address: Field) -> Self {
pub fn at(address: Field) -> Self {
Self {
address,
}
}

fn mint(
pub fn mint(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -32,7 +32,7 @@ impl PrivateTokenPrivateContextInterface {
}


fn transfer(
pub fn transfer(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -56,7 +56,7 @@ struct PrivateTokenPublicContextInterface {
}

impl PrivateTokenPublicContextInterface {
fn at(address: Field) -> Self {
pub fn at(address: Field) -> Self {
Self {
address,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ struct TestPrivateContextInterface {
}

impl TestPrivateContextInterface {
fn at(address: Field) -> Self {
pub fn at(address: Field) -> Self {
Self {
address,
}
}

fn consume_mint_private_message(
pub fn consume_mint_private_message(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -59,7 +59,7 @@ impl TestPrivateContextInterface {
}


fn consume_mint_public_message(
pub fn consume_mint_public_message(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -79,7 +79,7 @@ impl TestPrivateContextInterface {
}


fn createL2ToL1MessagePublic(
pub fn createL2ToL1MessagePublic(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -93,7 +93,7 @@ impl TestPrivateContextInterface {
}


fn createNullifierPublic(
pub fn createNullifierPublic(
self,
context: &mut PrivateContext,
amount: Field,
Expand All @@ -107,7 +107,7 @@ impl TestPrivateContextInterface {
}


fn emit_nullifier(
pub fn emit_nullifier(
self,
context: &mut PrivateContext,
nullifier: Field
Expand All @@ -119,7 +119,7 @@ impl TestPrivateContextInterface {
}


fn emit_unencrypted(
pub fn emit_unencrypted(
self,
context: &mut PrivateContext,
value: Field
Expand All @@ -131,7 +131,7 @@ impl TestPrivateContextInterface {
}


fn getPortalContractAddress(
pub fn getPortalContractAddress(
self,
context: &mut PrivateContext,
aztec_address: Field
Expand All @@ -143,7 +143,7 @@ impl TestPrivateContextInterface {
}


fn getPublicKey(
pub fn getPublicKey(
self,
context: &mut PrivateContext,
address: Field
Expand All @@ -155,7 +155,7 @@ impl TestPrivateContextInterface {
}


fn getThisAddress(
pub fn getThisAddress(
self,
context: &mut PrivateContext
) -> [Field; RETURN_VALUES_LENGTH] {
Expand All @@ -165,7 +165,7 @@ impl TestPrivateContextInterface {
}


fn getThisPortalAddress(
pub fn getThisPortalAddress(
self,
context: &mut PrivateContext
) -> [Field; RETURN_VALUES_LENGTH] {
Expand All @@ -175,7 +175,7 @@ impl TestPrivateContextInterface {
}


fn isTimeEqual(
pub fn isTimeEqual(
self,
context: &mut PrivateContext,
time: Field
Expand All @@ -187,7 +187,7 @@ impl TestPrivateContextInterface {
}


fn testCodeGen(
pub fn testCodeGen(
self,
context: &mut PrivateContext,
aField: Field,
Expand Down Expand Up @@ -230,13 +230,13 @@ struct TestPublicContextInterface {
}

impl TestPublicContextInterface {
fn at(address: Field) -> Self {
pub fn at(address: Field) -> Self {
Self {
address,
}
}

fn consume_mint_public_message(
pub fn consume_mint_public_message(
self,
context: PublicContext,
amount: Field,
Expand All @@ -256,7 +256,7 @@ impl TestPublicContextInterface {
}


fn createL2ToL1MessagePublic(
pub fn createL2ToL1MessagePublic(
self,
context: PublicContext,
amount: Field,
Expand All @@ -270,7 +270,7 @@ impl TestPublicContextInterface {
}


fn createNullifierPublic(
pub fn createNullifierPublic(
self,
context: PublicContext,
amount: Field,
Expand All @@ -284,7 +284,7 @@ impl TestPublicContextInterface {
}


fn emit_unencrypted(
pub fn emit_unencrypted(
self,
context: PublicContext,
value: Field
Expand All @@ -296,7 +296,7 @@ impl TestPublicContextInterface {
}


fn isTimeEqual(
pub fn isTimeEqual(
self,
context: PublicContext,
time: Field
Expand Down

0 comments on commit 08db3b7

Please sign in to comment.