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

staking tests #754

Merged
merged 27 commits into from
Apr 3, 2018
Merged

staking tests #754

merged 27 commits into from
Apr 3, 2018

Conversation

rigelrozanski
Copy link
Contributor

@rigelrozanski rigelrozanski commented Mar 30, 2018

tick tests / pool tests / keeper tests
closes #735
closes #731
closes #732
closes #571

@rigelrozanski rigelrozanski requested a review from ebuchman as a code owner March 30, 2018 20:25
@codecov
Copy link

codecov bot commented Mar 30, 2018

Codecov Report

Merging #754 into develop will increase coverage by 3.75%.
The diff coverage is 75.93%.

@@             Coverage Diff             @@
##           develop     #754      +/-   ##
===========================================
+ Coverage    59.52%   63.28%   +3.75%     
===========================================
  Files           62       62              
  Lines         3274     3315      +41     
===========================================
+ Hits          1949     2098     +149     
+ Misses        1181     1069     -112     
- Partials       144      148       +4

@@ -187,8 +176,12 @@ func BondCoins(ctx sdk.Context, k Keeper, bond DelegatorBond, candidate Candidat
if err != nil {
return err
}
newShares := k.candidateAddTokens(ctx, candidate, amount.Amount)
p := k.GetPool(ctx)
var newShares sdk.Rat
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: := is probably cleaner here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh okay yeah can do that here actually. 👍

// load/save the pool
func (k Keeper) GetPool(ctx sdk.Context) (gs Pool) {
// check if cached before anything
if k.gs != (Pool{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is a layer of caching on top of the multistore necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is based off of conversation with jae/sunny in berlin... if retrieving multiple times why unmarshal multiple times

@rigelrozanski rigelrozanski changed the title staking tick tests staking tick tests / pool tests Mar 30, 2018
@rigelrozanski rigelrozanski changed the title staking tick tests / pool tests staking tick tests / pool tests / keeper tests Apr 2, 2018
@rigelrozanski rigelrozanski changed the title staking tick tests / pool tests / keeper tests staking tests Apr 2, 2018
@mossid
Copy link
Contributor

mossid commented Apr 3, 2018

closes: #571

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

Didn't actually review, testing for @rigelrozanski

@rigelrozanski rigelrozanski merged commit e756c4a into develop Apr 3, 2018
@rigelrozanski
Copy link
Contributor Author

cool thanks

@rigelrozanski rigelrozanski deleted the rigel/tick-tests branch April 3, 2018 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants