@@ -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