-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Trade Engine Specific message test to test_simple
- Loading branch information
1 parent
e35818c
commit 8077169
Showing
4 changed files
with
117 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod maker_testers; | ||
pub mod relay; | ||
pub mod taker_testers; | ||
pub mod test_trade_msgs; |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::any::Any; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
use crusty_n3xb::common::types::SerdeGenericTrait; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub(crate) struct SomeTradeEngMsg { | ||
pub(crate) some_trade_specific_field: String, | ||
} | ||
|
||
#[typetag::serde(name = "some-trade-eng-msg")] | ||
impl SerdeGenericTrait for SomeTradeEngMsg { | ||
fn any_ref(&self) -> &dyn Any { | ||
self | ||
} | ||
} | ||
|
||
impl SomeTradeEngMsg { | ||
pub(crate) fn some_trade_specific_string() -> String { | ||
"SomeTradeSpecificString".to_string() | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub(crate) struct AnotherTradeEngMsg { | ||
pub(crate) another_trade_specific_field: String, | ||
} | ||
|
||
#[typetag::serde(name = "another-trade-eng-msg")] | ||
impl SerdeGenericTrait for AnotherTradeEngMsg { | ||
fn any_ref(&self) -> &dyn Any { | ||
self | ||
} | ||
} | ||
|
||
impl AnotherTradeEngMsg { | ||
pub(crate) fn another_trade_specific_string() -> String { | ||
"AnotherTradeSpecificString".to_string() | ||
} | ||
} |