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

Allow specifying linked library by address or contract (with automatic deployment). #254

Open
nlordell opened this issue Mar 30, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@nlordell
Copy link
Contributor

This PR captures the second half of #96, specifically:

Moreover, it might be possible to avoid a bunch of boilerplate code for library creation, by allowing to pass in an Either<address, artefact> for each dependent libraries. As libraries cannot have constructors, the way to instantiate the is always the same and could be part of the code generation as well". If the argument is an address the code will directly link this address (e.g. when we reuse a previously deployed version of that library). If the argument is an artefact, we can internally invoke the following line to create an instance.

let lib = Library::builder(&web3).deploy().await.expect()
nlordell added a commit that referenced this issue Mar 31, 2020
This PR generates a `Libraries` struct with named fields for each library. This makes things like the order in which the libraries are specified not matter and makes the API much less error prone.

This PR was made possible because of the recent change to generate all the code in a module (w00t) and is a much simple solution to the proposed new linking API. As such this PR closes #144  
and closes #96.

I created #254 to capture the second half of #96 which is still not implemented.

### Test Plan

Updated example 😄 

### Commit History

* libraries type

* generate field identifier in one place
@nlordell nlordell added the enhancement New feature or request label May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant