threshold-network / merkle-distribution

Threshold Network rewards generation and distribution
https://threshold.network
1 stars 6 forks source link

Add "claim and stake" function to Merkle contract #18

Closed manumonti closed 2 years ago

manumonti commented 2 years ago

Claim and Stake allows stakers to claim their rewards from Merkle distribution and, thereafter, stake the earned tokens.

In order to keep the backward compatibility, a new internal claim function has been created, which will accept a boolean value to choose between just claim or claim and stake.

Also, new tests has been added to check the new functions.

manumonti commented 2 years ago

Could we change one of the test to call claimAndStake then check that the stake amount has increased but the accounts total tokens hasn't?

Added tests for claimAndStake and batchClaimAndStake functions!

manumonti commented 2 years ago

Update: since this change implies updating Token Staking contract, we are not going to merge this PR at this moment.