Commit 997165aa authored by Brian Tiger Chow's avatar Brian Tiger Chow Committed by Juan Batiz-Benet

refactor: context first in argument list

(merely by convention)

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 2b07d00f
......@@ -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(),
......
......@@ -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,
......
......@@ -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()))),
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment