Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
staszek-krotki committed Jun 30, 2023
1 parent e4765e8 commit fb26018
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/payment/src/models/agreement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,29 @@ pub type ReadObj = WriteObj;

#[cfg(test)]
mod tests {
use std::ops::Add;
use crate::models::agreement::WriteObj;
use chrono::{Duration, Utc};
use serde_json::json;
use ya_client_model::market::{Agreement, Demand, Offer};
use std::ops::Add;
use ya_client_model::market::agreement::State;
use ya_client_model::market::{Agreement, Demand, Offer};
use ya_persistence::types::Role;
use crate::models::agreement::WriteObj;

fn mock_agreement_with_demand_properties(properties: serde_json::Value) -> Agreement {
let demand = Demand::new(
properties,
"()".to_string(),
"demand_id".to_string(),
Default::default(),
Default::default()
Default::default(),
);

let offer = Offer::new(
json!({}),
"()".to_string(),
"offer_id".to_string(),
Default::default(),
Default::default()
Default::default(),
);

Agreement::new(
Expand All @@ -119,11 +119,11 @@ mod tests {
#[test]
fn create_agreement_with_valid_chosen_platform() {
let agreement = mock_agreement_with_demand_properties(json!({
"golem.com.payment.chosen-platform": "test-network"
}));
"golem.com.payment.chosen-platform": "test-network"
}));
let role: Role = Role::Provider;

let result = WriteObj::new(agreement, role);
assert_eq!(result.payment_platform, "test-network");
}
}
}

0 comments on commit fb26018

Please sign in to comment.