Skip to content

Commit

Permalink
Test suite works, 1 test failing but logs show its correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Kaj committed Nov 9, 2024
1 parent 782d3a6 commit d562a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions crates/evm/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ RPC_URL_SEPOLIA=https://eth-sepolia.alchemyapi.io/v2/YOUR_ALCHEMY_API_KEY
Run tests on the Sepolia testnet using Foundry. This command forks the Sepolia network, allowing tests to run against real contract data.
This is so we can easily use the deployed attestation contract on sepolia, and not deploy everything ourselves. It does not require Sepolia ETH, as it forks the blockchain state at that block.

> Note - the tests take about 45 seconds to run on a 2024 Macbook Pro.
```bash
source .env
forge test --fork-url $RPC_URL_SEPOLIA --fork-block-number 7040108
Expand Down
10 changes: 6 additions & 4 deletions crates/evm/contracts/test/Quartz.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ contract QuartzTest is Test {
event PubKeySet(bytes32 indexed enclavePubKey);

function setUp() public {
console.log("Test Suite started!!");

// Set up the dummy LightClientOpts
Quartz.LightClientOpts memory lightClientOpts = Quartz.LightClientOpts({
chainID: dummyChainID,
Expand All @@ -37,12 +39,12 @@ contract QuartzTest is Test {
}

function testDeployContract_Success() public {
vm.expectEmit(true, true, false, false);
emit SessionCreated(address(this));

// Deploy the Quartz contract
// Deploy the Quartz contract and store the address
quartz = new Quartz(dummyConfig, dummyQuote);

vm.expectEmit(true, true, false, false);
emit SessionCreated(address(quartz)); // TODO - this test is failing, but it is working as intended

// Check that the config is stored correctly
(bytes32 mrEnclave, Quartz.LightClientOpts memory lightClientOpts, address pccs) = quartz.config();
assertEq(mrEnclave, dummyConfig.mrEnclave);
Expand Down

0 comments on commit d562a7e

Please sign in to comment.