Coordinator Alpha 12 Support#3213
Conversation
This commit is aimed to update test to the following changes on
nucypher-contracts repo:
- Update SimplePREApplication with TACoApplication
- Replace ThresholdStakingForPREApplicationMock contract with
ThresholdStakingForTACoApplicationMock
- Use the new Coordinator contract
- Add the deployment of StakeInfo contract
The use of these new contracts made necessary the following changes:
- Add the deployment of a new Token for ritual fees: RitualToken. This
contract has been added as local deployment.
- Add the deployment of local contract ConditionNFT
Additionally, this commit updates the key character for arguments in
ape-config.yaml. From '::variable::' to <variable>, which results in a
more legible code.
Finally, this commit solves some linting and formatting issues.
Co-authored-by: LunarBytes <kieran@nucypher.com>
…al and dependency contract ABI entries.
…llowList in tests
…la; Supporting G2 point class
… can be made while testing.
…public keys. Move G2Point out of Ritual in CoordinatorAgent.
…bject. MockCoordinatorAgent simply uses a class method to determine threshold (allows for both simple/precomputed) to still be tested in integration tests.
…values stored by the Ritual struct.
…based on test mnemonic.
cb9c262 to
9aa1e31
Compare
derekpierre
left a comment
There was a problem hiding this comment.
🎸 - co-authorship on this PR though 😄
| contract_name: str = "Coordinator" | ||
| _proxy_name = None | ||
|
|
||
| class G2Point(NamedTuple): |
There was a problem hiding this comment.
Getting/setting the provider public key.
| conditions: Lingo, | ||
| ) -> ThresholdMessageKit: | ||
| if not self.signer: | ||
| raise TypeError("This Enrico doesn't have a signer.") |
There was a problem hiding this comment.
There's missing commit authorship in this line 🤖
There was a problem hiding this comment.
I think he means that Github Copilot probably helped here 🤖🤖🤖
| if not self._policy_pubkey: | ||
| if not self._encrypting_key: | ||
| raise TypeError( | ||
| "This Enrico doesn't know which policy encrypting key he used. Oh well." |
manumonti
left a comment
There was a problem hiding this comment.
This is huge! Great work
I have some suggestions, but overall it looks good
| if not self._policy_pubkey: | ||
| if not self._encrypting_key: | ||
| raise TypeError( | ||
| "This Enrico doesn't know which policy encrypting key he used. Oh well." |
| conditions: Lingo, | ||
| ) -> ThresholdMessageKit: | ||
| if not self.signer: | ||
| raise TypeError("This Enrico doesn't have a signer.") |
There was a problem hiding this comment.
I think he means that Github Copilot probably helped here 🤖🤖🤖
| def deploy_contracts(nucypher_contracts: DependencyAPI, accounts): | ||
| def deploy_contracts( | ||
| nucypher_contracts: DependencyAPI, | ||
| test_contracts: DependencyAPI, |
There was a problem hiding this comment.
test_contracts are not been deployed using this function.
AFAIK, these test contracts are deployed by APE since they are under the contracts folder. So we can delete this line.
| test_contracts: DependencyAPI, |
There was a problem hiding this comment.
^ This whole setup is changed in #3227 (follow-up PR) - so this is/will be addressed there.
| - name: nucypher-contracts | ||
| github: nucypher/nucypher-contracts | ||
| ref: main | ||
| github: derekpierre/nucypher-contracts |
There was a problem hiding this comment.
this is temporal, right? should we add a TODO comment?
There was a problem hiding this comment.
Yes. It can be merged with that reference since the PR is going into an EPIC (#3226), but it will be changed to nucypher-contracts/main as part of merging the epic.
894dc5a addresses the respective suggestions.
| "value": Web3.to_wei("1", "ether"), | ||
| } | ||
| txhash = testerchain.w3.eth.send_transaction(tx) | ||
| _ = testerchain.wait_for_receipt(txhash) |
There was a problem hiding this comment.
I noticed that tx hashes are often assigned to a variable and then ignored (like _hash in a different file). Is this some sort of Pythonic idiom?
There was a problem hiding this comment.
The txhash is used to wait for an tx execution receipt, but the receipt is not needed hence the _- it just indicates that the tx was mined/completed.
Some/most of these are removed/replaced in #3227 by using ape functionality for tx execution which does not requiring waiting for a tx receipt - other than the txs for transferring eth to other accounts (haven't gotten around to figuring out the ape equivalent for that as yet, but something I'm looking into for #3227).
| ) | ||
| blockchain = pre_application_agent.blockchain | ||
| blockchain = taco_application_agent.blockchain | ||
| minimum_stake = ( |
There was a problem hiding this comment.
In some places it called min_authorization, would be great to have same names everywhere
Update newsfragment for nucypher#3213.
Update newsfragment for #3213.
Type of PR:
Feature
Required reviews:
3
What this does:
nucypher-contractsversion from Tweaks for Alpha 12 nucypher-contracts#116 (includes fixes/functionality needed for this PR)Follow-up PR will be made for coordinator alpha-13 work i.e TACoRoot/Child Application work - #3227