-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mock for p2p and contract_client
- Loading branch information
Showing
5 changed files
with
182 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
pub mod contract_client; | ||
pub mod job; | ||
pub mod p2p; | ||
|
||
#[cfg(test)] | ||
pub mod test { | ||
type Func<T> = Box<dyn Fn() -> T + Send + Sync + 'static>; | ||
pub struct Expectation<T> { | ||
func: Option<Func<T>>, | ||
} | ||
|
||
impl<T> Expectation<T> { | ||
pub fn new() -> Self { | ||
Self { func: None } | ||
} | ||
|
||
pub fn func(self) -> Option<Func<T>> { | ||
self.func | ||
} | ||
|
||
pub fn _returns(&mut self, func: Func<T>) { | ||
self.func = Some(func); | ||
} | ||
} | ||
} |
Oops, something went wrong.