Skip to content

Commit

Permalink
feat: added finalize_snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Jan 16, 2025
1 parent a876678 commit 76a0576
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/rs-drive-abci/src/abci/app/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,11 @@ where
) -> Result<proto::ResponseApplySnapshotChunk, proto::ResponseException> {
handler::apply_snapshot_chunk(self, request).map_err(error_into_exception)
}

fn finalize_snapshot(
&self,
request: proto::RequestFinalizeSnapshot,
) -> Result<proto::ResponseFinalizeSnapshot, proto::ResponseException> {
handler::finalize_snapshot(self, request).map_err(error_into_exception)
}
}
18 changes: 18 additions & 0 deletions packages/rs-drive-abci/src/abci/handler/finalize_snapshot.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use tenderdash_abci::proto::abci as proto;
use crate::abci::app::{PlatformApplication};
use crate::error::Error;
use crate::rpc::core::CoreRPCLike;

pub fn finalize_snapshot<A, C>(
app: &A,
request: proto::RequestFinalizeSnapshot,
) -> Result<proto::ResponseFinalizeSnapshot, Error>
where
A: PlatformApplication<C>,
C: CoreRPCLike,
{
//let mut new_state = PlatformState::v
//let x = app.platform().state.load();
let mut new_state = (*app.platform().state.load()).clone();
Ok(Default::default())
}
2 changes: 2 additions & 0 deletions packages/rs-drive-abci/src/abci/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ mod offer_snapshot;
mod prepare_proposal;
mod process_proposal;
mod verify_vote_extension;
mod finalize_snapshot;

pub use apply_snapshot_chunk::apply_snapshot_chunk;
pub use check_tx::check_tx;
pub use echo::echo;
pub use extend_vote::extend_vote;
pub use finalize_block::finalize_block;
pub use finalize_snapshot::finalize_snapshot;
pub use info::info;
pub use init_chain::init_chain;
pub use list_snapshots::list_snapshots;
Expand Down

0 comments on commit 76a0576

Please sign in to comment.