Skip to content

Commit

Permalink
feat: add fork tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e committed Jul 27, 2023
1 parent f3a4455 commit 84f59dd
Show file tree
Hide file tree
Showing 23 changed files with 2,547 additions and 470 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: forge build

- name: Run Forge tests
run: forge test --fork-url https://rpc.ankr.com/polygon_mumbai -vvvv
run: forge test --fork-url https://gateway.tenderly.co/public/polygon-mumbai -vvvv
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at d00ace
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"prettier-plugin-solidity": "^1.0.0-beta.13"
},
"scripts": {
"test": "forge test --fork-url https://gateway.tenderly.co/public/polygon-mumbai",
"lint": "prettier --write **.sol"
}
}
3 changes: 2 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
forge-std/=lib/forge-std/src/
forge-std/=lib/forge-std/src/
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
24 changes: 12 additions & 12 deletions src/SismoConnectLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ pragma solidity ^0.8.17;

import {IAddressesProvider} from "./interfaces/IAddressesProvider.sol";
import {ISismoConnectVerifier, SismoConnectVerifiedResult} from "./interfaces/ISismoConnectVerifier.sol";
import {IAuthRequestBuilder, AuthRequest, AuthType} from "./interfaces/IAuthRequestBuilder.sol";
import {IClaimRequestBuilder, ClaimRequest, ClaimType} from "./interfaces/IClaimRequestBuilder.sol";
import {ISignatureBuilder, SignatureRequest} from "./interfaces/ISignatureBuilder.sol";
import {IRequestBuilder, AuthRequest, ClaimRequest, SignatureRequest, SismoConnectRequest} from "./interfaces/IRequestBuilder.sol";
import {AuthRequestBuilder, AuthRequest, AuthType} from "./utils/AuthRequestBuilder.sol";
import {ClaimRequestBuilder, ClaimRequest, ClaimType} from "./utils/ClaimRequestBuilder.sol";
import {SignatureBuilder, SignatureRequest} from "./utils/SignatureBuilder.sol";
import {RequestBuilder, AuthRequest, ClaimRequest, SignatureRequest, SismoConnectRequest} from "./utils/RequestBuilder.sol";

import {Auth, VerifiedAuth, Claim, VerifiedClaim, Signature, SismoConnectResponse, SismoConnectConfig, VaultConfig} from "./utils/Structs.sol";
import {SismoConnectHelper} from "./utils/SismoConnectHelper.sol";
Expand All @@ -20,10 +20,10 @@ contract SismoConnect {
ISismoConnectVerifier immutable _sismoConnectVerifier;

// external libraries
IAuthRequestBuilder immutable _authRequestBuilder;
IClaimRequestBuilder immutable _claimRequestBuilder;
ISignatureBuilder immutable _signatureBuilder;
IRequestBuilder immutable _requestBuilder;
AuthRequestBuilder immutable _authRequestBuilder;
ClaimRequestBuilder immutable _claimRequestBuilder;
SignatureBuilder immutable _signatureBuilder;
RequestBuilder immutable _requestBuilder;

// config
bytes16 public immutable APP_ID;
Expand All @@ -37,16 +37,16 @@ contract SismoConnect {
ADDRESSES_PROVIDER_V2.get(string("sismoConnectVerifier-v1.2"))
);
// external libraries
_authRequestBuilder = IAuthRequestBuilder(
_authRequestBuilder = AuthRequestBuilder(
ADDRESSES_PROVIDER_V2.get(string("authRequestBuilder-v1.1"))
);
_claimRequestBuilder = IClaimRequestBuilder(
_claimRequestBuilder = ClaimRequestBuilder(
ADDRESSES_PROVIDER_V2.get(string("claimRequestBuilder-v1.1"))
);
_signatureBuilder = ISignatureBuilder(
_signatureBuilder = SignatureBuilder(
ADDRESSES_PROVIDER_V2.get(string("signatureBuilder-v1.1"))
);
_requestBuilder = IRequestBuilder(ADDRESSES_PROVIDER_V2.get(string("requestBuilder-v1.1")));
_requestBuilder = RequestBuilder(ADDRESSES_PROVIDER_V2.get(string("requestBuilder-v1.1")));
}

// public function because it needs to be used by this contract and can be used by other contracts
Expand Down
94 changes: 0 additions & 94 deletions src/interfaces/IAuthRequestBuilder.sol

This file was deleted.

170 changes: 0 additions & 170 deletions src/interfaces/IClaimRequestBuilder.sol

This file was deleted.

Loading

0 comments on commit 84f59dd

Please sign in to comment.