Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: add async setup utility functions #241

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Mar 21, 2021

Motivation

This adds async helper functions for compiling contracts and setting up geth or ganache.
Using the async compile_and_launch_ganache will only take as long as the longest running command (solc, ganache-cli ).
This will shave off the solidity compile time for the updated examples, because this in those cases the compile time is very short. And it will shave off the ~1.8s it takes to launch ganache for those cases where solc takes longer than that.

Solution

Feature gate a setup module in ethers-core that simply runs tokio::task::blocking for the commands (solc, geth, ganache) and join those task when using compile_and_launch_ganache or compile_and_launch_geth.
By default the setup feature of the ethers-core crate is enabled in ethers exposing those helper functions from the ethers::util module.

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

LGTM! This should become more useful once/when somebody decides to build a full dev framework on top of ethers-rs, so that it compiles the code + launches the client!

@gakonst gakonst merged commit 109337f into gakonst:master Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants