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

refactor!: make artifactoutput a trait #579

Merged
merged 16 commits into from
Nov 15, 2021
Merged

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Nov 13, 2021

Motivation

Improved artifacts handling in Project::compile

Solution

  • introduce ArtifactOutput trait
  • keep mapping contract file -> artrifacts
  • ensure artifacts exists when checking cache
  • get easy access to Artifact from ProjectCompilerOutput whether it's unchanged or compiled.
  • make ProjectCompileOutput a struct

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

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.

Love it

ethers-solc/src/lib.rs Outdated Show resolved Hide resolved
@@ -260,6 +277,28 @@ impl ProjectBuilder {
self
}

/// Set arbitrary `ArtifactOutputHandler`
pub fn artifacts<A: ArtifactOutput>(self) -> ProjectBuilder<A> {
Copy link
Owner

Choose a reason for hiding this comment

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

Interesting pattern to change the generic of a struct, hadn't thought about this before.

@gakonst gakonst merged commit 1da62d6 into gakonst:master Nov 15, 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