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 last_vote_time to account stats object #1449

Merged
merged 6 commits into from Dec 16, 2018

Conversation

@oxarbitrage
Copy link
Member

commented Nov 26, 2018

Pull for #1393

I am not very sure about the default value of account parameter: https://github.com/oxarbitrage/bitshares-core/blob/5d1c15cdd7faa955463902ea1348ba302eb65681/libraries/chain/account_evaluator.cpp#L60

I did it that way so i can call verify_account_votes without the extra parameter at account creation: https://github.com/oxarbitrage/bitshares-core/blob/5d1c15cdd7faa955463902ea1348ba302eb65681/libraries/chain/account_evaluator.cpp#L162

Open to suggestions.

@jmjatlanta
Copy link
Contributor

left a comment

Tested with Ubuntu 18.10 / Boost 1.67. Good coverge on Boost test. Thanks!

db.modify(stats_obj, [&](account_statistics_object &obj) {
obj.last_vote_time = db.head_block_time();
});
}

This comment has been minimized.

Copy link
@abitmore

abitmore Nov 26, 2018

Member

This means every time when do_evaluate is called (E.G. by validate_transaction API ?), the data will be updated. But do_evaluate can fail.

This comment has been minimized.

Copy link
@abitmore

abitmore Nov 26, 2018

Member

Usually as an unwritten principle we don't modify database in do_evaluate, but probably it's practically fine to do so. @pmconrad your opinion?

This comment has been minimized.

Copy link
@pmconrad

pmconrad Nov 29, 2018

Contributor

I agree that do_evaluate must not modify the database.
IMO it's a good design decision to separate the various stages of operation evaluation, and we should stick with it.

This comment has been minimized.

Copy link
@oxarbitrage

oxarbitrage Nov 29, 2018

Author Member

got it, thanks. ill refactor to do the update in do_apply or something different.

@oxarbitrage oxarbitrage referenced this pull request Nov 29, 2018

Open

Define coding style guidelines #1318

13 of 34 tasks complete
@pmconrad
Copy link
Contributor

left a comment

Need to bump GRAPHENE_CURRENT_DB_VERSION when adding a field

// last_vote_time is not updated
now = db.head_block_time().sec_since_epoch();
alice_stats_obj = db.get_account_stats_by_owner(alice_id);
BOOST_CHECK(alice_stats_obj.last_vote_time.sec_since_epoch() != now);

This comment has been minimized.

Copy link
@pmconrad

pmconrad Dec 14, 2018

Contributor

better check that last_vote_time equals the previous now

Feature Release (201902) automation moved this from In progress to Reviewer approved Dec 15, 2018

@pmconrad

This comment has been minimized.

Copy link
Contributor

commented Dec 15, 2018

Looks like you have to rebase to avoid the conflict

Feature Release (201902) automation moved this from Reviewer approved to In progress Dec 15, 2018

@oxarbitrage

This comment has been minimized.

Copy link
Member Author

commented Dec 15, 2018

fixed conflict in database bump number, need to re approve. thanks.

Feature Release (201902) automation moved this from In progress to Reviewer approved Dec 16, 2018

@oxarbitrage oxarbitrage merged commit ae1cbfa into bitshares:develop Dec 16, 2018

2 checks passed

ci/dockercloud Your tests passed in Docker Cloud
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.