Skip to content

Commit

Permalink
GH-2045 Fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jan 15, 2024
1 parent 7962634 commit 7c59cf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions libraries/chain/block_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ block_state::block_state(const block_header_state& bhs, deque<transaction_metada
block->transactions = std::move(trx_receipts);
}

// Used for transition from dbpos to instant-finality
// Used for transition from dpos to instant-finality
block_state::block_state(const block_state_legacy& bsp) {
block_header_state::id = bsp.id();
header = bsp.header;
activated_protocol_features = bsp.activated_protocol_features;
std::optional<block_header_extension> ext = bsp.block->extract_header_extension(instant_finality_extension::extension_id());
assert(ext); // required by current transistion mechanism
assert(ext); // required by current transition mechanism
const auto& if_extension = std::get<instant_finality_extension>(*ext);
assert(if_extension.new_finalizer_policy); // required by current transistion mechanism
assert(if_extension.new_finalizer_policy); // required by current transition mechanism
active_finalizer_policy = std::make_shared<finalizer_policy>(*if_extension.new_finalizer_policy);
active_proposer_policy = std::make_shared<proposer_policy>();
active_proposer_policy->active_time = bsp.timestamp();
active_proposer_policy->proposer_schedule = bsp.active_schedule;
header_exts = bsp.header_exts; // not needed, but copy over just in case
header_exts = bsp.header_exts;
block = bsp.block;
validated = bsp.is_valid();
pub_keys_recovered = bsp._pub_keys_recovered;
Expand Down
6 changes: 3 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ struct block_data_t {
block_timestamp_type head_block_time() const { return std::visit([](const auto& bd) { return bd.head->timestamp(); }, v); }
account_name head_block_producer() const { return std::visit([](const auto& bd) { return bd.head->producer(); }, v); }

void transistion_fork_db_to_if(const auto& vbsp) {
void transition_fork_db_to_if(const auto& vbsp) {
std::visit([](auto& bd) { bd.fork_db.close(); }, v);
auto bsp = std::make_shared<block_state>(*std::get<block_state_legacy_ptr>(vbsp));
v.emplace<block_data_new_t>(std::visit([](const auto& bd) { return bd.fork_db.get_data_dir(); }, v));
Expand Down Expand Up @@ -2720,7 +2720,7 @@ struct controller_impl {
log_irreversible();
}

// TODO: temp transistion to instant-finality, happens immediately after block with new_finalizer_policy
// TODO: temp transition to instant-finality, happens immediately after block with new_finalizer_policy
auto transition = [&](auto& fork_db, auto& head) -> bool {
const auto& bsp = std::get<std::decay_t<decltype(head)>>(cb.bsp);
std::optional<block_header_extension> ext = bsp->block->extract_header_extension(instant_finality_extension::extension_id());
Expand All @@ -2737,7 +2737,7 @@ struct controller_impl {
return false;
};
if (block_data.apply_dpos<bool>(transition)) {
block_data.transistion_fork_db_to_if(cb.bsp);
block_data.transition_fork_db_to_if(cb.bsp);
}

} catch (...) {
Expand Down

0 comments on commit 7c59cf3

Please sign in to comment.