@@ -213,6 +213,8 @@ type FSM struct {
213
213
214
214
cfg * Config
215
215
216
+ swapAmtFetcher TotalSwapAmountFetcher
217
+
216
218
// hyperloop contains all the data required for the hyperloop process.
217
219
hyperloop * HyperLoop
218
220
@@ -232,23 +234,25 @@ type FSM struct {
232
234
}
233
235
234
236
// NewFSM creates a new instant out FSM.
235
- func NewFSM (cfg * Config ) (* FSM , error ) {
237
+ func NewFSM (cfg * Config , swapAmtFetcher TotalSwapAmountFetcher ) (* FSM , error ) {
236
238
237
239
hyperloop := & HyperLoop {
238
240
State : fsm .EmptyState ,
239
241
}
240
242
241
- return NewFSMFromHyperloop (cfg , hyperloop )
243
+ return NewFSMFromHyperloop (cfg , hyperloop , swapAmtFetcher )
242
244
}
243
245
244
246
// NewFSMFromHyperloop creates a new instantout FSM from an existing instantout
245
247
// recovered from the database.
246
- func NewFSMFromHyperloop (cfg * Config , hyperloop * HyperLoop ) (* FSM , error ) {
248
+ func NewFSMFromHyperloop (cfg * Config , hyperloop * HyperLoop ,
249
+ swapAmtFetcher TotalSwapAmountFetcher ) (* FSM , error ) {
247
250
248
251
instantOutFSM := & FSM {
249
- cfg : cfg ,
250
- hyperloop : hyperloop ,
251
- spendChan : make (chan * chainntnfs.SpendDetail ),
252
+ cfg : cfg ,
253
+ hyperloop : hyperloop ,
254
+ spendChan : make (chan * chainntnfs.SpendDetail ),
255
+ swapAmtFetcher : swapAmtFetcher ,
252
256
}
253
257
254
258
instantOutFSM .ActionEntryFunc = instantOutFSM .updateHyperloop
0 commit comments