-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest version and check-in e2e test that displays console …
…errors
- Loading branch information
1 parent
9f9bc26
commit 90cd4b4
Showing
5 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
contract Fib { | ||
function fib(uint256 n) public pure returns (uint256) { | ||
return n <= 1 ? 1 : fib(n - 1) + fib(n - 2); | ||
} | ||
} |
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,25 @@ | ||
import { ethers } from "ethers"; | ||
import { Wallet } from "zksync-web3"; | ||
import * as hre from "hardhat"; | ||
import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; | ||
import { RichAccounts } from "../helpers/constants"; | ||
import { deployContract, expectThrowsAsync, getTestProvider } from "../helpers/utils"; | ||
|
||
const provider = getTestProvider(); | ||
|
||
describe("Test Fib error flags", function () { | ||
it("Should print to the console NOT ENOUGH ERGS", async function () { | ||
const action = async () => { | ||
const wallet = new Wallet(RichAccounts[0].PrivateKey, provider); | ||
|
||
const deployer = new Deployer(hre, wallet); | ||
const fib = await deployContract(deployer, "Fib"); | ||
const n = await fib.fib(100); | ||
}; | ||
|
||
// This is expected to throw and the console is expected to show: | ||
// XX:YY:ZZ ERROR !! Got error flags: | ||
// XX:YY:ZZ ERROR NOT ENOUGH ERGS | ||
await expectThrowsAsync(action, "call revert exception"); | ||
}); | ||
}); |
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