@@ -146,10 +146,11 @@ impl<L: Deref> GossipPersister<L> where L::Target: Logger {
146
146
let mut update_signed = Vec :: new ( ) ;
147
147
update. write ( & mut update_signed) . unwrap ( ) ;
148
148
149
- tokio :: time :: timeout ( POSTGRES_INSERT_TIMEOUT , client
150
- . execute ( "INSERT INTO channel_updates (\
149
+ let insertion_statement = if cfg ! ( test ) {
150
+ "INSERT INTO channel_updates (\
151
151
short_channel_id, \
152
152
timestamp, \
153
+ seen, \
153
154
channel_flags, \
154
155
direction, \
155
156
disable, \
@@ -159,9 +160,33 @@ impl<L: Deref> GossipPersister<L> where L::Target: Logger {
159
160
fee_proportional_millionths, \
160
161
htlc_maximum_msat, \
161
162
blob_signed \
162
- ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) ON CONFLICT DO NOTHING", & [
163
+ ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) ON CONFLICT DO NOTHING"
164
+ } else {
165
+ "INSERT INTO channel_updates (\
166
+ short_channel_id, \
167
+ timestamp, \
168
+ channel_flags, \
169
+ direction, \
170
+ disable, \
171
+ cltv_expiry_delta, \
172
+ htlc_minimum_msat, \
173
+ fee_base_msat, \
174
+ fee_proportional_millionths, \
175
+ htlc_maximum_msat, \
176
+ blob_signed \
177
+ ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) ON CONFLICT DO NOTHING"
178
+ } ;
179
+
180
+ // this may not be used outside test cfg
181
+ #[ cfg( test) ]
182
+ let system_time: std:: time:: SystemTime = std:: time:: UNIX_EPOCH + Duration :: from_secs ( timestamp as u64 ) ;
183
+
184
+ tokio:: time:: timeout ( POSTGRES_INSERT_TIMEOUT , client
185
+ . execute ( insertion_statement, & [
163
186
& scid,
164
187
& timestamp,
188
+ #[ cfg( test) ]
189
+ & system_time,
165
190
& ( update. contents . flags as i16 ) ,
166
191
& direction,
167
192
& disable,
0 commit comments