Skip to content

feat: coverage for constructors#7661

Merged
klkvr merged 2 commits into
masterfrom
klkvr/constructor-coverage
Apr 16, 2024
Merged

feat: coverage for constructors#7661
klkvr merged 2 commits into
masterfrom
klkvr/constructor-coverage

Conversation

@klkvr

@klkvr klkvr commented Apr 14, 2024

Copy link
Copy Markdown
Member

Motivation

Closes #3453
Closes #1963

Solution

This PR includes general refactor of code using ContractsByArtifacts extending it to contain both creation and runtime code. Currently it can only fit one bytecode type thus resulting in script code generating different ContractsByArtifacts object for different purposes making code a bit harder to navigate. This allowed to add more context to MultiContractRunner::known_contracts and simplify scripting code a bit by storing ContractsByArtifacts directly instead of generating each time.

Added creation code to ContractsByArtifacts allowed us to map collected hitmaps for creation codes to artifacts via find_by_creation_code fn, thus extending coverage to also process creation code just required duplicating anchors discovery and processing logic

@klkvr klkvr force-pushed the klkvr/constructor-coverage branch from 0da3b4a to 1efaae2 Compare April 14, 2024 21:53

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice

pub build_data: BuildData,
/// Known fully linked contracts.
pub highlevel_known_contracts: ArtifactContracts<ContractBytecodeSome>,
pub known_contracts: ContractsByArtifact,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is so much better, ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no coverage data from constructor Coverage: Select anchors for constructors using creation source maps

2 participants