Skip to content

Commit

Permalink
fix: add CANNON_REGISTRY_PRIORITY env, and others (#1804)
Browse files Browse the repository at this point in the history
* fix: add CANNON_REGISTRY_PRIORITY env

* fix: setup cannon registry priority

* feat: add cannon registry to commands

* add CANNON_REGISTRY_PRIORITY to oracle manager

* fix: circle ci env

* update config circleci

* echo cannon registry

* try

* use oracle-manager testable for synthetix testable

otherwise the build can come out wierd

* fix deps

* have to upgrade hardhat too

* fix unnecessary await causing hang

---------

Co-authored-by: Daniel Beal <[email protected]>
Co-authored-by: dbeal <[email protected]>
  • Loading branch information
3 people authored Sep 2, 2023
1 parent aadd241 commit 60b2df0
Show file tree
Hide file tree
Showing 40 changed files with 190 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
- restore_cache:
keys:
- testable-hardhat-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "/tmp/version--contracts.txt" }}
- run: yarn workspaces foreach --topological-dev --verbose run build-testable
- run: CANNON_REGISTRY_PRIORITY=local yarn workspaces foreach --topological-dev --verbose run build-testable
- save_cache:
key: testable-hardhat-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "/tmp/version--contracts.txt" }}
paths:
Expand Down
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ INFURA_API_KEY=
INFURA_IPFS_ID=
INFURA_IPFS_SECRET=
ETHERSCAN_API_KEY=
OVM_ETHERSCAN_API_KEY=
OVM_ETHERSCAN_API_KEY=
CANNON_REGISTRY_PRIORITY=
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion markets/legacy-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@synthetixio/router": "^3.1.3",
"@synthetixio/wei": "2.74.4",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"solidity-docgen": "0.6.0-beta.35"
},
"depcheck": {
Expand Down
8 changes: 4 additions & 4 deletions markets/perps-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"scripts": {
"build": "yarn build:contracts",
"build:contracts": "hardhat compile --force && hardhat storage:verify && hardhat cannon:build",
"build-testable": "hardhat cannon:build cannonfile.test.toml",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml",
"check:storage": "git diff --exit-code storage.dump.sol",
"start": "yarn build && yarn cannon-build",
"clean": "hardhat clean",
"cannon-build": "hardhat cannon:build",
"test": "hardhat test",
"test": "CANNON_REGISTRY_PRIORITY=local hardhat test",
"coverage": "hardhat test",
"coverage1": "hardhat coverage --network hardhat",
"compile-contracts": "hardhat compile",
Expand All @@ -33,9 +33,9 @@
"@synthetixio/router": "^3.1.3",
"@synthetixio/spot-market": "workspace:*",
"@synthetixio/wei": "2.74.4",
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"solidity-docgen": "0.6.0-beta.35",
"ts-node": "10.9.1",
"typescript": "4.9.3"
Expand Down
2 changes: 1 addition & 1 deletion markets/perps-market/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@graphprotocol/graph-cli": "^0.50.1",
"@graphprotocol/graph-ts": "^0.30.0",
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"ethers": "^5.7.2",
"matchstick-as": "^0.5.2",
"prettier": "^2.8.8"
Expand Down
2 changes: 1 addition & 1 deletion markets/spot-market/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const config = {
},
},
mocha: {
timeout: 200_000,
timeout: 30_000,
},
};

