Skip to content
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 tests for creator-staking pallet #234

Merged
merged 9 commits into from
Oct 12, 2023
Merged

Conversation

F3Joule
Copy link
Member

@F3Joule F3Joule commented Oct 4, 2023

No description provided.

@F3Joule F3Joule self-assigned this Oct 4, 2023
@F3Joule F3Joule requested a review from olehmell October 4, 2023 08:47
@F3Joule F3Joule changed the title Add compilable tests for creator-staking pallet Add tests for creator-staking pallet Oct 6, 2023
pallets/creator-staking/src/tests/testing_utils.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/testing_utils.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/testing_utils.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/testing_utils.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/testing_utils.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/tests_lib.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/tests.rs Outdated Show resolved Hide resolved
})
}

// FIXME: how to be here?
Copy link
Contributor

@olehmell olehmell Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, are you going to fix?

pallets/creator-staking/src/tests/tests.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/tests.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/tests/tests.rs Outdated Show resolved Hide resolved
@F3Joule F3Joule requested a review from olehmell October 11, 2023 15:51
@F3Joule F3Joule merged commit 63207e3 into f3/cs-renames Oct 12, 2023
1 check passed
F3Joule added a commit that referenced this pull request Oct 18, 2023
* 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]>
F3Joule added a commit that referenced this pull request Oct 18, 2023
* 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]>
F3Joule added a commit that referenced this pull request Oct 21, 2023
* 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]>
F3Joule added a commit that referenced this pull request Oct 21, 2023
* 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]>
@F3Joule F3Joule deleted the f3/cs-tests-and-benches branch October 30, 2023 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants