Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
6a47de5a
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,发现更多精彩内容 >>
提交
6a47de5a
编写于
8月 01, 2017
作者:
M
Matias Romeo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix require_notice test and handle crypto calls
上级
1c2921b9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
11 deletion
+13
-11
contracts/test_api/test_api.cpp
contracts/test_api/test_api.cpp
+8
-1
contracts/test_api/test_api.hpp
contracts/test_api/test_api.hpp
+1
-7
contracts/test_api/test_message.cpp
contracts/test_api/test_message.cpp
+3
-3
contracts/test_api/test_types.cpp
contracts/test_api/test_types.cpp
+1
-0
未找到文件。
contracts/test_api/test_api.cpp
浏览文件 @
6a47de5a
...
...
@@ -21,7 +21,7 @@ extern "C" {
WASM_TEST_HANDLER
(
test_message
,
read_message
);
WASM_TEST_HANDLER
(
test_message
,
read_message_to_0
);
WASM_TEST_HANDLER
(
test_message
,
read_message_to_64k
);
WASM_TEST_HANDLER
_EX
(
test_message
,
require_notice
);
WASM_TEST_HANDLER
(
test_message
,
require_notice
);
WASM_TEST_HANDLER
(
test_message
,
require_auth
);
WASM_TEST_HANDLER
(
test_message
,
assert_false
);
WASM_TEST_HANDLER
(
test_message
,
assert_true
);
...
...
@@ -48,6 +48,13 @@ extern "C" {
WASM_TEST_HANDLER
(
test_db
,
key_i64_not_found
);
WASM_TEST_HANDLER
(
test_db
,
key_i128i128_general
);
//test crypto
WASM_TEST_HANDLER
(
test_crypto
,
test_sha256
);
WASM_TEST_HANDLER
(
test_crypto
,
sha256_no_data
);
WASM_TEST_HANDLER
(
test_crypto
,
asert_sha256_false
);
WASM_TEST_HANDLER
(
test_crypto
,
asert_sha256_true
);
WASM_TEST_HANDLER
(
test_crypto
,
asert_no_data
);
//unhandled test call
WASM_TEST_ERROR_CODE
=
WASM_TEST_FAIL
;
}
...
...
contracts/test_api/test_api.hpp
浏览文件 @
6a47de5a
...
...
@@ -15,12 +15,6 @@ typedef unsigned long long u64;
return; \
}
#define WASM_TEST_HANDLER_EX(CLASS, METHOD) \
if( u32(action>>32) == DJBH(#CLASS) && u32(action) == DJBH(#METHOD) ) { \
WASM_TEST_ERROR_CODE = CLASS::METHOD(code, action); \
return; \
}
typedef
unsigned
int
u32
;
static
constexpr
u32
DJBH
(
const
char
*
cp
)
{
...
...
@@ -68,7 +62,7 @@ struct test_message {
static
unsigned
int
read_message
();
static
unsigned
int
read_message_to_0
();
static
unsigned
int
read_message_to_64k
();
static
unsigned
int
require_notice
(
unsigned
long
long
code
,
unsigned
long
long
action
);
static
unsigned
int
require_notice
();
static
unsigned
int
require_auth
();
static
unsigned
int
assert_false
();
static
unsigned
int
assert_true
();
...
...
contracts/test_api/test_message.cpp
浏览文件 @
6a47de5a
...
...
@@ -41,13 +41,13 @@ unsigned int test_message::read_message_to_64k() {
return
WASM_TEST_PASS
;
}
unsigned
int
test_message
::
require_notice
(
unsigned
long
long
code
,
unsigned
long
long
action
)
{
if
(
c
ode
==
N
(
test_api
)
)
{
unsigned
int
test_message
::
require_notice
()
{
if
(
c
urrentCode
()
==
N
(
test_api
)
)
{
eos
::
requireNotice
(
N
(
acc1
)
);
eos
::
requireNotice
(
N
(
acc2
)
);
eos
::
requireNotice
(
N
(
acc1
),
N
(
acc2
)
);
return
WASM_TEST_FAIL
;
}
else
if
(
c
ode
==
N
(
acc1
)
||
code
==
N
(
acc2
)
)
{
}
else
if
(
c
urrentCode
()
==
N
(
acc1
)
||
currentCode
()
==
N
(
acc2
)
)
{
return
WASM_TEST_PASS
;
}
return
WASM_TEST_FAIL
;
...
...
contracts/test_api/test_types.cpp
浏览文件 @
6a47de5a
...
...
@@ -16,6 +16,7 @@ unsigned int test_types::types_size() {
WASM_ASSERT
(
sizeof
(
TokenName
)
==
8
,
"TokenName size != 8"
);
WASM_ASSERT
(
sizeof
(
TableName
)
==
8
,
"TableName size != 8"
);
WASM_ASSERT
(
sizeof
(
Time
)
==
4
,
"Time size != 4"
);
WASM_ASSERT
(
sizeof
(
uint256
)
==
32
,
"uint256 != 32"
);
return
WASM_TEST_PASS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录