Expand Down
10 changes: 5 additions & 5 deletions markets/spot-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"description": "Spot Market implementation",
"scripts": {
"build": "yarn build:contracts",
"build:contracts": "rm -rf contracts/generated && hardhat storage:verify && hardhat cannon:build",
"build-testable": "hardhat cannon:build cannonfile.test.toml",
"build:contracts": "rm -rf contracts/generated && hardhat storage:verify && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml",
"check:storage": "git diff --exit-code storage.dump.sol",
"start": "yarn build && yarn cannon-build",
"clean": "hardhat clean",
"cannon-build": "hardhat cannon:build",
"test": "hardhat test",
"test": "CANNON_REGISTRY_PRIORITY=local hardhat test",
"test:fork": "hardhat test test-fork/AsyncOrdersModule.e2e.test.ts",
"coverage": "hardhat test",
"coverage1": "hardhat coverage --network hardhat",
Expand All @@ -34,9 +34,9 @@
"@synthetixio/router": "^3.1.3",
"@synthetixio/wei": "2.74.4",
"@types/node-fetch": "2.6.4",
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"node-fetch": "2.6.9",
"solidity-docgen": "0.6.0-beta.35",
"ts-node": "10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion markets/spot-market/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"devDependencies": {
"@graphprotocol/graph-cli": "^0.50.1",
"@graphprotocol/graph-ts": "^0.30.0",
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"ethers": "^5.7.2",
"prettier": "^2.8.8"
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"scripts": {
"clean": "yarn workspaces foreach --parallel --verbose run clean",
"build-prerelease-dev": "git diff --exit-code && yarn lerna exec -- npm version prepatch --no-git-tag-version --no-workspaces-update && yarn && yarn build && git stash && yarn",
"build": "yarn workspaces foreach --topological-dev --verbose run build",
"test": "yarn workspaces foreach --parallel --verbose run test",
"build": "CANNON_REGISTRY_PRIORITY=local yarn workspaces foreach --topological-dev --verbose run build",
"test": "CANNON_REGISTRY_PRIORITY=local yarn workspaces foreach --parallel --verbose run test",
"coverage": "yarn workspaces foreach --verbose run coverage",
"lint:progress": "ESLINT_PROGRESS=true eslint --max-warnings=0 .",
"lint:js": "prettier --check '**/*.{t,j}s' && eslint --max-warnings=0 '**/*.{t,j}s'",
Expand Down Expand Up @@ -52,7 +52,7 @@
"@types/node": "18.11.10",
"@typescript-eslint/eslint-plugin": "5.45.0",
"@typescript-eslint/parser": "5.45.0",
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"eslint": "8.29.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-no-only-tests": "3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion protocol/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@synthetixio/core-utils": "workspace:*",
"@synthetixio/docgen": "workspace:*",
"@synthetixio/router": "^3.1.3",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"solidity-docgen": "0.6.0-beta.35"
}
}
6 changes: 3 additions & 3 deletions protocol/oracle-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"access": "public"
},
"scripts": {
"test": "hardhat test",
"test": "CANNON_REGISTRY_PRIORITY=local hardhat test",
"coverage": "hardhat coverage --network hardhat",
"clean": "hardhat clean",
"build": "yarn build:contracts",
"build:contracts": "hardhat storage:verify && hardhat cannon:build",
"build-testable": "hardhat cannon:build cannonfile.test.toml",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml",
"check:storage": "git diff --exit-code storage.dump.sol",
"compile-contracts": "hardhat compile",
"size-contracts": "hardhat compile && hardhat size-contracts",
Expand All @@ -32,7 +32,7 @@
"@synthetixio/wei": "2.74.4",
"@types/node": "18.11.10",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"solidity-docgen": "0.6.0-beta.35",
"ts-node": "10.9.1",
"typescript": "4.9.3"
Expand Down
7 changes: 6 additions & 1 deletion protocol/synthetix/cannonfile.test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ include = [
"cannonfile.toml"
]

# use the testable oracle manager
[setting.oracle_manager_source]
defaultValue = "oracle-manager:<%= package.version %>-testable"


# Test Modules
[contract.TestableAccountStorage]
artifact = "contracts/generated/test/TestableAccountStorage.sol:TestableAccountStorage"
Expand Down Expand Up @@ -166,4 +171,4 @@ args = [[
"0x7d632bd2<%= defaultAbiCoder.encode(['bytes32', 'bool'], [formatBytes32String('createPool'), true]).slice(2) %>",
]]

depends = ["invoke.upgrade_core_proxy"]
depends = ["invoke.upgrade_core_proxy"]
8 changes: 4 additions & 4 deletions protocol/synthetix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"build": "yarn build:contracts",
"build:contracts": "hardhat storage:verify && hardhat cannon:build",
"generate-testable": "rm -rf contracts/generated && hardhat generate-testable",
"build-testable": "hardhat cannon:build cannonfile.test.toml",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml",
"check:storage": "git diff --exit-code storage.dump.sol",
"test": "hardhat test",
"test": "CANNON_REGISTRY_PRIORITY=local hardhat test",
"coverage": "hardhat coverage --network hardhat",
"compile-contracts": "hardhat compile",
"size-contracts": "hardhat compile && hardhat size-contracts",
Expand All @@ -32,9 +32,9 @@
"@synthetixio/oracle-manager": "workspace:*",
"@synthetixio/router": "^3.1.3",
"@synthetixio/wei": "2.74.4",
"@usecannon/builder": "^2.5.1",
"@usecannon/builder": "^2.5.4",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"solidity-ast": "0.4.46",
"solidity-docgen": "0.6.0-beta.35",
"ts-node": "10.9.1"
Expand Down
2 changes: 1 addition & 1 deletion protocol/synthetix/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@graphprotocol/graph-cli": "^0.50.1",
"@graphprotocol/graph-ts": "^0.30.0",
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"ethers": "^5.7.2",
"matchstick-as": "^0.5.2",
"prettier": "^2.8.8"
Expand Down
20 changes: 9 additions & 11 deletions protocol/synthetix/test/common/stakedPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,15 @@ export const createStakedPool = (

before('configure collateral', async () => {
// add collateral
await (
await r.systems().Core.connect(r.owner()).configureCollateral({
tokenAddress: r.systems().CollateralMock.address,
oracleNodeId,
issuanceRatioD18: '5000000000000000000',
liquidationRatioD18: '1500000000000000000',
liquidationRewardD18: '20000000000000000000',
minDelegationD18: '20000000000000000000',
depositingEnabled: true,
})
).wait();
await r.systems().Core.connect(r.owner()).configureCollateral({
tokenAddress: r.systems().CollateralMock.address,
oracleNodeId,
issuanceRatioD18: '5000000000000000000',
liquidationRatioD18: '1500000000000000000',
liquidationRewardD18: '20000000000000000000',
minDelegationD18: '20000000000000000000',
depositingEnabled: true,
});
});

before('create pool', async () => {
Expand Down
6 changes: 3 additions & 3 deletions utils/common-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"@synthetixio/hardhat-storage": "workspace:*",
"@typechain/ethers-v5": "10.1.0",
"@typechain/hardhat": "6.1.3",
"@usecannon/builder": "^2.5.1",
"@usecannon/builder": "^2.5.4",
"cannon-plugin-router": "^1.0.16",
"dotenv": "16.0.1",
"hardhat": "2.15.0",
"hardhat-cannon": "2.5.1",
"hardhat": "2.17.2",
"hardhat-cannon": "2.5.4",
"hardhat-contract-sizer": "2.10.0",
"hardhat-gas-reporter": "1.0.9",
"hardhat-ignore-warnings": "0.2.9",
Expand Down
2 changes: 1 addition & 1 deletion utils/core-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@synthetixio/core-utils": "workspace:*",
"@synthetixio/router": "^3.1.3",
"ethers": "^5.7.2",
"hardhat": "2.15.0"
"hardhat": "2.17.2"
},
"gitHead": "af79d976af56150c628a885cc94a94f5bcc2c862",
"depcheck": {
Expand Down
2 changes: 1 addition & 1 deletion utils/core-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@synthetixio/core-utils": "workspace:*",
"@synthetixio/router": "^3.1.3",
"ethers": "^5.7.2",
"hardhat": "2.15.0"
"hardhat": "2.17.2"
},
"gitHead": "af79d976af56150c628a885cc94a94f5bcc2c862"
}
2 changes: 1 addition & 1 deletion utils/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@types/prompts": "2.0.14",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"mocha": "10.2.0",
"multimatch": "6.0.0",
"nyc": "15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion utils/docgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"docgen:contracts": "./docgen-contracts.sh"
},
"devDependencies": {
"@usecannon/cli": "^2.5.1",
"@usecannon/cli": "^2.5.4",
"handlebars": "4.7.7",
"prettier": "^2.8.8",
"solidity-ast": "0.4.46",
Expand Down
2 changes: 1 addition & 1 deletion utils/hardhat-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@types/jest": "29.2.3",
"@types/mustache": "4.2.2",
"hardhat": "2.15.0",
"hardhat": "2.17.2",
"jest": "29.4.3",
"ts-jest": "29.0.5",
"typescript": "4.9.3"
Expand Down
6 changes: 3 additions & 3 deletions utils/sample-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"@synthetixio/core-utils": "workspace:*",
"@synthetixio/hardhat-storage": "workspace:*",
"@synthetixio/router": "^3.1.3",
"@usecannon/builder": "^2.5.1",
"@usecannon/builder": "^2.5.4",
"cannon-plugin-router": "^1.0.16",
"ethers": "^5.7.2",
"hardhat": "2.15.0",
"hardhat-cannon": "2.5.1",
"hardhat": "2.17.2",
"hardhat-cannon": "2.5.4",
"solidity-coverage": "0.8.2"
}
}
Loading

0 comments on commit 60b2df0

Please sign in to comment.