Skip to content

Commit

Permalink
Merge pull request #61 from arkanoider/token-dispute
Browse files Browse the repository at this point in the history
Additions to have dispute tokens
  • Loading branch information
grunch authored Aug 30, 2024
2 parents 423444c + 9e0d516 commit 3067c8e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mostro-core"
version = "0.6.5"
version = "0.6.6"
edition = "2021"
license = "MIT"
authors = ["Francisco Calderón <[email protected]>"]
Expand Down
4 changes: 4 additions & 0 deletions src/dispute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ pub struct Dispute {
pub solver_pubkey: Option<String>,
pub created_at: i64,
pub taken_at: i64,
pub buyer_token: Option<u16>,
pub seller_token: Option<u16>,
}

impl Dispute {
Expand All @@ -73,6 +75,8 @@ impl Dispute {
solver_pubkey: None,
created_at: Utc::now().timestamp(),
taken_at: 0,
buyer_token: None,
seller_token: None,
}
}
}
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ mod test {
None,
Some(1627371434),
None,
None,
None,
))),
));
let sample_message = r#"{"order":{"version":1,"id":"308e1272-d5f4-47e6-bd97-3504baea9c23","pubkey":null,"action":"new-order","content":{"order":{"id":"308e1272-d5f4-47e6-bd97-3504baea9c23","kind":"sell","status":"pending","amount":100,"fiat_code":"eur","fiat_amount":100,"payment_method":"SEPA","premium":1,"created_at":1627371434}}}}"#;
Expand Down Expand Up @@ -87,6 +89,8 @@ mod test {
None,
Some(1627371434),
None,
None,
None
)),
"lnbcrt78510n1pj59wmepp50677g8tffdqa2p8882y0x6newny5vtz0hjuyngdwv226nanv4uzsdqqcqzzsxqyz5vqsp5skn973360gp4yhlpmefwvul5hs58lkkl3u3ujvt57elmp4zugp4q9qyyssqw4nzlr72w28k4waycf27qvgzc9sp79sqlw83j56txltz4va44j7jda23ydcujj9y5k6k0rn5ms84w8wmcmcyk5g3mhpqepf7envhdccp72nz6e".to_string(),
None,
Expand Down
2 changes: 1 addition & 1 deletion src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub enum Content {
Peer(Peer),
RatingUser(u8),
Amount(Amount),
Dispute(Uuid),
Dispute(Uuid, Option<u16>),
}

#[allow(dead_code)]
Expand Down
8 changes: 8 additions & 0 deletions src/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ impl Order {
self.buyer_invoice.clone(),
Some(self.created_at),
Some(self.expires_at),
None,
None,
)
}

Expand Down Expand Up @@ -194,6 +196,8 @@ pub struct SmallOrder {
pub buyer_invoice: Option<String>,
pub created_at: Option<i64>,
pub expires_at: Option<i64>,
pub buyer_token: Option<u16>,
pub seller_token: Option<u16>,
}

#[allow(dead_code)]
Expand All @@ -215,6 +219,8 @@ impl SmallOrder {
buyer_invoice: Option<String>,
created_at: Option<i64>,
expires_at: Option<i64>,
buyer_token: Option<u16>,
seller_token: Option<u16>,
) -> Self {
Self {
id,
Expand All @@ -232,6 +238,8 @@ impl SmallOrder {
buyer_invoice,
created_at,
expires_at,
buyer_token,
seller_token,
}
}
/// New order from json string
Expand Down

0 comments on commit 3067c8e

Please sign in to comment.