Skip to content

Commit

Permalink
fix sdk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Dec 1, 2023
1 parent 9a9673d commit f827ebc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 177 deletions.
3 changes: 0 additions & 3 deletions packages/sdk/.env.sample

This file was deleted.

72 changes: 3 additions & 69 deletions packages/sdk/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,16 @@
import "@typechain/hardhat"
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-waffle"
import "hardhat-deploy"
import dotenv from "dotenv"
import { HardhatUserConfig } from "hardhat/config"
import type { HttpNetworkUserConfig } from "hardhat/types"
import yargs from "yargs"
import { HardhatUserConfig } from "hardhat/types"

const argv = yargs
.option("network", {
type: "string",
default: "hardhat",
})
.help(false)
.version(false).argv

// Load environment variables.
dotenv.config()
const { INFURA_KEY, MNEMONIC, PK } = process.env

const DEFAULT_MNEMONIC =
"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat"

const sharedNetworkConfig: HttpNetworkUserConfig = {}
if (PK) {
sharedNetworkConfig.accounts = [PK]
} else {
sharedNetworkConfig.accounts = {
mnemonic: MNEMONIC || DEFAULT_MNEMONIC,
}
}

if (["goerli", "mainnet"].includes(argv.network) && INFURA_KEY === undefined) {
throw new Error(
`Could not find Infura key in env, unable to connect to network ${argv.network}`
)
}
import evmConfig from "../evm/hardhat.config"

const config: HardhatUserConfig = {
...evmConfig,
paths: {
root: "../evm",
artifacts: "build/artifacts",
cache: "build/cache",
sources: "contracts",
tests: "../sdk/test",
},
solidity: {
compilers: [{ version: "0.8.17" }],
settings: {
optimizer: {
enabled: true,
runs: 100,
},
},
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
},
mainnet: {
...sharedNetworkConfig,
chainId: 1,
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
},
goerli: {
...sharedNetworkConfig,
url: `https://goerli.infura.io/v3/${INFURA_KEY}`,
},
gnosis: {
...sharedNetworkConfig,
chainId: 100,
url: "https://rpc.gnosischain.com/",
},
matic: {
...sharedNetworkConfig,
url: "https://rpc-mainnet.maticvigil.com",
},
},
mocha: {
timeout: 2000000,
},
Expand Down
11 changes: 7 additions & 4 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"fix:prettier": "prettier \"src/**/*.ts\" --write",
"fix:lint": "eslint src --ext .ts --fix",
"test": "hardhat test",
"test:watch": "yarn mocha -w",
"pre-commit": "yarn fix",
"prepare": "yarn eth-sdk"
},
Expand All @@ -61,8 +60,11 @@
"@dethcrypto/eth-sdk": "^0.3.4",
"@dethcrypto/eth-sdk-client": "^0.1.6",
"@gnosis.pm/zodiac": "^3.4.2",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@typechain/ethers-v5": "^10.2.1",
"@typechain/hardhat": "^6.1.6",
"@types/chai": "^4.3.1",
Expand All @@ -79,7 +81,8 @@
"eslint-plugin-prettier": "^4.2.1",
"ethereum-waffle": "^3.4.4",
"hardhat": "^2.19.1",
"hardhat-deploy": "^0.11.44",
"hardhat-contract-sizer": "2.10.0",
"hardhat-gas-reporter": "1.0.9",
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"ts-node": "^10.8.0",
Expand All @@ -93,4 +96,4 @@
"installConfig": {
"hoistingLimits": "workspaces"
}
}
}
3 changes: 1 addition & 2 deletions packages/sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
"zodiac-roles-sdk": ["./src/index.ts"]
}
},
"include": ["./src", "./test"],
"files": ["./hardhat.config.ts", "src/utils/groupBy.ts"]
"include": ["./src", "./test"]
}
114 changes: 15 additions & 99 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ __metadata:
languageName: node
linkType: hard

"@ethersproject/contracts@npm:5.7.0, @ethersproject/contracts@npm:^5.7.0":
"@ethersproject/contracts@npm:5.7.0":
version: 5.7.0
resolution: "@ethersproject/contracts@npm:5.7.0"
dependencies:
Expand Down Expand Up @@ -1060,7 +1060,7 @@ __metadata:
languageName: node
linkType: hard

"@ethersproject/solidity@npm:5.7.0, @ethersproject/solidity@npm:^5.7.0":
"@ethersproject/solidity@npm:5.7.0":
version: 5.7.0
resolution: "@ethersproject/solidity@npm:5.7.0"
dependencies:
Expand Down Expand Up @@ -1113,7 +1113,7 @@ __metadata:
languageName: node
linkType: hard

"@ethersproject/wallet@npm:5.7.0, @ethersproject/wallet@npm:^5.7.0":
"@ethersproject/wallet@npm:5.7.0":
version: 5.7.0
resolution: "@ethersproject/wallet@npm:5.7.0"
dependencies:
Expand Down Expand Up @@ -2575,19 +2575,6 @@ __metadata:
languageName: node
linkType: hard

