-
Notifications
You must be signed in to change notification settings - Fork 32
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
refactor: extract proxy factory from gnosis safe and test it #121
Conversation
) = GnosisSafeProxyFactoryContract.build_tx_deploy_proxy_contract_with_nonce( | ||
ledger_api, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contracts packages can depend on others. The framework doesn't currently account for this. We need to add an issue on aea repo and support this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: fetchai/agents-aea#2643
return safe_contract | ||
|
||
@classmethod | ||
def _build_tx_deploy_proxy_contract_with_nonce( # pylint: disable=too-many-arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to the contract gnosis_safe_proxy_factory
f"aea.packages.{PUBLIC_ID.author}.contracts.{PUBLIC_ID.name}.contract" | ||
) | ||
|
||
PROXY_FACTORY_CONTRACT = "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the address IFF the contract is deployed using deterministic deployment (https://ethereum-magicians.org/t/deterministic-deployment-proxy-magic-wrapped-in-magic/3261/7). At the moment I am not sure how to do this on plain ganache.
def setup( | ||
self, | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to run this as a classmethod (setup_class(cls)
). But UseGanache
doesn't work then. @marcofavorito how can we refactor UseGanache to support both setup and setup_class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we can, preparing a PR to show my proposal
from tests.helpers.docker.ganache import DEFAULT_GANACHE_PORT | ||
|
||
|
||
class BaseContractTest(UseGanache): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the below issue is addressed, this can be extracted as a generic utility class for contract testing.
…sensus-algorithms into m
test: add 'GanacheBaseTest' utility
Codecov Report
@@ Coverage Diff @@
## main #121 +/- ##
==========================================
+ Coverage 88.66% 88.73% +0.07%
==========================================
Files 60 62 +2
Lines 5424 5442 +18
==========================================
+ Hits 4809 4829 +20
+ Misses 615 613 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Proposed changes
This PR extracts each contract into its own package. Also adds tests for the extracted functionality.
Fixes
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.develop
branch (left side). Also you should start your branch off ourdevelop
.Further comments