-
Notifications
You must be signed in to change notification settings - Fork 16
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 more RPCs to creator staking pallet #235
Conversation
There are 2 RPCs: the first one to get estimated rewards, the second one to get claimable eras.
|
||
if self.stakes.len() == 1 || has_no_stake_updates_for_the_next_era { | ||
if self.stakes.len() == 1 || oldest_era_stake.era + 2 <= self.stakes[1].era { |
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.
tbh need to add comment why + 2
, I read the code and I have forgot why :)
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.
There was a comment right below. Moved it above the if
statement and changed the text to make it more clear.
- Fix code formating Co-Authored-By: olehmell <olehmell@ users.noreply.github.com>
* Rename staker to backer in creator staking pallet - Fix all ledger occurrences - Introduce CreatorId type alias (for SpaceId) for consistency purposes * Apply suggestions from docs review Co-authored-by: Yung Beef 4.2 <[email protected]> * Apply more suggestions from docs review Co-authored-by: Yung Beef 4.2 <[email protected]> * Remove unnecessary doc * Update update_backer_info arguments names * Rename UnlockingChunk > UnbondingChunk * Rename impl unstake to decrease_stake * Rename GeneralBackerInfo to BackerStakesByCreator - Consistently renamed backer_info to backer_stakes * Fix typo in creator staking pallet docs * Rename total to total_staked in CreatorStakeInfo * Rename all unlocking to unbonding in creator staking pallet * Add tests for creator-staking pallet (#234) * Add tests for creator staking * Add inflation tests * Add new event on changing distribution config * Update RewardsDistributionConfig struct - Rename to RewardDistributionConfig - Rename impl fn `is_consistent` to `is_sum_equal_to_one` Co-Authored-By: siman <[email protected]> * Apply suggestions from code review Co-Authored-By: siman <[email protected]> Co-Authored-By: olehmell <[email protected]> * Rename unregister_era to unregistration_era * Fix doc in tests * FIx visibility modificators in creator staking pallet * Fix unlocking_chunks and backer_info namings - Fixed accross the creator staking pallet --------- Co-authored-by: siman <[email protected]> Co-authored-by: olehmell <[email protected]> * Apply fixes after final code review (#236) * Refactor ensure_creator_active_in_era * Rename `should_restake` to `can_restake` * Rename a few events in creator staking pallet - Fix on_initialize weights * Fix namings * Rename ensure fn in creator staking pallet Co-Authored-By: siman <siman@ [email protected]> * Fix error name Co-Authored-By: siman <siman@ [email protected]> * Fix namings in RPCs functions * Add creator_id to StakeWithdrawnFromInactiveCreator event * Add transfer space ownership restrictions For now it's not possible to transfer space ownership if space is registered as a creator * Refactor transfer space ownership restriction * Update doc for CreatorStakingProvider * Introduce ensure_not_active_creator in space-ownership pallet - Fix impl for empty tuple to make tests pass. --------- Co-authored-by: siman <siman@ [email protected]> * Add more RPCs to creator staking pallet (#235) * Fix creator staking RPCs * Fix bug in claim function for backers * Add more RPCs to creator staking pallet There are 2 RPCs: the first one to get estimated rewards, the second one to get claimable eras. * Apply suggestions from code review - Fix code formating --------- Co-authored-by: Yung Beef 4.2 <[email protected]> Co-authored-by: siman <[email protected]> Co-authored-by: olehmell <[email protected]>
* Improve docs and grammar in creator staking pallet (#233) * Add tests for creator-staking pallet (#234) * Apply fixes after final code review (#236) * Add more RPCs to creator staking pallet (#235) --------- Co-authored-by: siman <[email protected]> Co-authored-by: Alex Siman <[email protected]> Co-authored-by: Yung Beef 4.2 <[email protected]> Co-authored-by: olehmell <[email protected]>
* Add custom RPC to creator staking pallet * Add RPC functions' logic to a runtime - Add creator-staking RPC to the node - Update Cargo.lock * Add claims count RPC * Apply grammar fixes from code review Co-authored-by: Oleh Mell <[email protected]> * Apply suggestions after creator staking code review (#232) * Improve docs and grammar in creator staking pallet (#233) * Add tests for creator-staking pallet (#234) * Apply fixes after final code review (#236) * Add more RPCs to creator staking pallet (#235) --------- Co-authored-by: Oleh Mell <[email protected]> Co-authored-by: siman <[email protected]> Co-authored-by: Alex Siman <[email protected]> Co-authored-by: Yung Beef 4.2 <[email protected]> Co-authored-by: olehmell <[email protected]>
* Add custom RPCs to creator staking (#231) * Apply suggestions after creator staking code review (#232) * Improve docs and grammar in creator staking pallet (#233) * Add tests for creator-staking pallet (#234) * Apply fixes after final code review (#236) * Add more RPCs to creator staking pallet (#235) * Bump crates version to 0.1.10 * Update spec_version to 29 * Remove redundant migration from runtime --------- Co-authored-by: olehmell <[email protected]> Co-authored-by: Alex Siman <[email protected]> Co-authored-by: Oleh Mell <[email protected]> Co-authored-by: siman <[email protected]> Co-authored-by: Yung Beef 4.2 <[email protected]>
There are two new RPCs: