Skip to content

Commit

Permalink
Add small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
yavrsky committed Nov 21, 2024
1 parent 550aa0b commit 0381294
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
8 changes: 7 additions & 1 deletion contracts/test/TestContractManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ contract ContractManager is IContractManagerTester {

event ContractUpgraded(string contractsName, address contractsAddress);

error ContractNotFound(
string contractName
);

constructor() {
owner = msg.sender;
}
Expand Down Expand Up @@ -73,6 +77,8 @@ contract ContractManager is IContractManagerTester {
returns (address contractAddress)
{
contractAddress = contracts[keccak256(abi.encodePacked(name))];
require(contractAddress != address(0), "Contract has not been found");
if (contractAddress == address(0)) {
revert ContractNotFound(name);
}
}
}
13 changes: 6 additions & 7 deletions migrations/upgradeMainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,12 @@ async function updateAbi() {
}

async function main() {
let contractNamesToUpgrade = contracts;
if (process.env.TEST_UPGRADE !== "true") {
contractNamesToUpgrade = [
"MessageProxyForMainnet",
"CommunityPool"
]

let contractNamesToUpgrade = [
"MessageProxyForMainnet",
"CommunityPool"
]
if (process.env.UPGRADE_ALL) {
contractNamesToUpgrade = contracts;
}
const upgrader = new ImaMainnetUpgrader(
"2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cd "$GITHUB_WORKSPACE"
rm -r --interactive=never "$DEPLOYED_DIR"

MESSAGE_PROXY_FOR_MAINNET=$(cat data/proxyMainnet.json | jq -r .message_proxy_mainnet_address)
TEST_UPGRADE=true \
UPGRADE_ALL=true \
ABI="data/proxyMainnet.json" \
TARGET="$MESSAGE_PROXY_FOR_MAINNET" \
ALLOW_NOT_ATOMIC_UPGRADE="OK" \
Expand Down

0 comments on commit 0381294

Please sign in to comment.