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/mech integration #216

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Fix/mech integration #216

merged 5 commits into from
Feb 2, 2024

Conversation

0xArdi
Copy link
Collaborator

@0xArdi 0xArdi commented Jan 31, 2024

This PR addresses the following issues discovered during integration with the mech running on nevermined:

  1. Addition of Subscription approval
    The mech needs to be approved to spend the trader's subscription

  2. Support for multiple Request/Deliver event formats
    The new mech has a different Request event signature

@0xArdi 0xArdi changed the title Feat/nevermined xdai support Fix/mech integration Jan 31, 2024
Comment on lines +248 to +257
res = {}
for abi in partial_abis:
contract_instance = ledger_api.api.eth.contract(contract_address, abi=abi)
res = cls._process_event(
ledger_api, contract_instance, tx_hash, "Request", "requestId", "data"
)
if "error" not in res:
return res

return res
Copy link
Collaborator

Choose a reason for hiding this comment

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

A process_mech_event can be extracted here, accepting the type of the request as an argument, to avoid code dup.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@0xArdi 0xArdi merged commit 9c2dd40 into main Feb 2, 2024
6 checks passed
@0xArdi 0xArdi deleted the feat/nevermined-xdai-support branch February 2, 2024 10:48
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