-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: returning detailed account information for affiliate in the cf_account_info rpc for brokers #5641
base: release/1.8
Are you sure you want to change the base?
feat: returning detailed account information for affiliate in the cf_account_info rpc for brokers #5641
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
I think the idea was to also add account balances for all account types, so that it would also show if the account is an unregistered affiliate. Something like this: pub struct RpcAccountInfoWithBalances {
asset_balances: any::AssetMap<NumberOrHex>,
#[serde(flatten)]
account_info: RpcAccountInfo,
} And then change the rpc return type to |
@@ -240,9 +247,11 @@ pub enum RpcAccountInfo { | |||
Broker { | |||
flip_balance: NumberOrHex, | |||
bond: NumberOrHex, | |||
#[deprecated(note = "This field is deprecated and will be replaced in a future release")] | |||
earned_fees: any::AssetMap<NumberOrHex>, | |||
affiliates: Vec<(AffiliateShortId, AccountId)>, |
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.
Might as well deprecate this too and add the account_id into RpcAffiliateDetails.
state-chain/custom-rpc/src/lib.rs
Outdated
pub struct RpcAffiliateDetails { | ||
pub short_id: AffiliateShortId, | ||
pub withdrawal_address: EthereumAddress, | ||
pub earned_fees: NumberOrHex, |
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.
pub earned_fees: NumberOrHex, | |
pub balance: NumberOrHex, |
Feedback was that earned_fees
was misleading because it didn't include 'all time' fees.
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 think balance is misleading since it is not the on chain balance but the collected fees in usdc
@@ -197,6 +197,7 @@ pub struct BrokerInfo { | |||
pub btc_vault_deposit_address: Option<String>, | |||
pub affiliates: Vec<(AffiliateShortId, AccountId32)>, | |||
pub bond: AssetAmount, | |||
pub affiliate_details: Vec<(AffiliateDetails, AssetAmount)>, |
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.
Unfortunately this is a breaking change to the runtime API. We can do this but we should manage it using runtime api versioning (see the doc comment on the CustomRuntimeApi trait).
Alternatively maybe we can get the data we need via get_affiliates
.
1d1ec89
to
4301661
Compare
Pull Request
Closes: PRO-2038
Checklist
Please conduct a thorough self-review before opening the PR.
Summary