Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

set the session context #28

Merged
merged 3 commits into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:
global:
- GOTFLAGS="-race"
matrix:
- BUILD_DEPTYPE=gx
- BUILD_DEPTYPE=gomod


Expand All @@ -24,7 +23,6 @@ script:

cache:
directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod
- $HOME/.cache/go-build

Expand Down
12 changes: 7 additions & 5 deletions blockservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ func NewSession(ctx context.Context, bs BlockService) *Session {
exch := bs.Exchange()
if sessEx, ok := exch.(exchange.SessionExchange); ok {
return &Session{
ses: nil,
sessEx: sessEx,
bs: bs.Blockstore(),
sessCtx: ctx,
ses: nil,
sessEx: sessEx,
bs: bs.Blockstore(),
}
}
return &Session{
ses: exch,
bs: bs.Blockstore(),
ses: exch,
sessCtx: ctx,
bs: bs.Blockstore(),
}
}

Expand Down
5 changes: 4 additions & 1 deletion blockservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ type fakeSessionExchange struct {
session exchange.Fetcher
}

func (fe *fakeSessionExchange) NewSession(context.Context) exchange.Fetcher {
func (fe *fakeSessionExchange) NewSession(ctx context.Context) exchange.Fetcher {
if ctx == nil {
panic("nil context")
}
return fe.session
}
54 changes: 0 additions & 54 deletions package.json

This file was deleted.