Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test scaffolding for cross-chain tests #1121

Merged
merged 12 commits into from
Mar 13, 2023
Merged

Conversation

area
Copy link
Member

@area area commented Feb 14, 2023

The original version of this branch was a very quick-and-dirty version to get the dev environment working for those working on cross-chain safes. I've tried to clean it up and get it in to a state that can be used for the cross-chain reputation work that's cooking.

One of the functional additions here is to do with coverage - we will want colonies on both sides being tested, so all tests related to cross-chain are run twice. Once with solidity-coverage covering the home chain, and once with solidity-coverage covering the foreign chain. This seems to work based on my limited testing, but will only become clear in a build like this once there is functionality specific to one side or the other in the colony contracts.

In order for this to work, tests to do with cross-chain behaviour need to be written in a way that is agnostic to which chain truffle is covering, hence the use of ethers throughout the example bridging test. I can't see a way to not do that.

Another practical addition is a toy bridge monitor, which is started with such tests and makes sure bridged transactions go each way. The monitor, and indeed the bridged contracts, are not suitable for production, as there are no permissions. They are modelled on the AMBs set up on Gnosis but they could be anything, in principle.

@area area force-pushed the maint/cross-chain-safe branch from a60a45a to 424fb7d Compare February 14, 2023 12:24
@area area force-pushed the maint/cross-chain-safe branch 5 times, most recently from 3ceda73 to a880743 Compare February 28, 2023 11:20
@area area force-pushed the maint/cross-chain-safe branch from a880743 to 5e4f841 Compare February 28, 2023 12:22
@area area force-pushed the maint/cross-chain-safe branch 4 times, most recently from be61fcd to 91e9996 Compare March 9, 2023 11:34
@area area force-pushed the maint/cross-chain-safe branch from 91e9996 to 3ca3c14 Compare March 9, 2023 11:57
kronosapiens
kronosapiens previously approved these changes Mar 9, 2023
kronosapiens
kronosapiens previously approved these changes Mar 10, 2023
const ethersHomeSigner = new ethers.providers.JsonRpcProvider(homeRpcUrl).getSigner();

before(async () => {
await exec(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be an invocation of start-bridging-environment.sh with different arguments?

@area area force-pushed the maint/cross-chain-safe branch 3 times, most recently from 4969e32 to cfd22d0 Compare March 11, 2023 15:05
@area area force-pushed the maint/cross-chain-safe branch from cfd22d0 to 2924d86 Compare March 11, 2023 15:11
@kronosapiens kronosapiens merged commit 1874d5e into develop Mar 13, 2023
@kronosapiens kronosapiens deleted the maint/cross-chain-safe branch March 13, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants