Skip to content

Commit 9707564

Browse files
committed
payment: add deposit validation
* also chrono fix
1 parent 8f807a6 commit 9707564

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

examples/market_interaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ async fn requestor_interact(options: Options, nanos: u32) -> Result<()> {
230230
let new_agreement_id = proposal_id.clone();
231231
let agreement = AgreementProposal::new(
232232
new_agreement_id,
233-
chrono::Utc::now() + chrono::Duration::try_minutes(5).unwrap(),
233+
chrono::Utc::now() + chrono::Duration::minutes(5),
234234
);
235235
let agreement_id = client.create_agreement(&agreement).await?;
236236
println!(

model/src/payment/allocation.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
use std::collections::HashMap;
2+
13
use bigdecimal::BigDecimal;
24
use chrono::{DateTime, Utc};
35
use serde::{Deserialize, Serialize};
46

7+
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8+
pub struct ValidateDepositCall {
9+
#[serde(flatten)]
10+
pub arguments: HashMap<String, String>,
11+
}
12+
513
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
614
pub struct Deposit {
715
pub id: String,
816
pub contract: String,
17+
pub validate: Option<ValidateDepositCall>,
918
}
1019

1120
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]

specs/payment-api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,8 @@ components:
12241224
type: string
12251225
contract:
12261226
type: string
1227+
validate:
1228+
type: object
12271229
required:
12281230
- id
12291231
- contract

0 commit comments

Comments
 (0)