Skip to content

Commit 31ed8e2

Browse files
committed
Minor test edits
1 parent 81e832a commit 31ed8e2

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

test/contracts-network/colony-network-recovery.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ contract("Colony Network Recovery", (accounts) => {
193193
await checkErrorRevert(colonyNetwork.claimMiningReward(ADDRESS_ZERO), "colony-in-recovery-mode");
194194
await checkErrorRevert(colonyNetwork.startTokenAuction(ADDRESS_ZERO), "colony-in-recovery-mode");
195195
await checkErrorRevert(colonyNetwork.bridgeSkill(1), "colony-in-recovery-mode");
196-
await checkErrorRevert(colonyNetwork.appendReputationUpdateLogFromBridge(ADDRESS_ZERO, ADDRESS_ZERO, 0, 0, 0), "colony-in-recovery-mode");
196+
await checkErrorRevert(colonyNetwork.bridgeReputationUpdateLog(ADDRESS_ZERO, 0, 0), "colony-in-recovery-mode");
197+
await checkErrorRevert(colonyNetwork.addReputationUpdateLogFromBridge(ADDRESS_ZERO, ADDRESS_ZERO, 0, 0, 0), "colony-in-recovery-mode");
197198
await checkErrorRevert(colonyNetwork.bridgePendingReputationUpdate(ADDRESS_ZERO, 0), "colony-in-recovery-mode");
198199
await checkErrorRevert(colonyNetwork.addPendingReputationUpdate(0, ADDRESS_ZERO), "colony-in-recovery-mode");
199200

test/contracts-network/colony-network.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,12 +498,13 @@ contract("Colony Network", (accounts) => {
498498
describe("when managing ENS names", () => {
499499
const orbitDBAddress = "QmPFtHi3cmfZerxtH9ySLdzpg1yFhocYDZgEZywdUXHxFU/my-db-name";
500500
let ensRegistry;
501-
502501
let suffix;
503502

504503
before(async () => {
505504
if (await isXdai()) {
506505
suffix = "colonyxdai";
506+
} else {
507+
suffix = "eth";
507508
}
508509
});
509510

test/cross-chain/cross-chain.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,29 +112,26 @@ contract("Cross-chain", (accounts) => {
112112
// we see it in our tests that's the coverage chain, which builds the contract artifacts
113113
// in to a different location. If we see another chain id, we assume it's non-coverage
114114
// truffle and look for the build artifacts in the normal place.
115-
if (process.env.SOLIDITY_COVERAGE && process.env.TRUFFLE_FOREIGN === "false") {
115+
if (process.env.SOLIDITY_COVERAGE) {
116116
etherRouterInfo = JSON.parse(fs.readFileSync("./build-coverage/contracts/EtherRouter.json"));
117117
} else {
118118
etherRouterInfo = JSON.parse(fs.readFileSync("./build/contracts/EtherRouter.json"));
119119
}
120-
const homeEtherRouterAddress = etherRouterInfo.networks[homeNetworkId.toString()].address;
121-
homeColonyNetwork = await new ethers.Contract(homeEtherRouterAddress, IColonyNetwork.abi, ethersHomeSigner);
122120

123-
if (process.env.SOLIDITY_COVERAGE && process.env.TRUFFLE_FOREIGN === "true") {
124-
etherRouterInfo = JSON.parse(fs.readFileSync("./build-coverage/contracts/EtherRouter.json"));
125-
} else {
126-
etherRouterInfo = JSON.parse(fs.readFileSync("./build/contracts/EtherRouter.json"));
127-
}
121+
const homeEtherRouterAddress = etherRouterInfo.networks[homeNetworkId.toString()].address;
128122
const foreignEtherRouterAddress = etherRouterInfo.networks[foreignNetworkId.toString()].address;
129-
foreignColonyNetwork = await new ethers.Contract(foreignEtherRouterAddress, IColonyNetwork.abi, ethersForeignSigner);
130123

131-
console.log("foreign colony network", foreignColonyNetwork.address);
132-
console.log("home colony network", homeColonyNetwork.address);
124+
homeColonyNetwork = new ethers.Contract(homeEtherRouterAddress, IColonyNetwork.abi, ethersHomeSigner);
125+
foreignColonyNetwork = new ethers.Contract(foreignEtherRouterAddress, IColonyNetwork.abi, ethersForeignSigner);
126+
127+
console.log("Foreign colony network", foreignColonyNetwork.address);
128+
console.log("Home colony network", homeColonyNetwork.address);
129+
130+
const foreignMetaColonyAddress = await foreignColonyNetwork.getMetaColony();
131+
const homeMetaColonyAddress = await homeColonyNetwork.getMetaColony();
133132

134-
const foreignMCAddress = await foreignColonyNetwork.getMetaColony();
135-
foreignMetacolony = await new ethers.Contract(foreignMCAddress, IMetaColony.abi, ethersForeignSigner);
136-
const homeMCAddress = await homeColonyNetwork.getMetaColony();
137-
homeMetacolony = await new ethers.Contract(homeMCAddress, IMetaColony.abi, ethersHomeSigner);
133+
foreignMetacolony = new ethers.Contract(foreignMetaColonyAddress, IMetaColony.abi, ethersForeignSigner);
134+
homeMetacolony = new ethers.Contract(homeMetaColonyAddress, IMetaColony.abi, ethersHomeSigner);
138135

139136
// The code here demonstrates how to generate the bridge data for a bridge. We work out the transaction (with dummy data), and then
140137
// the transaction that would call that on the AMB, before snipping out the AMB call. The non-dummy data is worked out on-chain before

0 commit comments

Comments
 (0)