mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-19 21:55:03 +01:00
Fix formatting
This commit is contained in:
@@ -16,8 +16,6 @@ pub use mint::{
|
||||
#[cfg(feature = "wallet")]
|
||||
pub use wallet::Database as WalletDatabase;
|
||||
|
||||
use crate::state;
|
||||
|
||||
/// CDK_database error
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
@@ -55,15 +53,17 @@ pub enum Error {
|
||||
/// Invalid keyset
|
||||
#[error("Unknown or invalid keyset")]
|
||||
InvalidKeysetId,
|
||||
#[cfg(feature = "mint")]
|
||||
/// Invalid state transition
|
||||
#[error("Invalid state transition")]
|
||||
InvalidStateTransition(state::Error),
|
||||
InvalidStateTransition(crate::state::Error),
|
||||
}
|
||||
|
||||
impl From<state::Error> for Error {
|
||||
fn from(state: state::Error) -> Self {
|
||||
#[cfg(feature = "mint")]
|
||||
impl From<crate::state::Error> for Error {
|
||||
fn from(state: crate::state::Error) -> Self {
|
||||
match state {
|
||||
state::Error::AlreadySpent => Error::AttemptUpdateSpentProof,
|
||||
crate::state::Error::AlreadySpent => Error::AttemptUpdateSpentProof,
|
||||
_ => Error::InvalidStateTransition(state),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user