Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Index bucket by voter and candidate #311

Merged
merged 7 commits into from
Feb 18, 2021
Merged

Conversation

CoderZhi
Copy link
Contributor

@CoderZhi CoderZhi commented Dec 4, 2020

based on #310

@todo
Copy link

todo bot commented Dec 4, 2020

(), rawArgs)

args, err := ec.field_Action_byBucketIndex_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Action.ByBucketIndex(childComplexity, args["bucketIndex"].(int)), true


This comment was generated by todo based on a TODO comment in 09d4f69 in #311. cc @iotexproject.

@todo
Copy link

todo bot commented Dec 4, 2020

(), rawArgs)

args, err := ec.field_Query_bucketsByCandidate_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.BucketsByCandidate(childComplexity, args["name"].(string), args["pagination"].(*Pagination)), true


This comment was generated by todo based on a TODO comment in 09d4f69 in #311. cc @iotexproject.

@todo
Copy link

todo bot commented Dec 4, 2020

(), rawArgs)

args, err := ec.field_Query_bucketsByVoter_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.BucketsByVoter(childComplexity, args["address"].(string), args["pagination"].(*Pagination)), true


This comment was generated by todo based on a TODO comment in 09d4f69 in #311. cc @iotexproject.

@todo
Copy link

todo bot commented Dec 4, 2020

calculate weighted votes

// TODO: calculate weighted votes
WeightedVotes: "0",
RemainingDuration: ipvotings.CalcRemainingTime(bucket).String(),
StartTime: bucket.StakeStartTime.String(),
Decay: !bucket.AutoStake,
})


This comment was generated by todo based on a TODO comment in 09d4f69 in #311. cc @iotexproject.

@todo
Copy link

todo bot commented Dec 4, 2020

calculation of remaining time is wrong

// TODO: calculation of remaining time is wrong
remainingTime := float64(v.StakedDuration * 86400)
weight := float64(1)
var m float64


This comment was generated by todo based on a TODO comment in 09d4f69 in #311. cc @iotexproject.

@guo guo temporarily deployed to iotex-analytics-staging December 6, 2020 01:03 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 09d4f69 to c5b6da4 Compare December 6, 2020 01:32
@guo guo temporarily deployed to iotex-analytics-staging December 6, 2020 01:33 Inactive
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 05:17 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from c5b6da4 to 2a12637 Compare December 9, 2020 05:29
@todo
Copy link

todo bot commented Dec 9, 2020

change voter to be a parameter of QueryRow

// TODO: change voter to be a parameter of QueryRow
getQuery := fmt.Sprintf(selectBucketActionCountByVoter, actions.BucketActionsTableName, votings.StakingBucketInfoTableName, votings.StakingBucketInfoTableName, voter)
return p.getCount(getQuery)
}
// GetBucketActionsByVoter gets action information list by voter address


This comment was generated by todo based on a TODO comment in 2a12637 in #311. cc @iotexproject.

@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 05:29 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 2a12637 to ea5a371 Compare December 9, 2020 05:33
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 05:33 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from ea5a371 to f9ee470 Compare December 9, 2020 05:43
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 05:44 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from f9ee470 to 6473c99 Compare December 9, 2020 06:07
@codecov-io
Copy link

codecov-io commented Dec 9, 2020

Codecov Report

Merging #311 (af82761) into master (9cd17ae) will decrease coverage by 0.33%.
The diff coverage is 37.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #311      +/-   ##
==========================================
- Coverage   41.20%   40.86%   -0.34%     
==========================================
  Files          20       21       +1     
  Lines        3070     3164      +94     
==========================================
+ Hits         1265     1293      +28     
- Misses       1460     1526      +66     
  Partials      345      345              
Impacted Files Coverage Δ
indexprotocol/actions/protocol.go 48.70% <0.00%> (-0.98%) ⬇️
queryprotocol/actions/protocol.go 22.46% <0.00%> (-2.36%) ⬇️
indexprotocol/blocks/protocol.go 43.98% <12.50%> (-2.43%) ⬇️
indexprotocol/actions/bucket.go 42.10% <42.10%> (ø)
indexprotocol/votings/bucketoperator.go 59.34% <84.61%> (+0.37%) ⬆️
indexprotocol/accounts/protocol.go 51.00% <87.50%> (+7.82%) ⬆️
indexprotocol/votings/protocol.go 36.57% <100.00%> (ø)
indexprotocol/votings/stakingprotocol.go 47.07% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9cd17ae...af82761. Read the comment docs.

@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 06:08 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 6473c99 to dea11bb Compare December 9, 2020 06:19
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 06:20 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from dea11bb to 7d3a0c5 Compare December 9, 2020 06:39
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 06:39 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 7d3a0c5 to cf334dd Compare December 9, 2020 07:11
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 07:11 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from cf334dd to 9b1e1a1 Compare December 9, 2020 07:14
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 07:15 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 9b1e1a1 to 67b6b8a Compare December 9, 2020 07:17
@guo guo temporarily deployed to iotex-analytics-staging December 9, 2020 07:18 Inactive
@guo guo temporarily deployed to iotex-analytics-staging January 7, 2021 04:34 Inactive
@CoderZhi CoderZhi temporarily deployed to iotex-analytics-staging-2 January 15, 2021 07:41 Inactive
@CoderZhi CoderZhi temporarily deployed to iotex-analytics-staging-2 February 16, 2021 13:35 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 38cc19c to 8059e33 Compare February 16, 2021 18:38
@CoderZhi CoderZhi temporarily deployed to iotex-analytics-staging-2 February 16, 2021 18:39 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 8059e33 to 75eb604 Compare February 16, 2021 23:30
@CoderZhi CoderZhi temporarily deployed to iotex-analytics-staging-2 February 16, 2021 23:37 Inactive
@CoderZhi CoderZhi force-pushed the index_bucket_by_voter_and_candidate branch from 75eb604 to 7ca90fc Compare February 17, 2021 05:26
@CoderZhi CoderZhi temporarily deployed to iotex-analytics-staging-2 February 17, 2021 05:27 Inactive
@guo guo merged commit 09ca822 into master Feb 18, 2021
@CoderZhi CoderZhi deleted the index_bucket_by_voter_and_candidate branch May 24, 2021 06:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants