Skip to content

Commit

Permalink
add E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Dec 13, 2023
1 parent 5452d15 commit f0888b6
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 19 deletions.
14 changes: 12 additions & 2 deletions apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ where
// Invariant: Process slashes before inflation as they may affect
// the rewards in the current epoch.
self.process_slashes();
self.apply_inflation(current_epoch)?;
self.apply_inflation(current_epoch, &mut response)?;
}

// Consensus set liveness check
Expand Down Expand Up @@ -634,7 +634,11 @@ where
/// account, then update the reward products of the validators. This is
/// executed while finalizing the first block of a new epoch and is applied
/// with respect to the previous epoch.
fn apply_inflation(&mut self, current_epoch: Epoch) -> Result<()> {
fn apply_inflation(
&mut self,
current_epoch: Epoch,
response: &mut shim::response::FinalizeBlock,
) -> Result<()> {
let last_epoch = current_epoch.prev();
// Get input values needed for the PD controller for PoS.
// Run the PD controllers to calculate new rates.
Expand Down Expand Up @@ -773,6 +777,12 @@ where
funding.detail.amount().to_string_native(),
&funding.detail.target(),
);
for ibc_event in
self.wl_storage.write_log_mut().take_ibc_events()
{
let event = Event::from(ibc_event.clone());
response.events.push(event);
}
}
Err(_) => {
tracing::warn!(
Expand Down
7 changes: 7 additions & 0 deletions apps/src/lib/node/ledger/shell/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ where
id
);

for ibc_event in
shell.wl_storage.write_log_mut().take_ibc_events()
{
let event = Event::from(ibc_event.clone());
response.events.push(event);
}

ProposalEvent::pgf_payments_proposal_event(id, result)
.into()
}
Expand Down
Loading

0 comments on commit f0888b6

Please sign in to comment.