Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
9ab7f9d0
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,发现更多精彩内容 >>
提交
9ab7f9d0
编写于
5月 09, 2018
作者:
A
Andrianto Lie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix problem with build outside ubuntu and mac
上级
2fb4ecfc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
7 deletion
+13
-7
unittests/api_tests.cpp
unittests/api_tests.cpp
+13
-7
未找到文件。
unittests/api_tests.cpp
浏览文件 @
9ab7f9d0
...
...
@@ -898,13 +898,17 @@ BOOST_FIXTURE_TEST_CASE(deferred_transaction_tests, TESTER) { try {
{
// Trigger a tx which in turn sends a deferred tx with payer != receiver
// Payer is alice in this case, this tx should fail since we don't have the authorization of alice
dtt_action
dtt_act1
=
{.
payer
=
N
(
alice
)};
BOOST_CHECK_THROW
(
CALL_TEST_FUNCTION
(
*
this
,
"test_transaction"
,
"send_deferred_tx_with_dtt_action"
,
fc
::
raw
::
pack
(
dtt_act1
)),
transaction_exception
);
dtt_action
dtt_act1
;
dtt_act1
.
payer
=
N
(
alice
);
BOOST_CHECK_THROW
(
CALL_TEST_FUNCTION
(
*
this
,
"test_transaction"
,
"send_deferred_tx_with_dtt_action"
,
fc
::
raw
::
pack
(
dtt_act1
)),
missing_auth_exception
);
// Send a tx which in turn sends a deferred tx with the deferred tx's receiver != this tx receiver
// This will include the authorization of the receiver, and impose any related delay associated with the authority
// We set the authorization delay to be 10 sec here, and since the deferred tx delay is set to be 2 sec, so this tx should fail
dtt_action
dtt_act2
=
{.
deferred_account
=
N
(
testapi2
),
.
permission_name
=
N
(
additional
),
.
delay_sec
=
2
};
// We set the authorization delay to be 10 sec here, and since the deferred tx delay is set to be 5 sec, so this tx should fail
dtt_action
dtt_act2
;
dtt_act2
.
deferred_account
=
N
(
testapi2
);
dtt_act2
.
permission_name
=
N
(
additional
);
dtt_act2
.
delay_sec
=
5
;
push_action
(
config
::
system_account_name
,
updateauth
::
get_name
(),
"testapi"
,
fc
::
mutable_variant_object
()
(
"account"
,
"testapi"
)
(
"permission"
,
name
(
dtt_act2
.
permission_name
))
...
...
@@ -915,10 +919,12 @@ BOOST_FIXTURE_TEST_CASE(deferred_transaction_tests, TESTER) { try {
(
"code"
,
name
(
dtt_act2
.
deferred_account
))
(
"type"
,
name
(
dtt_act2
.
deferred_action
))
(
"requirement"
,
name
(
dtt_act2
.
permission_name
)));
BOOST_CHECK_THROW
(
CALL_TEST_FUNCTION
(
*
this
,
"test_transaction"
,
"send_deferred_tx_with_dtt_action"
,
fc
::
raw
::
pack
(
dtt_act2
)),
transaction
_exception
);
BOOST_CHECK_THROW
(
CALL_TEST_FUNCTION
(
*
this
,
"test_transaction"
,
"send_deferred_tx_with_dtt_action"
,
fc
::
raw
::
pack
(
dtt_act2
)),
insufficient_delay
_exception
);
// Meanwhile, if the deferred tx receiver == this tx receiver, the delay will be ignored, this tx should succeed
dtt_action
dtt_act3
=
{.
deferred_account
=
N
(
testapi
),
.
permission_name
=
N
(
additional
)};
dtt_action
dtt_act3
;
dtt_act3
.
deferred_account
=
N
(
testapi
);
dtt_act3
.
permission_name
=
N
(
additional
);
push_action
(
config
::
system_account_name
,
linkauth
::
get_name
(),
"testapi"
,
fc
::
mutable_variant_object
()
(
"account"
,
"testapi"
)
(
"code"
,
name
(
dtt_act3
.
deferred_account
))
...
...
@@ -931,7 +937,7 @@ BOOST_FIXTURE_TEST_CASE(deferred_transaction_tests, TESTER) { try {
// - the deferred transaction will not care about the delay of the authorization
push_action
(
config
::
system_account_name
,
N
(
setpriv
),
config
::
system_account_name
,
mutable_variant_object
()
(
"account"
,
"testapi"
)
(
"is_priv"
,
1
));
(
"is_priv"
,
1
));
CALL_TEST_FUNCTION
(
*
this
,
"test_transaction"
,
"send_deferred_tx_with_dtt_action"
,
fc
::
raw
::
pack
(
dtt_act1
));
CALL_TEST_FUNCTION
(
*
this
,
"test_transaction"
,
"send_deferred_tx_with_dtt_action"
,
fc
::
raw
::
pack
(
dtt_act2
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录