mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 07:08:05 -05:00
contract/money: Implement std::hash::Hash for OwnCoin
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
//! the necessary objects provided by the caller. This is intentional, so we
|
||||
//! are able to abstract away any wallet interfaces to client implementations.
|
||||
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
use darkfi_sdk::{
|
||||
bridgetree,
|
||||
crypto::{BaseBlind, Blind, FuncId, ScalarBlind, SecretKey},
|
||||
@@ -103,6 +105,12 @@ pub struct OwnCoin {
|
||||
pub leaf_position: bridgetree::Position,
|
||||
}
|
||||
|
||||
impl Hash for OwnCoin {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.coin.inner().to_repr().hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compute_remainder_blind(
|
||||
clear_inputs: &[crate::model::ClearInput],
|
||||
input_blinds: &[ScalarBlind],
|
||||
|
||||
Reference in New Issue
Block a user