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

Add lookup-methods post-action for solidity verifier #682

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lok52
Copy link
Contributor

@lok52 lok52 commented Nov 16, 2023

  • Add lookup-methods post-action handler for solidity verifier service.
  • Update tests


fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"lookup-methods" => Ok(VerifyPostAction::LookupMethods),
Copy link
Contributor

Choose a reason for hiding this comment

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

please add this option to comment on this protobuf field. It will make this field appear in comment in swagger

Copy link
Contributor

Choose a reason for hiding this comment

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

btw, why kebab-case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/// Additional actions the client wants the result to be returned.
/// Currently supports only: "lookup-methods" for Solidity contracts.
repeated string post_actions = 9;

It was added in the previous PR

Copy link
Member

Choose a reason for hiding this comment

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

@sevenzing What is your suggestion instead of kebab-case?

Comment on lines 21 to 24
pub fn find_methods_from_compiler_output(
contract_name: &String,
output: &CompilerOutput,
) -> anyhow::Result<LookupMethodsResponse> {
Copy link
Member

@rimrakhimov rimrakhimov Nov 16, 2023

Choose a reason for hiding this comment

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

I'm not sure if that would be easier and better overall, but as an option, we may also get all required data from the compilation_artifacts, deployed_code_artifacts and local_bytecode_parts

https://github.com/blockscout/blockscout-rs/blob/main/smart-contract-verifier/smart-contract-verifier-server/tests/test_cases_solidity/no_metadata_hash.json

Copy link
Contributor Author

@lok52 lok52 Nov 29, 2023

Choose a reason for hiding this comment

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

As these fields are stored as raw JSON values we have to clone and parse them. Not sure about this approach

@lok52 lok52 force-pushed the lok52/lookup-methods-verify branch from ff7b6e7 to 6adbcca Compare November 29, 2023 10:55
@rimrakhimov rimrakhimov mentioned this pull request Jun 10, 2024
45 tasks
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.

3 participants