@@ -2,12 +2,13 @@ use alloy::primitives::Uint;
2
2
use derive_more:: { Deref , DerefMut } ;
3
3
use hex:: { self , FromHexError } ;
4
4
use rand:: { Rng , RngCore } ;
5
+ use serde:: { Deserialize , Serialize } ;
5
6
use std:: { fmt:: Debug , hash:: Hash } ;
6
7
use thiserror:: Error ;
7
8
8
9
use crate :: bridge_contracts:: { BridgeContractCounterpartyError , BridgeContractInitiatorError } ;
9
10
10
- #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash ) ]
11
+ #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash , Deserialize , Serialize ) ]
11
12
pub struct BridgeTransferId < H > ( pub H ) ;
12
13
13
14
impl < H > BridgeTransferId < H > {
55
56
}
56
57
}
57
58
58
- #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash ) ]
59
+ #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
59
60
pub struct InitiatorAddress < A > ( pub A ) ;
60
61
61
62
impl From < & str > for InitiatorAddress < Vec < u8 > > {
@@ -70,7 +71,7 @@ impl From<String> for InitiatorAddress<Vec<u8>> {
70
71
}
71
72
}
72
73
73
- #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash ) ]
74
+ #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash , Deserialize , Serialize ) ]
74
75
pub struct RecipientAddress < A > ( pub A ) ;
75
76
76
77
impl From < & str > for RecipientAddress < Vec < u8 > > {
@@ -85,7 +86,7 @@ pub struct RecipientAddressCounterparty<A>(pub A);
85
86
#[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash ) ]
86
87
pub struct InitiatorAddressCounterParty ( pub Vec < u8 > ) ;
87
88
88
- #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash ) ]
89
+ #[ derive( Deref , Debug , Clone , PartialEq , Eq , Hash , Deserialize , Serialize ) ]
89
90
pub struct HashLock < H > ( pub H ) ;
90
91
91
92
impl < H > HashLock < H > {
@@ -107,7 +108,7 @@ pub fn convert_hash_lock<H: From<O>, O>(other: HashLock<O>) -> HashLock<H> {
107
108
HashLock ( From :: from ( other. 0 ) )
108
109
}
109
110
110
- #[ derive( Deref , Debug , Clone , PartialEq , Eq ) ]
111
+ #[ derive( Deref , Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
111
112
pub struct HashLockPreImage ( pub Vec < u8 > ) ;
112
113
113
114
impl AsRef < [ u8 ] > for HashLockPreImage {
@@ -126,7 +127,7 @@ impl HashLockPreImage {
126
127
}
127
128
}
128
129
129
- #[ derive( Deref , Debug , Clone , PartialEq , Eq ) ]
130
+ #[ derive( Deref , Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
130
131
pub struct TimeLock ( pub u64 ) ;
131
132
132
133
impl From < Uint < 256 , 4 > > for TimeLock {
@@ -137,7 +138,7 @@ impl From<Uint<256, 4>> for TimeLock {
137
138
}
138
139
}
139
140
140
- #[ derive( Deref , DerefMut , Debug , Clone , Copy , PartialEq , Eq ) ]
141
+ #[ derive( Deref , DerefMut , Debug , Clone , Copy , PartialEq , Eq , Serialize , Deserialize ) ]
141
142
pub struct Amount ( pub u64 ) ;
142
143
143
144
impl From < Uint < 256 , 4 > > for Amount {
@@ -174,7 +175,7 @@ pub struct LockDetails<A, H> {
174
175
pub amount : Amount ,
175
176
}
176
177
177
- #[ derive( Debug , PartialEq , Eq , Clone ) ]
178
+ #[ derive( Debug , PartialEq , Eq , Clone , Serialize , Deserialize ) ]
178
179
pub struct CounterpartyCompletedDetails < A , H > {
179
180
pub bridge_transfer_id : BridgeTransferId < H > ,
180
181
pub initiator_address : InitiatorAddress < Vec < u8 > > ,
0 commit comments