Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
f1bd465a
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,发现更多精彩内容 >>
未验证
提交
f1bd465a
编写于
6月 14, 2018
作者:
A
arhag
提交者:
GitHub
6月 14, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4109 from EOSIO/issue4051
Fix issue #4051
上级
2ccaf218
2ec7ea21
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
8 addition
and
9 deletion
+8
-9
contracts/eosio.system/delegate_bandwidth.cpp
contracts/eosio.system/delegate_bandwidth.cpp
+1
-1
unittests/eosio.system_tests.cpp
unittests/eosio.system_tests.cpp
+5
-6
unittests/ram_tests.cpp
unittests/ram_tests.cpp
+2
-2
未找到文件。
contracts/eosio.system/delegate_bandwidth.cpp
浏览文件 @
f1bd465a
...
...
@@ -108,7 +108,7 @@ namespace eosiosystem {
eosio_assert
(
quant
.
amount
>
0
,
"must purchase a positive amount"
);
auto
fee
=
quant
;
fee
.
amount
/=
200
;
/// .5% fee
fee
.
amount
=
(
fee
.
amount
+
199
)
/
200
;
/// .5% fee
auto
quant_after_fee
=
quant
;
quant_after_fee
.
amount
-=
fee
.
amount
;
...
...
unittests/eosio.system_tests.cpp
浏览文件 @
f1bd465a
...
...
@@ -64,8 +64,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try {
wdump
((
init_bytes
)(
bought_bytes
)(
bytes
)
);
BOOST_REQUIRE_EQUAL
(
true
,
total
[
"ram_bytes"
].
as_uint64
()
==
init_bytes
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99901248.0044"
),
get_balance
(
"alice1111111"
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99901248.0043"
),
get_balance
(
"alice1111111"
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"100.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"100.0000"
)
)
);
...
...
@@ -76,7 +75,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try {
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"10.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"10.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"30.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99900688.004
4
"
),
get_balance
(
"alice1111111"
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99900688.004
3
"
),
get_balance
(
"alice1111111"
)
);
auto
newtotal
=
get_total_stake
(
"alice1111111"
);
...
...
@@ -85,7 +84,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try {
wdump
((
newbytes
)(
bytes
)(
bought_bytes
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
sellram
(
"alice1111111"
,
bought_bytes
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99901242.418
3
"
),
get_balance
(
"alice1111111"
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99901242.418
2
"
),
get_balance
(
"alice1111111"
)
);
newtotal
=
get_total_stake
(
"alice1111111"
);
...
...
@@ -100,7 +99,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try {
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"100000.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"100000.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
success
(),
buyram
(
"alice1111111"
,
"alice1111111"
,
core_from_string
(
"300000.0000"
)
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"49301242.418
3
"
),
get_balance
(
"alice1111111"
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"49301242.418
2
"
),
get_balance
(
"alice1111111"
)
);
auto
finaltotal
=
get_total_stake
(
"alice1111111"
);
auto
endbytes
=
finaltotal
[
"ram_bytes"
].
as_uint64
();
...
...
@@ -110,7 +109,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try {
BOOST_REQUIRE_EQUAL
(
success
(),
sellram
(
"alice1111111"
,
bought_bytes
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99396507.414
7
"
),
get_balance
(
"alice1111111"
)
);
BOOST_REQUIRE_EQUAL
(
core_from_string
(
"99396507.414
6
"
),
get_balance
(
"alice1111111"
)
);
}
FC_LOG_AND_RETHROW
()
...
...
unittests/ram_tests.cpp
浏览文件 @
f1bd465a
...
...
@@ -39,8 +39,8 @@ BOOST_FIXTURE_TEST_CASE(ram_tests, eosio_system::eosio_system_tester) { try {
BOOST_REQUIRE_MESSAGE
(
table_allocation_bytes
>
increment_contract_bytes
,
"increment_contract_bytes must be less than table_allocation_bytes for this test setup to work"
);
buyrambytes
(
N
(
eosio
),
N
(
eosio
),
70000
);
produce_blocks
(
10
);
create_account_with_resources
(
N
(
testram11111
),
N
(
eosio
),
init_request_bytes
);
create_account_with_resources
(
N
(
testram22222
),
N
(
eosio
),
init_request_bytes
+
11
5
0
);
create_account_with_resources
(
N
(
testram11111
),
N
(
eosio
),
init_request_bytes
+
40
);
create_account_with_resources
(
N
(
testram22222
),
N
(
eosio
),
init_request_bytes
+
11
9
0
);
produce_blocks
(
10
);
BOOST_REQUIRE_EQUAL
(
success
(),
stake
(
"eosio.stake"
,
"testram11111"
,
core_from_string
(
"10.0000"
),
core_from_string
(
"5.0000"
)
)
);
produce_blocks
(
10
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录