-
Notifications
You must be signed in to change notification settings - Fork 41
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 prediction market and swaps proxies #1038
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #1038 +/- ##
==========================================
- Coverage 94.52% 94.49% -0.03%
==========================================
Files 92 92
Lines 20987 21072 +85
==========================================
+ Hits 19838 19913 +75
- Misses 1149 1159 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
primitives/src/proxy_type.rs
Outdated
@@ -36,6 +37,11 @@ pub enum ProxyType { | |||
CancelProxy, | |||
Governance, | |||
Staking, | |||
CreateMarket, |
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.
Can a proxy only have one type? Meaning if you want to grant a user the ability to create markets and report outcomes but not provide liquidity or trade you have to have two proxy accounts of the individual types?
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.
https://wiki.polkadot.network/docs/learn-proxies
You can have multiple proxies for one account.
Means: As delegator you can add a "CreateMarket" proxy for account A (delegatee) and then you can add a "ReportOutcome" proxy for the same account A.
Now account A can create markets and do oracle reports on your behalf.
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.
So I guess when the proxy transaction is wrapped using polkadotjs we have to specify the correct proxy type for the extrinsic like this?
sdk.api.tx.proxy.proxy(proxy?.address, "CreateMarket", createMarketExtrinsic);
sdk.api.tx.proxy.proxy(proxy?.address, "ReportOutcome", reportExtrinsic);
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.
Added some comments, I think @maltekliemann should evaluate them as well before taking action.
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.
What about redeem_shares
? I think that should go both into Trading
and Liquidity
, because both "roles" need to redeem shares when the market is done.
Co-authored-by: Malte Kliemann <mail@maltekliemann.com>
Missclick in regards to the Revert commit (undone). |
What does it do?
Fixes #970
It allows to delegate a call on behalf of an account to another account.
It adds enum variants of the ProxyType in order to use them for different calls of zrml_prediction_markets or zrml_swaps.
What important points should reviewers know?
Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues?
References