Open wangminqi opened 2 years ago
Do you need a document for how to get candidate (target collator) / delegator (this extrinsic sender)'s total number of delegations? @bianyunjian
Do you need a document for how to get candidate (target collator) / delegator (this extrinsic sender)'s total number of delegations? @bianyunjian
we can query it, or just assign a bit number? should it be an accurate number?
As long as the input numbers are larger than expected, it should be okay. But these two number effects the transaction fee users pay. The larger the numbers, the higher total gas. It will be best if we keep them as small as possible, so ideally we query and make them equal to candidate (target collator) / delegator (this extrinsic sender)'s total number of delegations.
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.turing.oak.tech#/chainstate Anyway, I leave the query method on polkadot.js here.
For candiate (collator) delegation number
For delegator's delegation number
pub fn delegate( origin: OriginFor,
candidate: T::AccountId,
amount: BalanceOf,
candidate_delegation_count: u32,
delegation_count: u32,
)
https://github.com/OAK-Foundation/moonbeam/blob/oak-staging/pallets/parachain-staking/src/lib.rs#L1162
candidate : The collator accountId amount: The amount delegation amount
delegation_count: make sure this number is larger than delegator (this extrinsic sender)'s total number of delegations . candidate_delegation_count: make sure this number is larger than candidate (target collator)'s total number of delegations.