Commit Graph

70 Commits

Author SHA1 Message Date
Matthias Seitz 3effda2804
feat(solc): add helper functions to compile standalone files (#931) 2022-02-19 15:56:34 +02:00
Matthias Seitz 28df48b530
fix(solc): off by one error finding version intersection (#930)
* fix: off by one error while finding intersection

* test: enable test
2022-02-18 19:24:02 +02:00
Matthew Wiriyathananon-Smith d8e5e536cc
Artifact ids (#882)
* Added ArtifactId

* Added ArtifactId impl and updated into_artifacts to return id

* Formatting

* Fixed warning

* Added versioned slug method to ArtifactId

* Added Ord/Eq derives to ArtifactId

* Fixed broken tests and doc tests

* Added failing test for versioned link references

* chore: ignore linkrefs test - to be fixed in followup

* test(solc): remove artifact json

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-02-18 17:48:56 +02:00
Matthias Seitz 19d2fd1155
feat(solc): add configurable Artifact type (#907)
* refactor: make artifacts a sub mod

* feat: more options for output selection

* feat(solc): make ArtifactOutput struct functions

* fix: migrate all features

* feat: add configurable artifacts type

* refactor: move configurable to separate file

* feat: impl ArtifactOutput

* refactor: write extras

* simplify write extra

* feat: more helper functions

* feat: implement delegate

* fix: failing doc test

* fix: rustfmt

* chore: update CHANGELOG

* feat: add helper functions

* refactor: remove flatten

* feat: add link function

* feat: replace default type

* fix: doc tests

* feat: more utility functions

* fix: failing tests

* chore: rename types

* chore: bump ethers-solc 0.3.0

* fix: set metadata file extension properly
2022-02-17 17:31:35 +02:00
Matthias Seitz b295d73c4a
refactor(solc): rewrite compiler passes and cache change detection (#802)
* chore: clippy

* refactor: rewrite compiler passes and cache

* feat: more work on compile pipeline

* feat: add cache constructor

* add artifact filtering

* fine tune api

* feat: prepare version integration

* docs: more docs

* feat: add cacheentry2

* replace cacheentry types

* integrate new api

* docs: more docs

* feat: implement new output handler

* feat: integrate cached files in new compile pipeline

* refactor: more cache refactor

* docs: more docs

* feat: add source name mapping

* feat: implement new parallel solc

* refactor: do a little cleanup

* refactor: even more cleanup

* even more cleanup

* chore: make it compile

* chore: make it compile with all features

* chore: clippy fix

* feat: integrate new compiler pipeline

* docs: more docs

* refactor: move stuff around

* refactor: start deprecating output type

* chore: make it compile again

* chore(deps): bump solc version 0.2.0

* feat: unify output types

* cargo fix

* refactor: add contracts wrapper

* chore: replace ProjectCompileOutput

* docs: add more docs

* feat: add offline mode

* feat: more artifact helpers

* chore: cleanup cache

* chore: streamline types

* fix: better artifacts mapping

* chore: some cleanup

* chore: change artifact

* chore: add configure solc fn

* feat: add artifact reading

* feat: implement retain and extend

* feat: add cache extending

* feat: write to disk

* chore: make clippy happy

* feat: implement path mapping

* chore: nits

* feat: introduce states

* feat: add compiler state machine

* chore: move cache types to cache mod

* chore: make clippy happy

* feat: add debug derives

* fix: use resolved import source unit names

* fix: failing tests

* test: test multiple libs properly

* chore: make clippy happy

* chore: update CHANGELOG

* fix: doc tests

* fix: set offline mode correctly

* chore: make it compile again

* Update ethers-solc/src/artifacts.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* feat: find remappings by default

* typos

* add eth_syncing RPC (#848)

* add eth_syncing RPC

* Changelo updated

* small comments

* Intermediate SyncingStatus

* fix(core): adjust Ganache for new cli output (#851)

* fix: review comments

* fix: cache relative path bug

* chore: add cache example

* chore: use absolute paths

* fix: remove overwritten files from cache

* fix: rustfmt

* chore: more helper functions

* chore: export AggregatedOutput

* feat: implement helper functions

* feat: even more helpers

* fix: failing doc tests

* refactor: remove source name map tracking

* fix: determine artifacts in ephemeral mode

* refactor: allowed paths should not fail

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: rakita <rakita@users.noreply.github.com>
Co-authored-by: wolflo <33909953+wolflo@users.noreply.github.com>
2022-02-04 18:20:24 +02:00
Matthias Seitz 5fefb2b721
fix(solc): can parse secondary source locations (#849) 2022-01-31 23:54:49 +02:00
Roman Krasiuk a48496000a
fix(solc): flatten replacement target location (#846)
* adjust the end location

* upd changelog
2022-01-31 10:08:04 +02:00
Matthias Seitz 6d7875a44c
chore(solc): add more convenience functions (#810)
* chore(solc): simplify solcconfig

* chore: more helper functions

* chore: copy all

* fix: add trailing slash

* chore: make clippy happy
2022-01-20 21:41:19 +02:00
Roman Krasiuk f9b0360d90
fix(solc): flatten duplicates (#813)
* fix solc flatten duplicates

* upd changelog

* sample eof newlines

* fix test name

* linter
2022-01-19 18:11:37 +02:00
Roman Krasiuk afcba9567f
feat(solc): flatten (#774)
* solc flatten implementation

* upd changelog

* upd docs

* revamp flattening

* clippy

* use resolve_import method

* extract recursive flatenning into a separate func

* change content iteration for flatten

* remove redundant result

* clean up solimport

* add comment to project.flatten

* add support for ver pragma loc

* address pr comments

* uncomment the test

* improve test cov

* add handling of sdpx license identifiers

* change arg name

* match license only at the beginning of the file

* add comments

* lint

* morrre comments
2022-01-17 14:27:40 +02:00
Georgios Konstantopoulos 19671e51de chore: fix lints / solc test 2022-01-11 12:13:09 +02:00
Matthias Seitz 4d2cd83698
fix(solc): invalid cached artifacts (#783)
* add some docs

* ignore malformed cache file

* more artifacts fixes

* fix(solc): remove quotation marks from tests

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-01-11 12:02:57 +02:00
Matthias Seitz e0b6f65359
refactor(solc): more temp project features (#778)
* chore: replace tempdir with tempfile crate

* update tempproject constructors

* make clippy happy

* add default impl
2022-01-10 21:43:34 +02:00
Matthias Seitz fc9f66c916
feat(solc): add dependency graph implementation (#750)
* docs: document public functions

* add mod

* feat(solc): add dependency graph

* detect version

* add into sources

* fix: canonicalize temp paths

* test: add graph tests

* chore(clippy): make clippy happy

* more wasm compat

* chore: update changelog

* wasm compat

* unused

* fix get source fill function

* Update ethers-solc/src/resolver.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* perf: use solang_parser to trim down deps

* resolve graph in compile

* refactor add node function

* docs: clear up comment

* docs: typos

* fix: make all versions unique based on their major minor path version

* prepare test

* docs: add more resolve docs

* test: add lib change detection test

* test: update tests

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-01-05 23:46:57 +02:00
Matthias Seitz 4c677933ce
feat(solc): add workspace utils (#678)
* feat(solc): add workspace mocking

* test: add more tests

* test: update tests

* rename to project-utils

* add fs extra error

* clean up functions

* simplify path construction
2021-12-13 01:39:28 +02:00
korboismoe 41f8e295a0
fix: remove changed artifacts from the cache (#630)
Duplicate artifacts will be returned if there is a
changed artifact that was already present in the
cache
2021-11-28 14:33:24 +02:00
korboismoe d77068e26a
fix: pass partial artifact cache to project compiler output (#623)
* fix: pass partial artifact cache to project compiler output

If the cache contains some artifacts but not all, the
project compiler output now contains the cached artifacts
in addition to the newly compiled artifacts.

* chore: update changelog

* fix: remove missing cache files before getting changed files

* fix: propagate error if reading cached artifacts fails
2021-11-26 18:49:19 +02:00
Matthias Seitz 1da62d65d2
refactor!: make artifactoutput a trait (#579)
* feat: add artifacts trait

* add artifactsoutput trait

* deprecated old artifactoutput

* feat: better artifacts handling

* force update

* feat: update metadata artifacts

* feat: add default to types

* feat: make useliteralcontent optional

* feat: replace ProjectCompilerOutput with struct

* docs

* add output function

* feat: add Artifact trait for reading Abi/Bytes from an artifact

* feat(solc): replace () for empty artifacts with a conditional check

As discussed with @mattsse the abstraction here might not be super clean, so we should revisit this if we do not like it

* chore: fix doctest

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-11-16 01:29:06 +02:00
Georgios Konstantopoulos 23fb877c16
feat(solc): Multiple Solc Version detection (#551)
* test: ensure that compilation succeeds

* feat: add helper for parsing version req from a source

* feat: detect the latest compatible solc version for a VersionReq

* default to always enabling svm/async

* test: add project with multiple contract versions

* fix: always serde-default solc gas estimates

* fix: normalize evm version in settings before compiling

* feat: auto-detect version and compile if svm+async are on

* chore: warnings

* test: add a lock to ensure that there are no file conflicts when downloading solc

* test: add tests for finding solc installations

* chore: add features to ethers-rs config

* chore: s/first/latest on finding solc version fn docs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2021-11-03 10:05:09 +02:00
Matthias Seitz 5c6ce6b0a1
feat: improved solc management (#539)
* feat: improved solc management

* test: add basic test

* rustfmt

* rustfmt

* feat: add support for lib paths

* test: add dapp testing data

* feat: support dapp style libs

* fix: doc test

* use SOLC_path by default

* docs: import readme

* feat: add diagnostics

* chore: cleanup

* docs: update compile docs

* style: use red for error msg

* style: simplifiy error format

* chore: add newline on successful compiler run log

* feat: allow ignoring error codes so that they do not get logged

* chore: use solc 0.6.6 to match CI Version

* fix: make constructor public in hardhat tests

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-30 20:59:44 +03:00