1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 18:13:54 +08:00

refactor: context first in argument list

(merely by convention)

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow
2014-12-16 20:52:30 -08:00
committed by Juan Batiz-Benet
parent f66d94aaf1
commit 10e970c0cf
3 changed files with 4 additions and 3 deletions

View File

@ -56,7 +56,7 @@ func New(parent context.Context, p peer.Peer, network bsnet.BitSwapNetwork, rout
blockstore: bstore,
cancelFunc: cancelFunc,
notifications: notif,
ledgermanager: strategy.NewLedgerManager(bstore, ctx),
ledgermanager: strategy.NewLedgerManager(ctx, bstore),
routing: routing,
sender: network,
wantlist: wl.New(),

View File

@ -34,7 +34,7 @@ type LedgerManager struct {
workSignal chan struct{}
}
func NewLedgerManager(bs bstore.Blockstore, ctx context.Context) *LedgerManager {
func NewLedgerManager(ctx context.Context, bs bstore.Blockstore) *LedgerManager {
lm := &LedgerManager{
ledgerMap: make(ledgerMap),
bs: bs,

View File

@ -23,7 +23,8 @@ func newPeerAndLedgermanager(idStr string) peerAndLedgermanager {
return peerAndLedgermanager{
Peer: testutil.NewPeerWithIDString(idStr),
//Strategy: New(true),
ls: NewLedgerManager(blockstore.NewBlockstore(sync.MutexWrap(ds.NewMapDatastore())), context.TODO()),
ls: NewLedgerManager(context.TODO(),
blockstore.NewBlockstore(sync.MutexWrap(ds.NewMapDatastore()))),
}
}