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-bitswap
Commits
7b911d94
Commit
7b911d94
authored
Feb 18, 2019
by
Jakub Sztandera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gx publish 1.1.24
parent
294bd92a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
36 deletions
+23
-36
.gx/lastpubver
.gx/lastpubver
+1
-1
package.json
package.json
+17
-23
testutil/testutil.go
testutil/testutil.go
+5
-12
No files found.
.gx/lastpubver
View file @
7b911d94
1.1.2
3
: QmX
7d3TDCoZFMXT8tnzMVtZ51wNMqsExKEjWcdyGo4RKzb
1.1.2
4
: QmX
ixGGfd98hN2dA5YiPHWANY3sjmHfZBQk3mLiQUo6NLJ
package.json
View file @
7b911d94
...
@@ -9,15 +9,15 @@
...
@@ -9,15 +9,15 @@
"gxDependencies"
:
[
"gxDependencies"
:
[
{
{
"author"
:
"whyrusleeping"
,
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
ZLcEoTHWSoe5XtkJ5o5AQYMvdQR4FZGSNBZ2KVuFadN7
"
,
"hash"
:
"Qm
cNGX5RaxPPCYwa6yGXM1EcUbrreTTinixLcYGmMwf1sx
"
,
"name"
:
"go-libp2p"
,
"name"
:
"go-libp2p"
,
"version"
:
"6.0.3
4
"
"version"
:
"6.0.3
5
"
},
},
{
{
"author"
:
"hsanjuan"
,
"author"
:
"hsanjuan"
,
"hash"
:
"Qm
RFKK88gxKBcA7BkCNTLoTF51T5r96L4SqkkPZ1EHPKEM
"
,
"hash"
:
"Qm
cjqHcsk8E1Gd8RbuaUawWC7ogDtaVcdjLvZF8ysCCiPn
"
,
"name"
:
"go-ipfs-routing"
,
"name"
:
"go-ipfs-routing"
,
"version"
:
"0.1.1
5
"
"version"
:
"0.1.1
6
"
},
},
{
{
"author"
:
"whyrusleeping"
,
"author"
:
"whyrusleeping"
,
...
@@ -99,9 +99,9 @@
...
@@ -99,9 +99,9 @@
},
},
{
{
"author"
:
"whyrusleeping"
,
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
fLNahGe1CVYdxdcoKYXaSkScoDdvF68UPy8zmUB78cEG
"
,
"hash"
:
"Qm
d52WKRSwrBK5gUaJKawryZQ5by6UbNB8KVW2Zy6JtbyW
"
,
"name"
:
"go-libp2p-host"
,
"name"
:
"go-libp2p-host"
,
"version"
:
"3.0.2
3
"
"version"
:
"3.0.2
4
"
},
},
{
{
"author"
:
"hsanjuan"
,
"author"
:
"hsanjuan"
,
...
@@ -128,21 +128,21 @@
...
@@ -128,21 +128,21 @@
},
},
{
{
"author"
:
"whyrusleeping"
,
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
QTUGt4PugW7zESt3CdY7wqpq8dMyG8xYHMZ9wbQnkPbR
"
,
"hash"
:
"Qm
UD9zcPC7rkiyp3KWBnBor7GcpU671DC8F6hBnZZUnrfv
"
,
"name"
:
"go-libp2p-netutil"
,
"name"
:
"go-libp2p-netutil"
,
"version"
:
"0.4.2
0
"
"version"
:
"0.4.2
1
"
},
},
{
{
"author"
:
"whyrusleeping"
,
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
f1MBFKph9DWDMsdksXUFWSpUW1cGvCsmYiN9Wsdr2Dn5
"
,
"hash"
:
"Qm
TGxDz2CjBucFzPNTiWwzQmTWdrBnzqbqrMucDYMsjuPb
"
,
"name"
:
"go-libp2p-net"
,
"name"
:
"go-libp2p-net"
,
"version"
:
"3.0.2
6
"
"version"
:
"3.0.2
8
"
},
},
{
{
"author"
:
"whyrusleeping"
,
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
VYTrDbcoZNkHyYfjopWwUK8ebfUq1DqDwSQLbizwPjgq
"
,
"hash"
:
"Qm
RhFARzTHcFh8wUxwN5KvyTGq73FLC65EfFAhz8Ng7aGb
"
,
"name"
:
"go-libp2p-peerstore"
,
"name"
:
"go-libp2p-peerstore"
,
"version"
:
"2.0.1
6
"
"version"
:
"2.0.1
7
"
},
},
{
{
"author"
:
"multiformats"
,
"author"
:
"multiformats"
,
...
@@ -164,9 +164,9 @@
...
@@ -164,9 +164,9 @@
},
},
{
{
"author"
:
"why"
,
"author"
:
"why"
,
"hash"
:
"Qm
VgpHPZkbxnPyEMZWi2pr2C179SGSYf8sbS95tKji8AWS
"
,
"hash"
:
"Qm
cCk4LZRJPAKuwY9dusFea7LckELZgo5HagErTbm39o38
"
,
"name"
:
"go-libp2p-interface-connmgr"
,
"name"
:
"go-libp2p-interface-connmgr"
,
"version"
:
"0.0.
29
"
"version"
:
"0.0.
30
"
},
},
{
{
"author"
:
"jbenet"
,
"author"
:
"jbenet"
,
...
@@ -175,21 +175,15 @@
...
@@ -175,21 +175,15 @@
"version"
:
"3.6.1"
"version"
:
"3.6.1"
},
},
{
{
"hash"
:
"QmW
XyhiyAHFmuhpZs1cgTFmpcsKyys4ACqoJzZnWMDQhFg
"
,
"hash"
:
"QmW
aDSNoSdSXU9b6udyaq9T8y6LkzMwqWxECznFqvtcTsk
"
,
"name"
:
"go-libp2p-routing"
,
"name"
:
"go-libp2p-routing"
,
"version"
:
"2.7.
9
"
"version"
:
"2.7.
10
"
},
},
{
{
"author"
:
"jbenet"
,
"author"
:
"jbenet"
,
"hash"
:
"Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF"
,
"hash"
:
"Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF"
,
"name"
:
"go-detect-race"
,
"name"
:
"go-detect-race"
,
"version"
:
"1.0.1"
"version"
:
"1.0.1"
},
{
"author"
:
"jbenet"
,
"hash"
:
"QmSJ9n2s9NUoA9D849W5jj5SJ94nMcZpj1jCgQJieiNqSt"
,
"name"
:
"go-random"
,
"version"
:
"1.0.0"
}
}
],
],
"gxVersion"
:
"0.12.1"
,
"gxVersion"
:
"0.12.1"
,
...
@@ -197,6 +191,6 @@
...
@@ -197,6 +191,6 @@
"license"
:
""
,
"license"
:
""
,
"name"
:
"go-bitswap"
,
"name"
:
"go-bitswap"
,
"releaseCmd"
:
"git commit -a -m
\"
gx publish $VERSION
\"
"
,
"releaseCmd"
:
"git commit -a -m
\"
gx publish $VERSION
\"
"
,
"version"
:
"1.1.2
3
"
"version"
:
"1.1.2
4
"
}
}
testutil/testutil.go
View file @
7b911d94
package
testutil
package
testutil
import
(
import
(
"bytes"
"math/rand"
random
"github.com/jbenet/go-random"
bsmsg
"github.com/ipfs/go-bitswap/message"
bsmsg
"github.com/ipfs/go-bitswap/message"
"github.com/ipfs/go-bitswap/wantlist"
"github.com/ipfs/go-bitswap/wantlist"
...
@@ -15,20 +13,15 @@ import (
...
@@ -15,20 +13,15 @@ import (
var
blockGenerator
=
blocksutil
.
NewBlockGenerator
()
var
blockGenerator
=
blocksutil
.
NewBlockGenerator
()
var
prioritySeq
int
var
prioritySeq
int
var
seedSeq
int64
func
randomBytes
(
n
int64
,
seed
int64
)
[]
byte
{
data
:=
new
(
bytes
.
Buffer
)
random
.
WritePseudoRandomBytes
(
n
,
data
,
seed
)
return
data
.
Bytes
()
}
// GenerateBlocksOfSize generates a series of blocks of the given byte size
// GenerateBlocksOfSize generates a series of blocks of the given byte size
func
GenerateBlocksOfSize
(
n
int
,
size
int64
)
[]
blocks
.
Block
{
func
GenerateBlocksOfSize
(
n
int
,
size
int64
)
[]
blocks
.
Block
{
generatedBlocks
:=
make
([]
blocks
.
Block
,
0
,
n
)
generatedBlocks
:=
make
([]
blocks
.
Block
,
0
,
n
)
buf
:=
make
([]
byte
,
size
)
for
i
:=
0
;
i
<
n
;
i
++
{
for
i
:=
0
;
i
<
n
;
i
++
{
seedSeq
++
// rand.Read never errors
b
:=
blocks
.
NewBlock
(
randomBytes
(
size
,
seedSeq
))
rand
.
Read
(
buf
)
b
:=
blocks
.
NewBlock
(
buf
)
generatedBlocks
=
append
(
generatedBlocks
,
b
)
generatedBlocks
=
append
(
generatedBlocks
,
b
)
}
}
...
...
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