Skip to content

Create Connext Mocks for local testing #3640

@just-a-node

Description

@just-a-node

Background

Create Connext Mocks that can be easily imported for local testing.

From Derby:

"So basically, this is our cross chain setup. The most important picture is the second picture on this page: https://derby-finance.gitbook.io/derby-finance-docs/developers/architecture/cross-chain which shows all the external triggers that need to be initiated by a keeper network. These triggers are all cross chain actions except from the trigger represented by arrow 8.

We work with cross chain provider contracts (XProvider.sol) which sit between Connext.sol and our contracts. This is shown in the 3rd picture on the same page.

To simulate all cross chain stuff we basically only need to simulate xcall in Connext.sol because that’s the only point of interaction with your technology. Since local testing all takes place on the same simulated local blockchain the Connext.sol Mock contract in our repo only just routes the function calls. You can see it implemented here: derby-yield-optimiser/contracts/Mocks/Connext/ ConnextMock.sol

Note that the 2nd picture could be simplified if we would use callbacks and if we would use authenticated messaging and transferring of funds in 1 call (instead now those have been done in two separate calls).

So again, the ConnextMock.sol is a very basic setup (maybe almost the most minimalistic setup possible). Hope the idea is clear, and hope you agree with this setup. Any feedback is always more than welcome!!"

Connext Mock: https://github.com/derbyfinance/derby-yield-optimiser/blob/master/contracts/Mocks/Connext/ConnextMock.sol

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions