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

Fix: import multihash (caused by aioipfs) #673

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Fix: import multihash (caused by aioipfs) #673

merged 1 commit into from
Jan 7, 2025

Conversation

1yam
Copy link
Collaborator

@1yam 1yam commented Jan 6, 2025

This PR resolves a dependency conflict caused by two libraries, pymultihash and py-multihash, both of which provide a module named multihash. The conflict arises because:

pymultihash is required by pyaleph and is imported as multihash.
py-multihash is now required by aioipfs.

Self proofreading checklist

  • Is my code clear enough and well documented
  • Are my files well typed
  • New translations have been added or updated if new strings have been introduced in the frontend
  • Database migrations file are included
  • Are there enough tests
  • Documentation has been included (for new feature)

Changes

This pull request includes updates to the src/aleph/toolkit/libp2p_stubs/peer/id.py file to improve compatibility with the multihash library. The changes mainly involve updating import statements and method calls to reflect the latest structure of the multihash library.

Updates to multihash library usage:

  • Updated import statements to include multihash.funcs for better organization and clarity.
  • Changed multihash.FuncReg.register to multihash.funcs.FuncReg.register in the update method to align with the new library structure.
  • Modified the from_pubkey method to use multihash.funcs.Func.sha2_256 and multihash.Multihash.digest to ensure compatibility with the updated multihash library.

How to test

You can try to sync you'r CCN

@1yam 1yam requested a review from nesitor January 6, 2025 18:26
@nesitor nesitor merged commit 8edb7e9 into main Jan 7, 2025
4 checks passed
@nesitor nesitor deleted the 1yam-fix-import branch January 7, 2025 10:44
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.

2 participants