"@nomiclabs/hardhat-waffle@npm:^2.0.6":
version: 2.0.6
resolution: "@nomiclabs/hardhat-waffle@npm:2.0.6"
peerDependencies:
"@nomiclabs/hardhat-ethers": ^2.0.0
"@types/sinon-chai": ^3.2.3
ethereum-waffle: "*"
ethers: ^5.0.0
hardhat: ^2.0.0
checksum: e43592b135739c7f077a9d0a38a479a5512000e58f91d684e6a0d4f0894f8f826821d0b637e2cd7b646669ba12300fcb5e180bcc2473f5cc67d55f44ab809770
languageName: node
linkType: hard

"@npmcli/agent@npm:^2.0.0":
version: 2.2.0
resolution: "@npmcli/agent@npm:2.2.0"
Expand Down Expand Up @@ -4036,7 +4023,7 @@ __metadata:
languageName: node
linkType: hard

"@types/qs@npm:^6.2.31, @types/qs@npm:^6.9.7":
"@types/qs@npm:^6.2.31":
version: 6.9.10
resolution: "@types/qs@npm:6.9.10"
checksum: 3e479ee056bd2b60894baa119d12ecd33f20a25231b836af04654e784c886f28a356477630430152a86fba253da65d7ecd18acffbc2a8877a336e75aa0272c67
Expand Down Expand Up @@ -7442,7 +7429,7 @@ __metadata:
languageName: node
linkType: hard

"chokidar@npm:3.5.3, chokidar@npm:^3.4.0, chokidar@npm:^3.5.2, chokidar@npm:^3.5.3":
"chokidar@npm:3.5.3, chokidar@npm:^3.4.0, chokidar@npm:^3.5.3":
version: 3.5.3
resolution: "chokidar@npm:3.5.3"
dependencies:
Expand Down Expand Up @@ -9408,7 +9395,7 @@ __metadata:
languageName: node
linkType: hard

"encode-utf8@npm:^1.0.2, encode-utf8@npm:^1.0.3":
"encode-utf8@npm:^1.0.3":
version: 1.0.3
resolution: "encode-utf8@npm:1.0.3"
checksum: 550224bf2a104b1d355458c8a82e9b4ea07f9fc78387bc3a49c151b940ad26473de8dc9e121eefc4e84561cb0b46de1e4cd2bc766f72ee145e9ea9541482817f
Expand Down Expand Up @@ -9472,7 +9459,7 @@ __metadata:
languageName: node
linkType: hard

"enquirer@npm:^2.3.0, enquirer@npm:^2.3.6":
"enquirer@npm:^2.3.0":
version: 2.4.1
resolution: "enquirer@npm:2.4.1"
dependencies:
Expand Down Expand Up @@ -10756,7 +10743,7 @@ __metadata:
languageName: node
linkType: hard

"ethers@npm:5.7.2, ethers@npm:^5.0.1, ethers@npm:^5.0.2, ethers@npm:^5.5.2, ethers@npm:^5.7.0, ethers@npm:^5.7.1, ethers@npm:^5.7.2":
"ethers@npm:5.7.2, ethers@npm:^5.0.1, ethers@npm:^5.0.2, ethers@npm:^5.5.2, ethers@npm:^5.7.1, ethers@npm:^5.7.2":
version: 5.7.2
resolution: "ethers@npm:5.7.2"
dependencies:
Expand Down Expand Up @@ -11382,15 +11369,6 @@ __metadata:
languageName: node
linkType: hard

"fmix@npm:^0.1.0":
version: 0.1.0
resolution: "fmix@npm:0.1.0"
dependencies:
imul: ^1.0.0
checksum: c465344d4f169eaf10d45c33949a1e7a633f09dba2ac7063ce8ae8be743df5979d708f7f24900163589f047f5194ac5fc2476177ce31175e8805adfa7b8fb7a4
languageName: node
linkType: hard

"focus-visible@npm:^5.2.0":
version: 5.2.0
resolution: "focus-visible@npm:5.2.0"
Expand Down Expand Up @@ -12345,38 +12323,6 @@ __metadata:
languageName: node
linkType: hard

"hardhat-deploy@npm:^0.11.44":
version: 0.11.44
resolution: "hardhat-deploy@npm:0.11.44"
dependencies:
"@ethersproject/abi": ^5.7.0
"@ethersproject/abstract-signer": ^5.7.0
"@ethersproject/address": ^5.7.0
"@ethersproject/bignumber": ^5.7.0
"@ethersproject/bytes": ^5.7.0
"@ethersproject/constants": ^5.7.0
"@ethersproject/contracts": ^5.7.0
"@ethersproject/providers": ^5.7.2
"@ethersproject/solidity": ^5.7.0
"@ethersproject/transactions": ^5.7.0
"@ethersproject/wallet": ^5.7.0
"@types/qs": ^6.9.7
axios: ^0.21.1
chalk: ^4.1.2
chokidar: ^3.5.2
debug: ^4.3.2
enquirer: ^2.3.6
ethers: ^5.7.0
form-data: ^4.0.0
fs-extra: ^10.0.0
match-all: ^1.2.6
murmur-128: ^0.2.1
qs: ^6.9.4
zksync-web3: ^0.14.3
checksum: c37ec9bcba32abb3f81bf40480b5523b6825e27b344e11ccbc3d121655f41dba09debfa70f7ad871c7d5fa7d14d7a65938f9415cfd2a18293f12a39763cf2d31
languageName: node
linkType: hard

