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 marketplace #7

Merged
merged 14 commits into from
Feb 11, 2025
Merged

Fix mech marketplace #7

merged 14 commits into from
Feb 11, 2025

Conversation

jmoreira-valory
Copy link
Collaborator

Proposed changes

Fix mech marketplace

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Comment on lines -589 to -592
"REQUESTER_STAKING_INSTANCE_ADDRESS": staking_params.get(
"staking_contract"
),
"PRIORITY_MECH_ADDRESS": staking_params.get("agent_mech"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These 2 vars seem not used anymore, in favour of MECH_MARKETPLACE_CONFIG dict. Should be removed from service template on olas-operate-app repo.

ledger_api=sftxb.ledger_api,
contract_address=staking_params["activity_checker"],
)
.functions.agentMech()
Copy link
Member

Choose a reason for hiding this comment

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

So, here we assume that an activity checker contract will never have both the agentMech and mechMarketplace methods, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Activity checkers are subclassed from a base class. In the case of the variables set for the Trader, these 2 cases are determined based on a function call that exists on each contract, but not on the other (that's why catching the exception is required).

Possibly can be done in a nicer way when we clean up the code.

@jmoreira-valory jmoreira-valory merged commit 9eb48c1 into staging Feb 11, 2025
3 checks passed
@OjusWiZard OjusWiZard deleted the fix/mech_marketplace branch February 11, 2025 14:22
@@ -110,6 +110,8 @@
},
}

DEFAULT_MECH_MARKETPLACE_PRIORITY_MECH = "0x552cEA7Bc33CbBEb9f1D90c1D11D2C6daefFd053"
Copy link
Member

Choose a reason for hiding this comment

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

@jmoreira-valory wdyt about this?

Suggested change
DEFAULT_MECH_MARKETPLACE_PRIORITY_MECH = "0x552cEA7Bc33CbBEb9f1D90c1D11D2C6daefFd053"
PRIORITY_MECH_ADDRESS: t.Dict[Chain, str] = {
Chain.GNOSIS: "0x552cEA7Bc33CbBEb9f1D90c1D11D2C6daefFd053",
}

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