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

VIZ Update 11 (3.0.0 version) #84

Merged
merged 21 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "thirdparty/fc"]
path = thirdparty/fc
url = https://github.com/VIZ-Blockchain/fc.git
branch = update
[submodule "thirdparty/chainbase"]
path = thirdparty/chainbase
url = https://github.com/VIZ-Blockchain/chainbase.git
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Build docker images](https://github.com/VIZ-Blockchain/viz-cpp-node/workflows/Build%20docker%20images/badge.svg)

VIZ is a DPOS blockchain with an unproven consensus algorithm (Fair DPOS with witness penalty for missing block).
VIZ is a Graphene blockchain with a Fair-DPOS consensus algorithm (vote weight splitted to selected witnesses, witness gets a penalty for missing a block).

## Building

Expand Down
5 changes: 4 additions & 1 deletion libraries/api/account_api_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ account_api_object::account_api_object(const account_object& a, const graphene::
witnesses_voted_for(a.witnesses_voted_for), witnesses_vote_weight(a.witnesses_vote_weight), last_root_post(a.last_root_post), last_post(a.last_post),
average_bandwidth(a.average_bandwidth), lifetime_bandwidth(a.lifetime_bandwidth), last_bandwidth_update(a.last_bandwidth_update),
valid(a.valid), account_seller(a.account_seller), account_offer_price(a.account_offer_price), account_on_sale(a.account_on_sale), account_on_sale_start_time(a.account_on_sale_start_time),
subaccount_seller(a.subaccount_seller), subaccount_offer_price(a.subaccount_offer_price), subaccount_on_sale(a.subaccount_on_sale){
subaccount_seller(a.subaccount_seller), subaccount_offer_price(a.subaccount_offer_price), subaccount_on_sale(a.subaccount_on_sale),
reserved_balance(a.reserved_balance), target_buyer(a.target_buyer), account_on_auction(a.account_on_auction),
current_bid(a.current_bid), current_bidder(a.current_bidder), current_bidder_key(a.current_bidder_key),
last_bid(a.last_bid){
size_t n = a.proxied_vsf_votes.size();
proxied_vsf_votes.reserve(n);
for (size_t i = 0; i < n; i++) {
Expand Down
12 changes: 12 additions & 0 deletions libraries/api/include/graphene/api/account_api_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ struct account_api_object {
account_name_type subaccount_seller;
asset subaccount_offer_price;
bool subaccount_on_sale;

asset reserved_balance;

account_name_type target_buyer;

bool account_on_auction;
asset current_bid;
account_name_type current_bidder;
public_key_type current_bidder_key;
asset last_bid;
};

} } // graphene::api
Expand All @@ -106,6 +116,8 @@ FC_REFLECT(
(valid)
(account_seller)(account_offer_price)(account_on_sale)(account_on_sale_start_time)
(subaccount_seller)(subaccount_offer_price)(subaccount_on_sale)
(reserved_balance)(target_buyer)
(account_on_auction)(current_bid)(current_bidder)(current_bidder_key)(last_bid)
)

#endif //CHAIN_ACCOUNT_API_OBJ_HPP
697 changes: 644 additions & 53 deletions libraries/chain/chain_evaluator.cpp

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions libraries/chain/committee_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace graphene { namespace chain {
const auto &creator = _db.get_account(o.creator);
_db.get_account(o.worker);

//if(_db.has_hardfork(CHAIN_HARDFORK_9))//can be deleted after fix in CHAIN_HARDFORK_11
// FC_ASSERT(!creator.valid, "Account flagged as invalid");
if(_db.has_hardfork(CHAIN_HARDFORK_9)){
FC_ASSERT(creator.balance >=
median_props.committee_create_request_fee, "Account does not have sufficient funds to create a committee request: required ${a}.",("a",median_props.committee_create_request_fee));
Expand Down Expand Up @@ -64,7 +66,9 @@ namespace graphene { namespace chain {
}

void committee_worker_cancel_request_evaluator::do_apply(const committee_worker_cancel_request_operation& o) {
_db.get_account(o.creator);
const auto &creator = _db.get_account(o.creator);
//if(_db.has_hardfork(CHAIN_HARDFORK_9))//can be deleted after fix in CHAIN_HARDFORK_11
// FC_ASSERT(!creator.valid, "Account flagged as invalid");
const auto &idx = _db.get_index<committee_request_index>().indices().get<by_request_id>();
auto itr = idx.find(o.request_id);
FC_ASSERT(itr != idx.end(), "Committee request id not found.");
Expand All @@ -84,7 +88,9 @@ namespace graphene { namespace chain {
}

void committee_vote_request_evaluator::do_apply(const committee_vote_request_operation& o) {
_db.get_account(o.voter);
const auto &voter = _db.get_account(o.voter);
//if(_db.has_hardfork(CHAIN_HARDFORK_9))//can be deleted after fix in CHAIN_HARDFORK_11
// FC_ASSERT(!voter.valid, "Account flagged as invalid");
const auto &idx = _db.get_index<committee_request_index>().indices().get<by_request_id>();
auto itr = idx.find(o.request_id);
FC_ASSERT(itr != idx.end(), "Committee request id not found.");
Expand Down
Loading
Loading