pub struct SubmitProofResponse {
pub accepted: bool,
pub proof_id: Option<Uuid>,
pub reward_points: Option<Points>,
pub rejection_reason: Option<String>,
}Expand description
Response from proof submission.
§Examples
use chie_shared::SubmitProofResponse;
use uuid::Uuid;
// Accepted proof with rewards
let accepted = SubmitProofResponse {
accepted: true,
proof_id: Some(Uuid::new_v4()),
reward_points: Some(100),
rejection_reason: None,
};
assert!(accepted.accepted);
assert!(accepted.reward_points.is_some());
// Rejected proof with reason
let rejected = SubmitProofResponse {
accepted: false,
proof_id: None,
reward_points: None,
rejection_reason: Some("Invalid signature".to_string()),
};
assert!(!rejected.accepted);
assert!(rejected.rejection_reason.is_some());Fields§
§accepted: boolWhether the proof was accepted.
proof_id: Option<Uuid>Proof ID if accepted.
reward_points: Option<Points>Reward points if accepted.
rejection_reason: Option<String>Rejection reason if not accepted.
Trait Implementations§
Source§impl Clone for SubmitProofResponse
impl Clone for SubmitProofResponse
Source§fn clone(&self) -> SubmitProofResponse
fn clone(&self) -> SubmitProofResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SubmitProofResponse
impl Debug for SubmitProofResponse
Source§impl<'de> Deserialize<'de> for SubmitProofResponse
impl<'de> Deserialize<'de> for SubmitProofResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SubmitProofResponse
impl RefUnwindSafe for SubmitProofResponse
impl Send for SubmitProofResponse
impl Sync for SubmitProofResponse
impl Unpin for SubmitProofResponse
impl UnwindSafe for SubmitProofResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more