Skip to content

Commit

Permalink
test: check blocks in contract deploy e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Oct 12, 2023
1 parent 79ea714 commit b9d0624
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions yarn-project/end-to-end/src/e2e_deploy_contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ describe('e2e_deploy_contract', () => {
const goodDeploy = new ContractDeployer(TestAssertContractArtifact, wallet).deploy(0);
const badDeploy = new ContractDeployer(TestAssertContractArtifact, wallet).deploy(1);

await Promise.all([
goodDeploy.simulate({ skipPublicSimulation: true }),
badDeploy.simulate({ skipPublicSimulation: true }),
]);

const [goodTx, badTx] = [
goodDeploy.send({ skipPublicSimulation: true }),
badDeploy.send({ skipPublicSimulation: true }),
Expand All @@ -145,6 +150,11 @@ describe('e2e_deploy_contract', () => {
expect(goodTxPromiseResult.status).toBe('fulfilled');
expect(badTxReceiptResult.status).toBe('rejected');

const [goodTxReceipt, badTxReceipt] = await Promise.all([goodTx.getReceipt(), badTx.getReceipt()]);

expect(goodTxReceipt.blockNumber).toEqual(expect.any(Number));
expect(badTxReceipt.blockNumber).toBeUndefined();

await expect(pxe.getExtendedContractData(goodDeploy.completeAddress!.address)).resolves.toBeDefined();
await expect(pxe.getExtendedContractData(goodDeploy.completeAddress!.address)).resolves.toBeDefined();

Expand Down

0 comments on commit b9d0624

Please sign in to comment.