Skip to content

Commit

Permalink
node: remove anyhow from VST
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Dec 19, 2024
1 parent baa3021 commit 4dad39d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions node/src/chain/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use std::time::Duration;
use async_trait::async_trait;
use dusk_consensus::commons::{RoundUpdate, TimeoutSet};
use dusk_consensus::consensus::Consensus;
use dusk_consensus::errors::{ConsensusError, HeaderError, OperationError};
use dusk_consensus::errors::{
ConsensusError, HeaderError, OperationError, VstError,
};
use dusk_consensus::operations::{
CallParams, Operations, Output, VerificationOutput, Voter,
};
Expand Down Expand Up @@ -318,13 +320,12 @@ impl<DB: database::DB, VM: vm::VMExecution> Operations for Executor<DB, VM> {
prev_root: [u8; 32],
blk: &Block,
voters: &[Voter],
) -> Result<VerificationOutput, OperationError> {
) -> Result<VerificationOutput, VstError> {
info!("verifying state");

let vm = self.vm.read().await;

vm.verify_state_transition(prev_root, blk, voters)
.map_err(OperationError::InvalidVST)
}

async fn execute_state_transition(
Expand Down
3 changes: 2 additions & 1 deletion node/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//
// Copyright (c) DUSK NETWORK. All rights reserved.

use dusk_consensus::errors::VstError;
use dusk_consensus::operations::{CallParams, VerificationOutput, Voter};
use dusk_consensus::user::provisioners::Provisioners;
use dusk_consensus::user::stake::Stake;
Expand Down Expand Up @@ -32,7 +33,7 @@ pub trait VMExecution: Send + Sync + 'static {
prev_root: [u8; 32],
blk: &Block,
voters: &[Voter],
) -> anyhow::Result<VerificationOutput>;
) -> Result<VerificationOutput, VstError>;

fn accept(
&self,
Expand Down

0 comments on commit 4dad39d

Please sign in to comment.