Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-blockservice
Commits
d582f74c
Unverified
Commit
d582f74c
authored
Mar 23, 2020
by
Steven Allen
Committed by
GitHub
Mar 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #52 from ipfs/fix/circleci-badge
fix ci badge and lints
parents
10a87bf0
2bb63900
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
13 deletions
+22
-13
README.md
README.md
+1
-1
blockservice_test.go
blockservice_test.go
+16
-5
go.sum
go.sum
+1
-6
test/blocks_test.go
test/blocks_test.go
+4
-1
No files found.
README.md
View file @
d582f74c
...
...
@@ -5,7 +5,7 @@ go-blockservice
[
![
](
https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square
)
](http://ipfs.io/)
[
![
](
https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square
)
](http://webchat.freenode.net/?channels=%23ipfs)
[
![Coverage Status
](
https://codecov.io/gh/ipfs/go-block-format/branch/master/graph/badge.svg
)
](https://codecov.io/gh/ipfs/go-block-format/branch/master)
[
![
Travis CI
](
https://
travis-
ci.com/ipfs/go-blockservice.svg?
branch=master
)
](https://
travis-
ci.com/ipfs/go-blockservice)
[
![
Build Status
](
https://
circle
ci.com/
gh/
ipfs/go-blockservice.svg?
style=svg
)
](https://
circle
ci.com/
gh/
ipfs/go-blockservice)
> go-blockservice provides a seamless interface to both local and remote storage backends.
...
...
blockservice_test.go
View file @
d582f74c
...
...
@@ -26,12 +26,18 @@ func TestWriteThroughWorks(t *testing.T) {
block
:=
bgen
.
Next
()
t
.
Logf
(
"PutCounter: %d"
,
bstore
.
PutCounter
)
bserv
.
AddBlock
(
block
)
err
:=
bserv
.
AddBlock
(
block
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
bstore
.
PutCounter
!=
1
{
t
.
Fatalf
(
"expected just one Put call, have: %d"
,
bstore
.
PutCounter
)
}
bserv
.
AddBlock
(
block
)
err
=
bserv
.
AddBlock
(
block
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
bstore
.
PutCounter
!=
2
{
t
.
Fatalf
(
"Put should have called again, should be 2 is: %d"
,
bstore
.
PutCounter
)
}
...
...
@@ -52,10 +58,15 @@ func TestLazySessionInitialization(t *testing.T) {
bgen
:=
butil
.
NewBlockGenerator
()
block
:=
bgen
.
Next
()
bstore
.
Put
(
block
)
err
:=
bstore
.
Put
(
block
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
block2
:=
bgen
.
Next
()
session
.
HasBlock
(
block2
)
err
=
session
.
HasBlock
(
block2
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
bsession
:=
NewSession
(
ctx
,
bservSessEx
)
if
bsession
.
ses
!=
nil
{
...
...
go.sum
View file @
d582f74c
...
...
@@ -48,8 +48,6 @@ github.com/gxed/hashland/murmur3 v0.0.1 h1:SheiaIt0sda5K+8FLz952/1iWS9zrnKsEJaOJ
github.com/gxed/hashland/murmur3
v0.0.1/go.mod h1:
KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48=
github.com/hashicorp/golang-lru
v0.5.1 h1:
0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru
v0.5.1/go.mod h1:
/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru
v0.5.3 h1:
YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk=
github.com/hashicorp/golang-lru
v0.5.3/go.mod h1:
iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru
v0.5.4 h1:
YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru
v0.5.4/go.mod h1:
iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hpcloud/tail
v1.0.0 h1:
nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
...
...
@@ -70,8 +68,7 @@ github.com/ipfs/go-cid v0.0.1 h1:GBjWPktLnNyX0JiQCNFpUuUSoMw5KMyqrsejHYlILBE=
github.com/ipfs/go-cid
v0.0.1/go.mod h1:
GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid
v0.0.2 h1:
tuuKaZPU1M6HcejsO3AcYWW8sZ8MTvyxfc4uqB4eFE8=
github.com/ipfs/go-cid
v0.0.2/go.mod h1:
GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid
v0.0.3 h1:
UIAh32wymBpStoe83YCzwVQQ5Oy/H0FdxvUS6DJDzms=
github.com/ipfs/go-cid
v0.0.3/go.mod h1:
GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid
v0.0.4/go.mod h1:
4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M=
github.com/ipfs/go-cid
v0.0.5 h1:
o0Ix8e/ql7Zb5UVUJEUfjsWCIY8t48++9lR8qi6oiJU=
github.com/ipfs/go-cid
v0.0.5/go.mod h1:
plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog=
github.com/ipfs/go-datastore
v0.0.1 h1:
AW/KZCScnBWlSb5JbnEnLKFWXL224LBEh/9KXXOrUms=
...
...
@@ -88,8 +85,6 @@ github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjv
github.com/ipfs/go-ds-leveldb
v0.0.1/go.mod h1:
feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc=
github.com/ipfs/go-ipfs-blockstore
v0.0.1 h1:
O9n3PbmTYZoNhkgkEyrXTznbmktIXif62xLX+8dPHzc=
github.com/ipfs/go-ipfs-blockstore
v0.0.1/go.mod h1:
d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08=
github.com/ipfs/go-ipfs-blockstore
v0.1.1 h1:
+PAFREAlSxLs9IEtrRcnJ/DqWkGlDa+l547WFZnohNw=
github.com/ipfs/go-ipfs-blockstore
v0.1.1/go.mod h1:
8gZOgIN5e+Xdg2YSGdwTTRbguSVjYyosIDRQCY8E9QM=
github.com/ipfs/go-ipfs-blockstore
v0.1.4 h1:
2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ=
github.com/ipfs/go-ipfs-blockstore
v0.1.4/go.mod h1:
Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ=
github.com/ipfs/go-ipfs-blocksutil
v0.0.1 h1:
Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ=
...
...
test/blocks_test.go
View file @
d582f74c
...
...
@@ -74,7 +74,10 @@ func TestGetBlocksSequential(t *testing.T) {
var
cids
[]
cid
.
Cid
for
_
,
o
:=
range
objs
{
cids
=
append
(
cids
,
o
.
Cid
())
servs
[
0
]
.
AddBlock
(
o
)
err
:=
servs
[
0
]
.
AddBlock
(
o
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
}
t
.
Log
(
"one instance at a time, get blocks concurrently"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment