Skip to content

Commit

Permalink
Merge pull request #946 from GolosChain/937-ee-genesis-vesting-supply
Browse files Browse the repository at this point in the history
Vesting supply to EE-genesis #937
  • Loading branch information
afalaleev committed Jul 10, 2019
2 parents 9134fbd + 0e73cbf commit eecd238
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions programs/create-genesis/ee_genesis/event_engine_genesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ static abi_def create_funds_abi() {
}
});

abi.structs.emplace_back( struct_def {
"vesting_supply", "", {
{"supply", "asset"},
}
});

return abi;
}

Expand Down
4 changes: 4 additions & 0 deletions programs/create-genesis/ee_genesis/genesis_ee_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,10 @@ void genesis_ee_builder::write_funds() {
for (auto& be : exp_info_.balance_events) {
out.insert(be);
}

out.start_section(info_.golos.names.vesting, N(stat), "vesting_supply");

out.insert(exp_info_.vesting_supply);
}

void genesis_ee_builder::write_balance_converts() {
Expand Down
1 change: 1 addition & 0 deletions programs/create-genesis/export_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct export_info {
fc::flat_map<acc_idx, mvo> witnesses;
fc::flat_map<acc_idx, fc::flat_set<name>> witness_votes;
std::vector<mvo> currency_stats;
mvo vesting_supply;
std::vector<mvo> balance_events;
std::vector<mvo> delegations;
fc::flat_map<uint64_t, cyberway::golos::active_comment_data> active_comments;
Expand Down
6 changes: 4 additions & 2 deletions programs/create-genesis/genesis_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,12 @@ struct genesis_create::genesis_create_impl final {
// vesting info
db.start_section(_info.golos.names.vesting, N(stat), "vesting_stats", 1);
primary_key_t vests_pk = VESTS >> 8;
db.insert(vests_pk, _info.golos.names.vesting, mvo
("supply", asset(data.total_gests.get_amount(), symbol(VESTS)))
auto vesting_stat = mvo
("supply", asset(data.total_gests.get_amount(), symbol(VESTS)));
db.insert(vests_pk, _info.golos.names.vesting, vesting_stat
("notify_acc", _info.golos.names.control)
);
_exp_info.vesting_supply = vesting_stat;

// funds
const auto n_acc_balances = std::count_if(_info.accounts.begin(), _info.accounts.end(), [](const auto& a) {return a.sys_balance;}); //
Expand Down

0 comments on commit eecd238

Please sign in to comment.