Skip to content

Commit

Permalink
Merge pull request #1075 from rainlanguage/2024-11-12-ob-yaml-token
Browse files Browse the repository at this point in the history
Implementing token in OrderbookYaml
  • Loading branch information
hardyjosh authored Dec 15, 2024
2 parents ea7c9cf + c9f845f commit 6944bd9
Show file tree
Hide file tree
Showing 6 changed files with 316 additions and 8 deletions.
18 changes: 18 additions & 0 deletions crates/common/src/add_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,26 @@ price: 2e18;
deployer: deployer_arc.clone(),
};
let token1 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
label: None,
symbol: Some("Token1".to_string()),
};
let token2 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
label: None,
symbol: Some("Token2".to_string()),
};
let token3 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
Expand Down Expand Up @@ -551,20 +557,26 @@ _ _: 0 0;
deployer: deployer_arc.clone(),
};
let token1 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
label: None,
symbol: Some("Token1".to_string()),
};
let token2 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
label: None,
symbol: Some("Token2".to_string()),
};
let token3 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
Expand Down Expand Up @@ -684,20 +696,26 @@ _ _: 0 0;
deployer: deployer_arc.clone(),
};
let token1 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
label: None,
symbol: Some("Token1".to_string()),
};
let token2 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
label: None,
symbol: Some("Token2".to_string()),
};
let token3 = Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
address: Address::default(),
network: network_arc.clone(),
decimals: Some(18),
Expand Down
2 changes: 2 additions & 0 deletions crates/settings/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ pub fn mock_orderbook() -> Arc<Orderbook> {
// Helper function to create a mock token
pub fn mock_token(name: &str) -> Arc<Token> {
Arc::new(Token {
document: Arc::new(RwLock::new(StrictYaml::String("".to_string()))),
key: "".to_string(),
label: Some(name.into()),
address: Address::repeat_byte(0x05),
symbol: Some("TKN".into()),
Expand Down
Loading

0 comments on commit 6944bd9

Please sign in to comment.