Skip to content

Commit

Permalink
Accomodate signer
Browse files Browse the repository at this point in the history
  • Loading branch information
George Danezis committed Feb 8, 2022
1 parent ef0c7ec commit 8a5a772
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions fastpay_core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::{
///
/// Typically instantiated with Box::pin(keypair) where keypair is a `KeyPair`
///
type StableSyncSigner = Pin<Box<dyn signature::Signer<ed25519_dalek::Signature> + Send + Sync>>;
pub type StableSyncSigner = Pin<Box<dyn signature::Signer<ed25519_dalek::Signature> + Send + Sync>>;

pub mod client_store;
use self::client_store::ClientStore;
Expand Down Expand Up @@ -237,8 +237,8 @@ impl<A> ClientState<A> {
}

#[cfg(test)]
pub fn secret(&self) -> &KeyPair {
&self.secret
pub fn secret(&self) -> &dyn signature::Signer<ed25519_dalek::Signature> {
&*self.secret
}

/// Given an order, return the list of certificates that are known by this client
Expand Down
10 changes: 5 additions & 5 deletions fastpay_core/src/unit_tests/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async fn extract_cert(
#[cfg(test)]
fn order_create(
src: FastPayAddress,
secret: &KeyPair,
secret: &dyn signature::Signer<ed25519_dalek::Signature>,
dest: FastPayAddress,
value: u64,
framework_obj_ref: ObjectRef,
Expand All @@ -159,14 +159,14 @@ fn order_create(
Vec::new(),
pure_arguments,
GAS_VALUE_FOR_TESTING / 2,
secret,
&*secret,
)
}

#[cfg(test)]
fn order_transfer(
src: FastPayAddress,
secret: &KeyPair,
secret: &dyn signature::Signer<ed25519_dalek::Signature>,
dest: FastPayAddress,
object_ref: ObjectRef,
framework_obj_ref: ObjectRef,
Expand All @@ -192,7 +192,7 @@ fn order_transfer(
#[cfg(test)]
fn order_set(
src: FastPayAddress,
secret: &KeyPair,
secret: &dyn signature::Signer<ed25519_dalek::Signature>,
object_ref: ObjectRef,
value: u64,
framework_obj_ref: ObjectRef,
Expand All @@ -217,7 +217,7 @@ fn order_set(
#[cfg(test)]
fn order_delete(
src: FastPayAddress,
secret: &KeyPair,
secret: &dyn signature::Signer<ed25519_dalek::Signature>,
object_ref: ObjectRef,
framework_obj_ref: ObjectRef,
gas_object_ref: ObjectRef,
Expand Down

0 comments on commit 8a5a772

Please sign in to comment.