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 configurable Mech request price parameter and migrate mech contract functionality #146

Merged
merged 23 commits into from
Apr 4, 2024

Conversation

jmoreira-valory
Copy link
Collaborator

@jmoreira-valory jmoreira-valory commented Mar 21, 2024

Proposed changes

Fixes

If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce? (A breaking change is a fix or feature that would cause existing functionality and APIs to not work as expected.)
Put an x in the box that applies

  • Non-breaking fix (non-breaking change which fixes an issue)
  • Breaking fix (breaking change which fixes an issue)
  • Non-breaking feature (non-breaking change which adds functionality)
  • Breaking feature (breaking change which adds functionality)
  • Refactor (non-breaking change which changes implementation)
  • Messy (mixture of the above - requires explanation!)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the main branch (left side). Also you should start your branch off our main.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have locally run services that could be impacted and they do not present failures derived from my changes

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@jmoreira-valory jmoreira-valory changed the base branch from feat/add_configurable_request_price to main March 27, 2024 19:54
@jmoreira-valory jmoreira-valory changed the title Migrate mech contract functionality Add configurable Mech request price parameter and migrate mech contract functionality Mar 27, 2024
@@ -310,6 +327,7 @@ def async_act(self) -> Generator:
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This logging should not be present or at least not at an info level. Moreover, serialized_data is a generator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please make a concrete suggestion how to fix this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Logging a generator is not useful, there's no content to print if it's not consumed.
The suggestion is to remove this unnecessary log and many more that have been added for debugging purposes to the mech interact skill.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Opened #153.

Comment on lines +310 to +314
None,
None,
GNOSIS_CHAIN_ID,
None,
None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This won't trigger the none_event.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was the case in the previous state of the repository (GNOSIS_CHAIN_ID was also present). Please open an issue to fix it in another PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added issue #155. This has to be addressed on a different PR, as this one is already quite complex.

@@ -65,6 +65,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.mech_contract_address: str = self._ensure(
"mech_contract_address", kwargs, str
)
self.request_price: Optional[int] = kwargs.get("request_price", None)
Copy link
Collaborator

@Adamantios Adamantios Apr 3, 2024

Choose a reason for hiding this comment

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

Why not self._ensure("request_price", ...?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this is used in more than one skill and ensure pops.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you point out which skill?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That was a guess, not an actual assertion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was decided that request_price be an optional parameter. Therefore, cannot use _ensure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cc @0xArdi

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an optional param.

@dvilelaf dvilelaf merged commit 15b9745 into main Apr 4, 2024
19 checks passed
@dvilelaf dvilelaf deleted the feat/migrate_mech_contract_functionality branch April 4, 2024 14:18
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.

4 participants