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

core: add utils::get_create2_address_from_hash() #444

Merged
merged 1 commit into from
Sep 11, 2021

Conversation

wolflo
Copy link
Contributor

@wolflo wolflo commented Sep 10, 2021

  • Implements a new utils function get_create2_address_from_hash() that takes the pre-computed hash of the init code rather than the init code itself
  • Changes get_create2_address() to hash the init code and forward to get_create2_address_from_hash()
  • Tests for get_create2_address_from_hash()
  • Move create2 address doc example to get_create2_address_from_hash() to get rid of the made up init code stuff

Relates to #432.

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@gakonst gakonst merged commit 90df511 into gakonst:master Sep 11, 2021
meetmangukiya pushed a commit to meetmangukiya/ethers-rs that referenced this pull request Mar 21, 2022
* feat(fuzz): expose function to get internal evm

* refactor(evm): move EvmOpts from cli to evm-adapters

* feat(evm): add helper for creating sputnik backend

* feat(forge): add base evm opts for test usage

* feat(evm): derive default for EvmOpts

* test(forge): add utils for instantiating backend

* feat(forge): instantiate runner with EvmOpts instead of an EVM

This allows us to instantiate as many EVMs as we want inside of the runner,
which in turn will enable running tests in parallel

* feat(forge): pass evm by reference instead of using self.evm

* feat(forge): run unit tests with unique evm instantiation

previously we'd reuse the same EVM, now, we use a different EVM
per test, allowing us to get rid of the mutable reference on self

* feat(forge): run fuzz tests with unique evm instantiations

* test(forge): adjust tests to new instantiation style

* feat(forge): run tests in parallel with rayon

* feat(evm-adapters): put backend behind enum to avoid trait object

* chore(forge): move fuzzer instead of ref

* feat(forge): make multi contract runner compatible with new runner

* feat(forge): parallelize multi contract runner by file

* chore(cli): remove unused helper functions

* fix(cli/run): use new contract runner initialization

There's a TODO here around how we should do the evm.debug_calls check which we should figure out

* fix(cli/test): use evm_opts instead of directly passing evm

* chore: formatting fixes

* chore: update lockfile

* fix(evm-adapters): correctly init test caller and origin

fixes foundry-rs/foundry#249
fixes foundry-rs/foundry#253

* chore: clippy lint on unreachable code w disabled features

* fix: instantiate evm cfg without contract size limit

* fix debugging (gakonst#445)

* merge cleanup

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>
Co-authored-by: Brock <brock.elmore@gmail.com>
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