@@ -9,24 +9,44 @@ use common::messages::Fill;
9
9
10
10
#[ derive( Debug , AnchorSerialize , AnchorDeserialize , Clone , Copy , InitSpace ) ]
11
11
pub struct FastFillInfo {
12
+ /// Who paid the lamports to create the [FastFill] account.
13
+ pub prepared_by : Pubkey ,
14
+
15
+ /// Fill amount.
12
16
pub amount : u64 ,
17
+
18
+ /// Authority allowed to redeem [FastFill].
13
19
pub redeemer : Pubkey ,
20
+
21
+ /// Timestamp at the time a fill was issued. When the fast fill is created, it is set using the
22
+ /// current [Clock] unix timestamp.
23
+ pub timestamp : i64 ,
14
24
}
15
25
16
26
#[ derive( Debug , AnchorSerialize , AnchorDeserialize , Clone , Copy , InitSpace ) ]
17
27
pub struct FastFillSeeds {
28
+ /// Wormhole chain ID reflecting where the order was created.
18
29
pub source_chain : u16 ,
30
+
31
+ /// Universal address of the order sender.
19
32
pub order_sender : [ u8 ; 32 ] ,
33
+
34
+ /// Sequence generated by the [FastFillSequencer](crate::state::FastFillSequencer) when it
35
+ /// reserved a sequence number for this fill.
20
36
pub sequence : u64 ,
37
+
38
+ /// Bump seed for the [FastFill] account.
21
39
pub bump : u8 ,
22
40
}
23
41
24
42
#[ account]
25
43
#[ derive( Debug ) ]
26
44
pub struct FastFill {
27
45
pub seeds : FastFillSeeds ,
28
- pub prepared_by : Pubkey ,
46
+
47
+ /// Whether the [FastFill] has been redeemed via the local Token Router.
29
48
pub redeemed : bool ,
49
+
30
50
pub info : FastFillInfo ,
31
51
pub redeemer_message : Vec < u8 > ,
32
52
}
@@ -37,7 +57,6 @@ impl FastFill {
37
57
pub ( crate ) fn checked_compute_size ( redeemer_message_len : usize ) -> Option < usize > {
38
58
const FIXED : usize = 8 // DISCRIMINATOR
39
59
+ FastFillSeeds :: INIT_SPACE
40
- + 32 // prepared_by
41
60
+ 1 // redeemed
42
61
+ FastFillInfo :: INIT_SPACE
43
62
+ 4 // redeemer_message len
@@ -62,11 +81,12 @@ impl FastFill {
62
81
sequence,
63
82
bump,
64
83
} ,
65
- prepared_by,
66
84
redeemed : Default :: default ( ) ,
67
85
info : FastFillInfo {
86
+ prepared_by,
68
87
amount,
69
88
redeemer : Pubkey :: from ( redeemer) ,
89
+ timestamp : Clock :: get ( ) . unwrap ( ) . unix_timestamp ,
70
90
} ,
71
91
redeemer_message : redeemer_message. into ( ) ,
72
92
}
0 commit comments