|
@@ -26,6 +26,8 @@
|
|
|
//! the necessary objects provided by the caller. This is intentional, so we
|
|
//! the necessary objects provided by the caller. This is intentional, so we
|
|
|
//! are able to abstract away any wallet interfaces to client implementations.
|
|
//! are able to abstract away any wallet interfaces to client implementations.
|
|
|
|
|
|
|
|
|
|
+use std::hash::{Hash, Hasher};
|
|
|
|
|
+
|
|
|
use darkfi_sdk::{
|
|
use darkfi_sdk::{
|
|
|
bridgetree,
|
|
bridgetree,
|
|
|
crypto::{BaseBlind, Blind, FuncId, ScalarBlind, SecretKey},
|
|
crypto::{BaseBlind, Blind, FuncId, ScalarBlind, SecretKey},
|
|
@@ -103,6 +105,12 @@ pub struct OwnCoin {
|
|
|
pub leaf_position: bridgetree::Position,
|
|
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(
|
|
pub fn compute_remainder_blind(
|
|
|
clear_inputs: &[crate::model::ClearInput],
|
|
clear_inputs: &[crate::model::ClearInput],
|
|
|
input_blinds: &[ScalarBlind],
|
|
input_blinds: &[ScalarBlind],
|