3838type API struct {
3939 is * instanceStore
4040 wm ffs.WalletManager
41+ pm ffs.PaychManager
4142
4243 sched * scheduler.Scheduler
4344
@@ -49,7 +50,7 @@ type API struct {
4950}
5051
5152// New returns a new Api instance.
52- func New (ctx context.Context , ds datastore.Datastore , iid ffs.APIID , sch * scheduler.Scheduler , wm ffs.WalletManager , dc ffs.DefaultConfig ) (* API , error ) {
53+ func New (ctx context.Context , ds datastore.Datastore , iid ffs.APIID , sch * scheduler.Scheduler , wm ffs.WalletManager , pm ffs. PaychManager , dc ffs.DefaultConfig ) (* API , error ) {
5354 is := newInstanceStore (namespace .Wrap (ds , datastore .NewKey ("istore" )))
5455
5556 addr , err := wm .NewAddress (ctx , defaultAddressType )
@@ -76,28 +77,29 @@ func New(ctx context.Context, ds datastore.Datastore, iid ffs.APIID, sch *schedu
7677 }
7778
7879 ctx , cancel := context .WithCancel (context .Background ())
79- i := new (ctx , is , wm , config , sch , cancel )
80+ i := new (ctx , is , wm , pm , config , sch , cancel )
8081 if err := i .is .putConfig (config ); err != nil {
8182 return nil , fmt .Errorf ("saving new instance %s: %s" , i .cfg .ID , err )
8283 }
8384 return i , nil
8485}
8586
8687// Load loads a saved Api instance from its ConfigStore.
87- func Load (ds datastore.Datastore , iid ffs.APIID , sched * scheduler.Scheduler , wm ffs.WalletManager ) (* API , error ) {
88+ func Load (ds datastore.Datastore , iid ffs.APIID , sched * scheduler.Scheduler , wm ffs.WalletManager , pm ffs. PaychManager ) (* API , error ) {
8889 is := newInstanceStore (namespace .Wrap (ds , datastore .NewKey ("istore" )))
8990 c , err := is .getConfig ()
9091 if err != nil {
9192 return nil , fmt .Errorf ("loading instance: %s" , err )
9293 }
9394 ctx , cancel := context .WithCancel (context .Background ())
94- return new (ctx , is , wm , c , sched , cancel ), nil
95+ return new (ctx , is , wm , pm , c , sched , cancel ), nil
9596}
9697
97- func new (ctx context.Context , is * instanceStore , wm ffs.WalletManager , config Config , sch * scheduler.Scheduler , cancel context.CancelFunc ) * API {
98+ func new (ctx context.Context , is * instanceStore , wm ffs.WalletManager , pm ffs. PaychManager , config Config , sch * scheduler.Scheduler , cancel context.CancelFunc ) * API {
9899 i := & API {
99100 is : is ,
100101 wm : wm ,
102+ pm : pm ,
101103 cfg : config ,
102104 sched : sch ,
103105 cancel : cancel ,
0 commit comments