-
Notifications
You must be signed in to change notification settings - Fork 26
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
Rewards- threshold lib updates #307
Open
r-czajkowski
wants to merge
10
commits into
staking-threshold-lib
Choose a base branch
from
rewards-threshold-lib
base: staking-threshold-lib
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These utils functions/variables will be useful in the threshold ts lib eg for calculating staking bonus rewards.
In the future we should create a contract wrapper for each contract the threshold lib integrates to keep the same interface. In some cases multiple services need the same contract data like deployment block or address. So to avoid duplicating the creation of each contract in each service can create one contract instance and pass to the service in constructor.
Move fetching the staking bonus rewards to the threshold lib. Also add a function to the staking and pre service to fetch necessary events to calculate rewards.
Move fetching the interim staking rewards to the threshold ts lib and update hooks to use the services from threshold lib.
Rewards is a wrapper for all type of rewards in the threshold network. Currently there are 2 types of rewards: staking bonus and interim staking rewards. We should keep in mind that calculated reward from interim rewards service may include the staking bonus reward.
We keep the abi for `ComulativeMerkleDrop` contract in the threshold ts lib.
Preview uploaded to https://preview.dashboard.test.threshold.network/rewards-threshold-lib/index.html. |
Preview uploaded to https://preview.dashboard.test.threshold.network/rewards-threshold-lib/index.html. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on: #302
This PR moves the contract integration part from hooks to the Threshold-ts library. Thanks to this layer we can separate work between UI and contract integration. Also, it helps to unit test created services and move the "business logic" from the React hooks.
Main changes in Threshold-ts lib
IStaking
interface that returnStaked/ToppedUp/Unstaked
events for staking providers.IPRE
interface that returnsOperatorConfirmed
events for staking providers.