Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
a3b38e8b
提交
a3b38e8b
authored
1月 11, 2017
作者:
Jeromy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a test for the keystore
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
上级
4dbb084e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
2 行删除
+39
-2
keystore.go
core/commands/keystore.go
+2
-2
t0165-keystore.sh
test/sharness/t0165-keystore.sh
+37
-0
没有找到文件。
core/commands/keystore.go
浏览文件 @
a3b38e8b
...
...
@@ -143,7 +143,7 @@ var KeyListCmd = &cmds.Command{
Tagline
:
"List all local keypairs"
,
},
Options
:
[]
cmds
.
Option
{
cmds
.
BoolOption
(
"
show-ids"
,
"l"
,
"also show key ids
"
),
cmds
.
BoolOption
(
"
l"
,
"Show extra information about keys.
"
),
},
Run
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
n
,
err
:=
req
.
InvocContext
()
.
GetNode
()
...
...
@@ -189,7 +189,7 @@ var KeyListCmd = &cmds.Command{
}
func
keyOutputListMarshaler
(
res
cmds
.
Response
)
(
io
.
Reader
,
error
)
{
withId
,
_
,
_
:=
res
.
Request
()
.
Option
(
"
show-ids
"
)
.
Bool
()
withId
,
_
,
_
:=
res
.
Request
()
.
Option
(
"
l
"
)
.
Bool
()
list
,
ok
:=
res
.
Output
()
.
(
*
KeyOutputList
)
if
!
ok
{
...
...
test/sharness/t0165-keystore.sh
0 → 100755
浏览文件 @
a3b38e8b
#!/bin/sh
#
# Copyright (c) 2017 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description
=
"Test keystore commands"
.
lib/test-lib.sh
test_init_ipfs
test_key_cmd
()
{
test_expect_success
"create a new rsa key"
'
rsahash=$(ipfs key gen foobarsa --type=rsa --size=2048)
'
test_expect_success
"create a new ed25519 key"
'
edhash=$(ipfs key gen bazed --type=ed25519)
'
test_expect_success
"both keys show up in list output"
'
echo bazed > list_exp &&
echo foobarsa >> list_exp &&
ipfs key list | sort > list_out &&
test_cmp list_exp list_out
'
test_expect_success
"key hashes show up in long list output"
'
ipfs key list -l | grep $edhash > /dev/null &&
ipfs key list -l | grep $rsahash > /dev/null
'
}
test_key_cmd
test_done
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论