"hardhat-gas-reporter@npm:1.0.9":
version: 1.0.9
resolution: "hardhat-gas-reporter@npm:1.0.9"
Expand Down Expand Up @@ -13071,13 +13017,6 @@ __metadata:
languageName: node
linkType: hard

"imul@npm:^1.0.0":
version: 1.0.1
resolution: "imul@npm:1.0.1"
checksum: 6c2af3d5f09e2135e14d565a2c108412b825b221eb2c881f9130467f2adccf7ae201773ae8bcf1be169e2d090567a1fdfa9cf20d3b7da7b9cecb95b920ff3e52
languageName: node
linkType: hard

"imurmurhash@npm:^0.1.4":
version: 0.1.4
resolution: "imurmurhash@npm:0.1.4"
Expand Down Expand Up @@ -15883,13 +15822,6 @@ __metadata:
languageName: node
linkType: hard

"match-all@npm:^1.2.6":
version: 1.2.6
resolution: "match-all@npm:1.2.6"
checksum: 3d4f16b8fd082f2fd10e362f4a8b71c62f8a767591b3db831ca2bdcf726337e9a64e4abc30e2ef053dc2bcfb875a9ed80bd78e006ad5ef11380a7158d0cb00e1
languageName: node
linkType: hard

"match-sorter@npm:^6.3.1":
version: 6.3.1
resolution: "match-sorter@npm:6.3.1"
Expand Down Expand Up @@ -17414,17 +17346,6 @@ __metadata:
languageName: node
linkType: hard

"murmur-128@npm:^0.2.1":
version: 0.2.1
resolution: "murmur-128@npm:0.2.1"
dependencies:
encode-utf8: ^1.0.2
fmix: ^0.1.0
imul: ^1.0.0
checksum: 94ff8b39bf1a1a7bde83b6d13f656bbe591e0a5b5ffe4384c39470120ab70e9eadf0af38557742a30d24421ddc63aea6bba1028a1d6b66553038ee86a660dd92
languageName: node
linkType: hard

"mustache@npm:^4.2.0":
version: 4.2.0
resolution: "mustache@npm:4.2.0"
Expand Down Expand Up @@ -19343,7 +19264,7 @@ __metadata:
languageName: node
linkType: hard

"qs@npm:^6.11.2, qs@npm:^6.4.0, qs@npm:^6.9.4":
"qs@npm:^6.11.2, qs@npm:^6.4.0":
version: 6.11.2
resolution: "qs@npm:6.11.2"
dependencies:
Expand Down Expand Up @@ -24434,15 +24355,6 @@ __metadata:
languageName: node
linkType: hard

"zksync-web3@npm:^0.14.3":
version: 0.14.4
resolution: "zksync-web3@npm:0.14.4"
peerDependencies:
ethers: ^5.7.0
checksum: f702a3437f48a8d42c4bb35b8dd13671a168aadfc4e23ce723d62959220ccb6bf9c529c60331fe5b91afaa622147c6a37490551474fe3e35c06ac476524b5160
languageName: node
linkType: hard

"zod@npm:^3.11.5, zod@npm:^3.22.1, zod@npm:^3.22.3":
version: 3.22.4
resolution: "zod@npm:3.22.4"
Expand Down Expand Up @@ -24513,8 +24425,11 @@ __metadata:
"@dethcrypto/eth-sdk": ^0.3.4
"@dethcrypto/eth-sdk-client": ^0.1.6
"@gnosis.pm/zodiac": ^3.4.2
"@nomicfoundation/hardhat-chai-matchers": ^1.0.6
"@nomicfoundation/hardhat-network-helpers": ^1.0.9
"@nomicfoundation/hardhat-toolbox": ^2.0.2
"@nomiclabs/hardhat-ethers": ^2.2.3
"@nomiclabs/hardhat-waffle": ^2.0.6
"@nomiclabs/hardhat-etherscan": ^3.1.7
"@typechain/ethers-v5": ^10.2.1
"@typechain/hardhat": ^6.1.6
"@types/chai": ^4.3.1
Expand All @@ -24532,7 +24447,8 @@ __metadata:
ethereum-waffle: ^3.4.4
ethers: ^5.7.2
hardhat: ^2.19.1
hardhat-deploy: ^0.11.44
hardhat-contract-sizer: 2.10.0
hardhat-gas-reporter: 1.0.9
prettier: ^2.8.8
rimraf: ^3.0.2
ts-node: ^10.8.0
Expand Down

0 comments on commit f827ebc

Please sign in to comment.