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

Issue 1676 fix verification of same name files #1677

Conversation

vsmelov
Copy link
Contributor

@vsmelov vsmelov commented Mar 25, 2023

What I did

every filename inside get_verification_info and payload_verification has it's own unique subpath (even in case if there are several files with the same name)

Related issue: #1676

How I did it

created classmethod path_to_name and used it everywhere instead of Path(filepath).name

How to verify it

  1. clone https://github.com/vsmelov/brownie_fail_verification
  2. checkout branch "check-fix"
  3. remove venv and create empty venv and do pip install -r requirements (there is a new brownie version inside requirements)
  4. try to run brownie run scripts/deploy_and_verify_fail.py --network polygon-main IT WORKS!

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

@iamdefinitelyahuman iamdefinitelyahuman merged commit 4b235ad into eth-brownie:master Jan 29, 2024
7 of 13 checks passed
@zgfzgf
Copy link

zgfzgf commented Mar 13, 2024

Running 'deploy.py::main'...
File "brownie/_cli/run.py", line 51, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 110, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./deploy.py", line 5, in main
publish()
File "./deploy.py", line 58, in publish
Treasury.publish_source(treasury)
File "brownie/network/contract.py", line 363, in publish_source
contract_info = self.get_verification_info()
File "brownie/network/contract.py", line 320, in get_verification_info
self._flattener = Flattener(source_fp, self._name, remaps, compiler_settings)
File "brownie/project/flattener.py", line 30, in init
self.traverse(primary_source_fp)
File "brownie/project/flattener.py", line 72, in traverse
self.sources[name] = IMPORT_PATTERN.sub(repl, source)
File "brownie/project/flattener.py", line 69, in
+ f'"{self.path_to_name(sanitize(m.group("path")))}"'
File "brownie/project/flattener.py", line 42, in path_to_name
return "contracts/" + pth.split("/contracts/")[1]

@zgfzgf
Copy link

zgfzgf commented Mar 13, 2024

  • "@solady=vectorized/solady@0.0.167"

@zgfzgf
Copy link

zgfzgf commented Mar 13, 2024

@vsmelov

@zgfzgf
Copy link

zgfzgf commented Mar 13, 2024

@iamdefinitelyahuman

@zgfzgf
Copy link

zgfzgf commented Mar 13, 2024

The old version is correct, there was an error after upgrading

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