Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
43dabac9
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
43dabac9
编写于
5月 08, 2018
作者:
A
Anton Perkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleos error reporting fix #2846 cleos get account fix #2845
上级
be15fdbd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
programs/cleos/main.cpp
programs/cleos/main.cpp
+9
-9
未找到文件。
programs/cleos/main.cpp
浏览文件 @
43dabac9
...
...
@@ -330,14 +330,14 @@ void print_action_tree( const fc::variant& action ) {
void
print_result
(
const
fc
::
variant
&
result
)
{
try
{
const
auto
&
processed
=
result
[
"processed"
];
const
auto
&
transaction_id
=
processed
[
"id"
].
as_string
();
const
auto
&
receipt
=
processed
[
"receipt"
].
get_object
()
;
const
auto
&
status
=
receipt
[
"status"
].
as_string
()
;
auto
net
=
receipt
[
"net_usage_words
"
].
as_int64
()
*
8
;
auto
cpu
=
receipt
[
"kcpu_usage"
].
as_int64
()
;
//
const auto& receipt = processed["receipt"].get_object() ;
string
status
=
processed
[
"receipt"
].
is_object
()
?
processed
[
"receipt"
][
"status"
].
as_string
()
:
"failed"
;
auto
net
=
processed
[
"net_usage
"
].
as_int64
()
*
8
;
auto
cpu
=
processed
[
"cpu_usage"
].
as_int64
()
/
1024
;
cerr
<<
status
<<
" transaction: "
<<
transaction_id
<<
" "
<<
net
<<
" bytes "
<<
cpu
<<
"k cycles
\n
"
;
if
(
status
==
"
hard_fail
"
)
{
if
(
status
==
"
failed
"
)
{
auto
soft_except
=
processed
[
"except"
].
as
<
optional
<
fc
::
exception
>>
();
if
(
soft_except
)
{
edump
((
soft_except
->
to_detail_string
()));
...
...
@@ -1171,8 +1171,8 @@ void get_account( const string& accountName, bool json_format ) {
<<
indent
<<
"quota: "
<<
std
::
setw
(
15
)
<<
res
.
ram_quota
<<
" bytes used: "
<<
std
::
setw
(
15
)
<<
res
.
ram_usage
<<
" bytes"
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
"net bandwidth:"
<<
std
::
endl
;
if
(
res
.
total_resources
.
is_object
()
&&
res
.
delegated_bandwidth
.
is_object
()
)
{
asset
net_own
(
stoll
(
res
.
delegated_bandwidth
.
get_object
()[
"net_weight"
].
as_string
()
)
);
if
(
res
.
total_resources
.
is_object
()
)
{
asset
net_own
(
res
.
delegated_bandwidth
.
is_object
()
?
stoll
(
res
.
delegated_bandwidth
.
get_object
()[
"net_weight"
].
as_string
()
)
:
0
);
auto
net_others
=
to_asset
(
res
.
total_resources
.
get_object
()[
"net_weight"
].
as_string
())
-
net_own
;
std
::
cout
<<
indent
<<
"staked:"
<<
std
::
setw
(
20
)
<<
net_own
<<
std
::
string
(
11
,
' '
)
<<
"(total stake delegated from account to self)"
<<
std
::
endl
...
...
@@ -1189,8 +1189,8 @@ void get_account( const string& accountName, bool json_format ) {
std
::
cout
<<
"cpu bandwidth:"
<<
std
::
endl
;
if
(
res
.
total_resources
.
is_object
()
&&
res
.
delegated_bandwidth
.
is_object
()
)
{
asset
cpu_own
(
stoll
(
res
.
delegated_bandwidth
.
get_object
()[
"cpu_weight"
].
as_string
()
)
);
if
(
res
.
total_resources
.
is_object
()
)
{
asset
cpu_own
(
res
.
delegated_bandwidth
.
is_object
()
?
stoll
(
res
.
delegated_bandwidth
.
get_object
()[
"cpu_weight"
].
as_string
()
)
:
0
);
auto
cpu_others
=
to_asset
(
res
.
total_resources
.
get_object
()[
"cpu_weight"
].
as_string
())
-
cpu_own
;
std
::
cout
<<
indent
<<
"staked:"
<<
std
::
setw
(
20
)
<<
cpu_own
<<
std
::
string
(
11
,
' '
)
<<
"(total stake delegated from account to self)"
<<
std
::
endl
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录