Files
nym/validator-api/src/rewarded_set_updater/error.rs
T
Bogdan-Ștefan Neacşu 5f7b3db9a4 Feature/spend coconut (#1261)
* Add coconut verifier structure for coconut protocol in gateway

* Add endpoint for validator-api cred verification

* Remove unused signature field

* Register new endpoint

* Improve validator-api config handling

* Aggregate verif result from all apis

* Simplify aggregate functions

* Verify cred on apis correctly

* Introduced coconut bandwidth contract to validator client

* Fix rebase double import

* Fix clippy on non-coconut

* Add multisig contract address to validator client

* Refactor Credential struct

* Do bincode magic in the coconut interface

* Implement serialization for credential and remove bindcode

* Fix clippy and don't remove dkg

* Client release funds proposal

* Add wrapper for blinded serial number

Also compare theta with a blinded serial number (in base 58 form)
for future double spend protection.

* Only post blinded serial number to blockchain

* Validator api propose credential spending

* Fix wallet

* Gateway calls proposal creation

* Query for proposal in verify coconut

* Remove db from git

* Verify against proposal description

* Validator apis vote based on verification of cred

* Fix wallet fmt

* Execute the release of funds

* Fix translation between token and bytes

* Update CHANGELOG
2022-06-02 16:54:59 +03:00

47 lines
1.4 KiB
Rust

// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::node_status_api::models::ValidatorApiStorageError;
use thiserror::Error;
use validator_client::nymd::error::NymdError;
use validator_client::ValidatorClientError;
#[derive(Debug, Error)]
pub enum RewardingError {
// #[error("There were no mixnodes to reward (network is dead)")]
// NoMixnodesToReward,
#[error("Failed to execute the smart contract - {0}")]
ContractExecutionFailure(NymdError),
// The inner error should be modified at some point...
#[error("We run into storage issues - {0}")]
StorageError(ValidatorApiStorageError),
#[error("Failed to query the smart contract - {0}")]
ValidatorClientError(ValidatorClientError),
#[error("Error downcasting u128 -> u64")]
DowncastingError {
#[from]
source: std::num::TryFromIntError,
},
}
impl From<NymdError> for RewardingError {
fn from(err: NymdError) -> Self {
RewardingError::ContractExecutionFailure(err)
}
}
impl From<ValidatorApiStorageError> for RewardingError {
fn from(err: ValidatorApiStorageError) -> Self {
RewardingError::StorageError(err)
}
}
impl From<ValidatorClientError> for RewardingError {
fn from(err: ValidatorClientError) -> Self {
RewardingError::ValidatorClientError(err)
}
}