Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
77e9b8dd
提交
77e9b8dd
authored
8月 08, 2017
作者:
Kevin Atkinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Test for alternative hash function in Dag Modifier.
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
上级
2e15dcb6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
0 行删除
+9
-0
dagmodifier_test.go
unixfs/mod/dagmodifier_test.go
+1
-0
utils.go
unixfs/test/utils.go
+8
-0
没有找到文件。
unixfs/mod/dagmodifier_test.go
浏览文件 @
77e9b8dd
...
...
@@ -77,6 +77,7 @@ func runAllSubtests(t *testing.T, tfunc func(*testing.T, testu.NodeOpts)) {
t
.
Run
(
"opts=ProtoBufLeaves"
,
func
(
t
*
testing
.
T
)
{
tfunc
(
t
,
testu
.
UseProtoBufLeaves
)
})
t
.
Run
(
"opts=RawLeaves"
,
func
(
t
*
testing
.
T
)
{
tfunc
(
t
,
testu
.
UseRawLeaves
)
})
t
.
Run
(
"opts=CidV1"
,
func
(
t
*
testing
.
T
)
{
tfunc
(
t
,
testu
.
UseCidV1
)
})
t
.
Run
(
"opts=Blake2b256"
,
func
(
t
*
testing
.
T
)
{
tfunc
(
t
,
testu
.
UseBlake2b256
)
})
}
func
TestDagModifierBasic
(
t
*
testing
.
T
)
{
...
...
unixfs/test/utils.go
浏览文件 @
77e9b8dd
...
...
@@ -18,6 +18,7 @@ import (
cid
"gx/ipfs/QmNp85zy9RLrQ5oQD4hPyS39ezrrXpcaa7R4Y9kxdWQLLQ/go-cid"
node
"gx/ipfs/QmPN7cwmpcc4DWXb4KTB9dNAJgjuPY69h3npsMfhRrQL9c/go-ipld-format"
u
"gx/ipfs/QmSU6eubNdhXjFBJBSksTp8kv8YRub8mGAPv8tVJHmL2EU/go-ipfs-util"
mh
"gx/ipfs/QmU9a9NV9RdPNwZQDYd5uKsm6N6LJLSvLbywDDYFbaaC6P/go-multihash"
)
func
SizeSplitterGen
(
size
int64
)
chunk
.
SplitterGen
{
...
...
@@ -41,6 +42,13 @@ type NodeOpts struct {
var
UseProtoBufLeaves
=
NodeOpts
{
Prefix
:
mdag
.
V0CidPrefix
()}
var
UseRawLeaves
=
NodeOpts
{
Prefix
:
mdag
.
V0CidPrefix
(),
ForceRawLeaves
:
true
,
RawLeavesUsed
:
true
}
var
UseCidV1
=
NodeOpts
{
Prefix
:
mdag
.
V1CidPrefix
(),
RawLeavesUsed
:
true
}
var
UseBlake2b256
NodeOpts
func
init
()
{
UseBlake2b256
=
UseCidV1
UseBlake2b256
.
Prefix
.
MhType
=
mh
.
Names
[
"blake2b-256"
]
UseBlake2b256
.
Prefix
.
MhLength
=
-
1
}
func
GetNode
(
t
testing
.
TB
,
dserv
mdag
.
DAGService
,
data
[]
byte
,
opts
NodeOpts
)
node
.
Node
{
in
:=
bytes
.
NewReader
(
data
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论