Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
609671dc
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,发现更多精彩内容 >>
提交
609671dc
编写于
3月 12, 2018
作者:
K
Kevin Heifner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix compiler warnings
上级
e9b0a0da
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
8 deletion
+9
-8
contracts/eosiolib/transaction.hpp
contracts/eosiolib/transaction.hpp
+2
-2
contracts/test_api/test_action.cpp
contracts/test_api/test_action.cpp
+7
-6
未找到文件。
contracts/eosiolib/transaction.hpp
浏览文件 @
609671dc
...
@@ -69,8 +69,8 @@ namespace eosio {
...
@@ -69,8 +69,8 @@ namespace eosio {
std
::
vector
<
char
>
buf
;
std
::
vector
<
char
>
buf
;
int
size
=
::
get_action
(
type
,
index
,
nullptr
,
0
);
int
size
=
::
get_action
(
type
,
index
,
nullptr
,
0
);
eosio_assert
(
size
>
0
,
"get_action size failed"
);
eosio_assert
(
size
>
0
,
"get_action size failed"
);
buf
.
resize
(
s
ize
);
buf
.
resize
(
s
tatic_cast
<
size_t
>
(
size
)
);
size
=
::
get_action
(
type
,
index
,
&
buf
[
0
],
s
ize
);
size
=
::
get_action
(
type
,
index
,
&
buf
[
0
],
s
tatic_cast
<
size_t
>
(
size
)
);
eosio_assert
(
size
>
0
,
"get_action failed"
);
eosio_assert
(
size
>
0
,
"get_action failed"
);
return
eosio
::
unpack
<
eosio
::
action
>
(
&
buf
[
0
],
static_cast
<
size_t
>
(
size
));
return
eosio
::
unpack
<
eosio
::
action
>
(
&
buf
[
0
],
static_cast
<
size_t
>
(
size
));
}
}
...
...
contracts/test_api/test_action.cpp
浏览文件 @
609671dc
...
@@ -48,10 +48,10 @@ void test_action::test_dummy_action() {
...
@@ -48,10 +48,10 @@ void test_action::test_dummy_action() {
// get_action
// get_action
total
=
get_action
(
1
,
0
,
buffer
,
0
);
total
=
get_action
(
1
,
0
,
buffer
,
0
);
total
=
get_action
(
1
,
0
,
buffer
,
total
);
total
=
get_action
(
1
,
0
,
buffer
,
static_cast
<
size_t
>
(
total
)
);
eosio_assert
(
total
>
0
,
"get_action failed"
);
eosio_assert
(
total
>
0
,
"get_action failed"
);
eosio
::
action
act
=
eosio
::
get_action
(
1
,
0
);
eosio
::
action
act
=
eosio
::
get_action
(
1
,
0
);
eosio_assert
(
eosio
::
pack_size
(
act
)
==
total
,
"pack_size does not match get_action size"
);
eosio_assert
(
eosio
::
pack_size
(
act
)
==
static_cast
<
size_t
>
(
total
)
,
"pack_size does not match get_action size"
);
eosio_assert
(
act
.
account
==
N
(
testapi
),
"expected testapi account"
);
eosio_assert
(
act
.
account
==
N
(
testapi
),
"expected testapi account"
);
dummy_action
dum13
=
act
.
data_as
<
dummy_action
>
();
dummy_action
dum13
=
act
.
data_as
<
dummy_action
>
();
...
@@ -84,16 +84,17 @@ void test_action::test_cf_action() {
...
@@ -84,16 +84,17 @@ void test_action::test_cf_action() {
// verify read of get_context_free_data, also verifies system api access
// verify read of get_context_free_data, also verifies system api access
int
size
=
get_context_free_data
(
cfa
.
cfd_idx
,
nullptr
,
0
);
int
size
=
get_context_free_data
(
cfa
.
cfd_idx
,
nullptr
,
0
);
eosio_assert
(
size
>
0
,
"size determination failed"
);
eosio_assert
(
size
>
0
,
"size determination failed"
);
eosio
::
bytes
cfd
(
size
);
eosio
::
bytes
cfd
(
static_cast
<
size_t
>
(
size
)
);
size
=
get_context_free_data
(
cfa
.
cfd_idx
,
&
cfd
[
0
],
static_cast
<
size_t
>
(
size
)
);
size
=
get_context_free_data
(
cfa
.
cfd_idx
,
&
cfd
[
0
],
static_cast
<
size_t
>
(
size
)
);
eosio_assert
(
size
==
cfd
.
size
(),
"get_context_free_data failed"
);
eosio_assert
(
static_cast
<
size_t
>
(
size
)
==
cfd
.
size
(),
"get_context_free_data failed"
);
uint32_t
v
=
eosio
::
unpack
<
uint32_t
>
(
&
cfd
[
0
],
cfd
.
size
()
);
uint32_t
v
=
eosio
::
unpack
<
uint32_t
>
(
&
cfd
[
0
],
cfd
.
size
()
);
eosio_assert
(
v
==
cfa
.
payload
,
"invalid value"
);
eosio_assert
(
v
==
cfa
.
payload
,
"invalid value"
);
// verify crypto api access
// verify crypto api access
checksum256
hash
;
checksum256
hash
;
sha256
(
"test"
,
4
,
&
hash
);
char
test
[]
=
"test"
;
assert_sha256
(
"test"
,
4
,
&
hash
);
sha256
(
test
,
sizeof
(
test
),
&
hash
);
assert_sha256
(
test
,
sizeof
(
test
),
&
hash
);
// verify action api access
// verify action api access
action_data_size
();
action_data_size
();
// verify console api access
// verify console api access
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录