Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
7c2592d1
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,发现更多精彩内容 >>
未验证
提交
7c2592d1
编写于
3月 19, 2019
作者:
L
luchiagogogo
提交者:
GitHub
3月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update yta
上级
deea71cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
14 deletion
+14
-14
tests/get_table_tests.cpp
tests/get_table_tests.cpp
+14
-14
未找到文件。
tests/get_table_tests.cpp
浏览文件 @
7c2592d1
...
...
@@ -58,14 +58,14 @@ BOOST_FIXTURE_TEST_CASE( get_scope_test, TESTER ) try {
// create currency
auto
act
=
mutable_variant_object
()
(
"issuer"
,
"eosio"
)
(
"maximum_supply"
,
eosio
::
chain
::
asset
::
from_string
(
"1000000000.0000
SYS
"
));
(
"maximum_supply"
,
eosio
::
chain
::
asset
::
from_string
(
"1000000000.0000
YTA
"
));
push_action
(
N
(
eosio
.
token
),
N
(
create
),
N
(
eosio
.
token
),
act
);
// issue
for
(
account_name
a
:
accs
)
{
push_action
(
N
(
eosio
.
token
),
N
(
issue
),
"eosio"
,
mutable_variant_object
()
(
"to"
,
name
(
a
)
)
(
"quantity"
,
eosio
::
chain
::
asset
::
from_string
(
"999.0000
SYS
"
)
)
(
"quantity"
,
eosio
::
chain
::
asset
::
from_string
(
"999.0000
YTA
"
)
)
(
"memo"
,
""
)
);
}
...
...
@@ -134,14 +134,14 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
// create currency
auto
act
=
mutable_variant_object
()
(
"issuer"
,
"eosio"
)
(
"maximum_supply"
,
eosio
::
chain
::
asset
::
from_string
(
"1000000000.0000
SYS
"
));
(
"maximum_supply"
,
eosio
::
chain
::
asset
::
from_string
(
"1000000000.0000
YTA
"
));
push_action
(
N
(
eosio
.
token
),
N
(
create
),
N
(
eosio
.
token
),
act
);
// issue
for
(
account_name
a
:
accs
)
{
push_action
(
N
(
eosio
.
token
),
N
(
issue
),
"eosio"
,
mutable_variant_object
()
(
"to"
,
name
(
a
)
)
(
"quantity"
,
eosio
::
chain
::
asset
::
from_string
(
"10000.0000
SYS
"
)
)
(
"quantity"
,
eosio
::
chain
::
asset
::
from_string
(
"10000.0000
YTA
"
)
)
(
"memo"
,
""
)
);
}
...
...
@@ -207,7 +207,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL
(
"9999.0000 AAA"
,
result
.
rows
[
0
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"8888.0000 BBB"
,
result
.
rows
[
1
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"7777.0000 CCC"
,
result
.
rows
[
2
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
SYS
"
,
result
.
rows
[
3
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
YTA
"
,
result
.
rows
[
3
][
"balance"
].
as_string
());
}
// get table: reverse ordered
...
...
@@ -219,7 +219,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL
(
"9999.0000 AAA"
,
result
.
rows
[
3
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"8888.0000 BBB"
,
result
.
rows
[
2
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"7777.0000 CCC"
,
result
.
rows
[
1
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
SYS
"
,
result
.
rows
[
0
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
YTA
"
,
result
.
rows
[
0
][
"balance"
].
as_string
());
}
// get table: reverse ordered, with ram payer
...
...
@@ -232,7 +232,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL
(
"9999.0000 AAA"
,
result
.
rows
[
3
][
"data"
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"8888.0000 BBB"
,
result
.
rows
[
2
][
"data"
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"7777.0000 CCC"
,
result
.
rows
[
1
][
"data"
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
SYS
"
,
result
.
rows
[
0
][
"data"
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
YTA
"
,
result
.
rows
[
0
][
"data"
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"eosio"
,
result
.
rows
[
0
][
"payer"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"eosio"
,
result
.
rows
[
1
][
"payer"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"eosio"
,
result
.
rows
[
2
][
"payer"
].
as_string
());
...
...
@@ -283,7 +283,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL
(
1
,
result
.
rows
.
size
());
BOOST_REQUIRE_EQUAL
(
true
,
result
.
more
);
if
(
result
.
rows
.
size
()
>=
1
)
{
BOOST_REQUIRE_EQUAL
(
"10000.0000
SYS
"
,
result
.
rows
[
0
][
"balance"
].
as_string
());
BOOST_REQUIRE_EQUAL
(
"10000.0000
YTA
"
,
result
.
rows
[
0
][
"balance"
].
as_string
());
}
// get table: normal case, with bound & limit
...
...
@@ -329,14 +329,14 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
// create currency
auto
act
=
mutable_variant_object
()
(
"issuer"
,
"eosio"
)
(
"maximum_supply"
,
eosio
::
chain
::
asset
::
from_string
(
"1000000000.0000
SYS
"
));
(
"maximum_supply"
,
eosio
::
chain
::
asset
::
from_string
(
"1000000000.0000
YTA
"
));
push_action
(
N
(
eosio
.
token
),
N
(
create
),
N
(
eosio
.
token
),
act
);
// issue
for
(
account_name
a
:
accs
)
{
push_action
(
N
(
eosio
.
token
),
N
(
issue
),
"eosio"
,
mutable_variant_object
()
(
"to"
,
name
(
a
)
)
(
"quantity"
,
eosio
::
chain
::
asset
::
from_string
(
"10000.0000
SYS
"
)
)
(
"quantity"
,
eosio
::
chain
::
asset
::
from_string
(
"10000.0000
YTA
"
)
)
(
"memo"
,
""
)
);
}
...
...
@@ -354,10 +354,10 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
);
};
bidname
(
N
(
inita
),
N
(
com
),
eosio
::
chain
::
asset
::
from_string
(
"10.0000
SYS
"
));
bidname
(
N
(
initb
),
N
(
org
),
eosio
::
chain
::
asset
::
from_string
(
"11.0000
SYS
"
));
bidname
(
N
(
initc
),
N
(
io
),
eosio
::
chain
::
asset
::
from_string
(
"12.0000
SYS
"
));
bidname
(
N
(
initd
),
N
(
html
),
eosio
::
chain
::
asset
::
from_string
(
"14.0000
SYS
"
));
bidname
(
N
(
inita
),
N
(
com
),
eosio
::
chain
::
asset
::
from_string
(
"10.0000
YTA
"
));
bidname
(
N
(
initb
),
N
(
org
),
eosio
::
chain
::
asset
::
from_string
(
"11.0000
YTA
"
));
bidname
(
N
(
initc
),
N
(
io
),
eosio
::
chain
::
asset
::
from_string
(
"12.0000
YTA
"
));
bidname
(
N
(
initd
),
N
(
html
),
eosio
::
chain
::
asset
::
from_string
(
"14.0000
YTA
"
));
produce_blocks
(
1
);
// get table: normal case
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录