@@ -21,7 +21,9 @@ import (
21
21
)
22
22
23
23
var (
24
- CoinPkScript , _ = hex .DecodeString ("001431df1bde03c074d0cf21ea2529427e1499b8f1de" )
24
+ CoinPkScript , _ = hex .DecodeString (
25
+ "001431df1bde03c074d0cf21ea2529427e1499b8f1de" ,
26
+ )
25
27
)
26
28
27
29
// mockWalletController is a mock implementation of the WalletController
@@ -50,6 +52,7 @@ func (w *mockWalletController) FetchInputInfo(
50
52
Confirmations : 1 ,
51
53
OutPoint : * prevOut ,
52
54
}
55
+
53
56
return utxo , nil
54
57
}
55
58
@@ -74,8 +77,10 @@ func (w *mockWalletController) NewAddress(AddressType, bool,
74
77
string ) (btcutil.Address , error ) {
75
78
76
79
addr , _ := btcutil .NewAddressPubKey (
77
- w .RootKey .PubKey ().SerializeCompressed (), & chaincfg .MainNetParams ,
80
+ w .RootKey .PubKey ().SerializeCompressed (),
81
+ & chaincfg .MainNetParams ,
78
82
)
83
+
79
84
return addr , nil
80
85
}
81
86
@@ -176,6 +181,7 @@ func (w *mockWalletController) ListUnspentWitness(int32, int32,
176
181
atomic .AddUint32 (& w .index , 1 )
177
182
var ret []* Utxo
178
183
ret = append (ret , utxo )
184
+
179
185
return ret , nil
180
186
}
181
187
@@ -200,19 +206,21 @@ func (w *mockWalletController) LeaseOutput(wtxmgr.LockID, wire.OutPoint,
200
206
}
201
207
202
208
// ReleaseOutput currently does nothing.
203
- func (w * mockWalletController ) ReleaseOutput (wtxmgr.LockID , wire.OutPoint ) error {
209
+ func (w * mockWalletController ) ReleaseOutput (wtxmgr.LockID ,
210
+ wire.OutPoint ) error {
211
+
204
212
return nil
205
213
}
206
214
207
- func (w * mockWalletController ) ListLeasedOutputs () ([]* base.ListLeasedOutputResult ,
215
+ func (w * mockWalletController ) ListLeasedOutputs () ([]* base.ListLeasedOutputResult , //nolint:lll
208
216
error ) {
209
217
210
218
return nil , nil
211
219
}
212
220
213
221
// FundPsbt currently does nothing.
214
- func (w * mockWalletController ) FundPsbt (* psbt.Packet , int32 , chainfee. SatPerKWeight ,
215
- string , * waddrmgr.KeyScope ) (int32 , error ) {
222
+ func (w * mockWalletController ) FundPsbt (* psbt.Packet , int32 ,
223
+ chainfee. SatPerKWeight , string , * waddrmgr.KeyScope ) (int32 , error ) {
216
224
217
225
return 0 , nil
218
226
}
@@ -228,7 +236,9 @@ func (w *mockWalletController) FinalizePsbt(_ *psbt.Packet, _ string) error {
228
236
}
229
237
230
238
// PublishTransaction sends a transaction to the PublishedTransactions chan.
231
- func (w * mockWalletController ) PublishTransaction (tx * wire.MsgTx , _ string ) error {
239
+ func (w * mockWalletController ) PublishTransaction (tx * wire.MsgTx ,
240
+ _ string ) error {
241
+
232
242
w .PublishedTransactions <- tx
233
243
return nil
234
244
}
@@ -286,7 +296,8 @@ type mockChainNotifier struct {
286
296
// that the tx confirmation will go over.
287
297
func (c * mockChainNotifier ) RegisterConfirmationsNtfn (txid * chainhash.Hash ,
288
298
pkScript []byte , numConfs , heightHint uint32 ,
289
- opts ... chainntnfs.NotifierOption ) (* chainntnfs.ConfirmationEvent , error ) {
299
+ opts ... chainntnfs.NotifierOption ) (* chainntnfs.ConfirmationEvent ,
300
+ error ) {
290
301
291
302
return & chainntnfs.ConfirmationEvent {
292
303
Confirmed : c .ConfChan ,
@@ -307,8 +318,9 @@ func (c *mockChainNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
307
318
308
319
// RegisterBlockEpochNtfn returns a BlockEpochEvent that contains a channel that
309
320
// block epochs will go over.
310
- func (c * mockChainNotifier ) RegisterBlockEpochNtfn (blockEpoch * chainntnfs.BlockEpoch ) (
311
- * chainntnfs.BlockEpochEvent , error ) {
321
+ func (c * mockChainNotifier ) RegisterBlockEpochNtfn (
322
+ blockEpoch * chainntnfs.BlockEpoch ) (* chainntnfs.BlockEpochEvent ,
323
+ error ) {
312
324
313
325
return & chainntnfs.BlockEpochEvent {
314
326
Epochs : c .EpochChan ,
@@ -339,13 +351,16 @@ func (*mockChainIO) GetBestBlock() (*chainhash.Hash, int32, error) {
339
351
340
352
func (* mockChainIO ) GetUtxo (op * wire.OutPoint , _ []byte ,
341
353
heightHint uint32 , _ <- chan struct {}) (* wire.TxOut , error ) {
354
+
342
355
return nil , nil
343
356
}
344
357
345
358
func (* mockChainIO ) GetBlockHash (blockHeight int64 ) (* chainhash.Hash , error ) {
346
359
return nil , nil
347
360
}
348
361
349
- func (* mockChainIO ) GetBlock (blockHash * chainhash.Hash ) (* wire.MsgBlock , error ) {
362
+ func (* mockChainIO ) GetBlock (blockHash * chainhash.Hash ) (* wire.MsgBlock ,
363
+ error ) {
364
+
350
365
return nil , nil
351
366
}
0 commit comments