1
1
use std:: str:: FromStr ;
2
2
3
+ use super :: {
4
+ File , PostalAddress ,
5
+ contact:: {
6
+ BillIdentParticipant , LightBillIdentParticipant , LightBillIdentParticipantWithAddress ,
7
+ } ,
8
+ notification:: Notification ,
9
+ } ;
3
10
use crate :: {
4
11
ID_PREFIX , NETWORK_MAINNET , NETWORK_REGTEST , NETWORK_TESTNET , NETWORK_TESTNET4 , NodeId ,
5
12
ValidationError ,
@@ -8,14 +15,7 @@ use crate::{
8
15
network_char,
9
16
util:: { self , BcrKeys } ,
10
17
} ;
11
-
12
- use super :: {
13
- File , PostalAddress ,
14
- contact:: {
15
- BillIdentParticipant , LightBillIdentParticipant , LightBillIdentParticipantWithAddress ,
16
- } ,
17
- notification:: Notification ,
18
- } ;
18
+ use borsh:: { BorshDeserialize , BorshSerialize } ;
19
19
use secp256k1:: { PublicKey , SecretKey } ;
20
20
use serde:: { Deserialize , Serialize } ;
21
21
@@ -110,7 +110,7 @@ impl<'de> serde::Deserialize<'de> for BillId {
110
110
where
111
111
D : serde:: Deserializer < ' de > ,
112
112
{
113
- let s = String :: deserialize ( d) ?;
113
+ let s = <std :: string :: String as serde :: Deserialize > :: deserialize ( d) ?;
114
114
BillId :: from_str ( & s) . map_err ( serde:: de:: Error :: custom)
115
115
}
116
116
}
@@ -611,14 +611,26 @@ pub struct PastPaymentDataRecourse {
611
611
pub status : PastPaymentStatus ,
612
612
}
613
613
614
- #[ derive( Serialize , Deserialize , Debug , Clone ) ]
614
+ #[ derive( BorshSerialize , BorshDeserialize , Serialize , Deserialize , Debug , Clone ) ]
615
615
pub struct BillToShareWithExternalParty {
616
616
/// The bill id
617
617
pub bill_id : BillId ,
618
618
/// The base58 encoded, encrypted BillBlockPlaintextWrapper of the bill
619
619
pub data : String ,
620
+ #[ borsh(
621
+ serialize_with = "crate::util::borsh::serialize_vec_url" ,
622
+ deserialize_with = "crate::util::borsh::deserialize_vec_url"
623
+ ) ]
624
+ /// The file urls of bill files, encrypted with the receiver's key, uploaded to Nostr
625
+ pub file_urls : Vec < url:: Url > ,
620
626
/// The hash over the unencrypted data
621
627
pub hash : String ,
622
628
/// The signature over the hash by the sharer of the bill
623
629
pub signature : String ,
630
+ #[ borsh(
631
+ serialize_with = "crate::util::borsh::serialize_pubkey" ,
632
+ deserialize_with = "crate::util::borsh::deserialize_pubkey"
633
+ ) ]
634
+ /// The receiver's pub key
635
+ pub receiver : PublicKey ,
624
636
}
0 commit comments