Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
9a9e3c7b
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,发现更多精彩内容 >>
提交
9a9e3c7b
编写于
7月 06, 2017
作者:
N
Nathan Hourt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix many tests, but not all
上级
78301c69
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
7 deletion
+9
-7
libraries/chain/include/eos/chain/producer_object.hpp
libraries/chain/include/eos/chain/producer_object.hpp
+1
-0
libraries/native_contract/native_contract_chain_initializer.cpp
...ies/native_contract/native_contract_chain_initializer.cpp
+3
-3
libraries/types/include/eos/types/native.hpp
libraries/types/include/eos/types/native.hpp
+2
-1
tests/tests/block_tests.cpp
tests/tests/block_tests.cpp
+3
-3
未找到文件。
libraries/chain/include/eos/chain/producer_object.hpp
浏览文件 @
9a9e3c7b
...
...
@@ -57,5 +57,6 @@ using producer_multi_index = chainbase::shared_multi_index_container<
CHAINBASE_SET_INDEX_TYPE
(
eos
::
chain
::
producer_object
,
eos
::
chain
::
producer_multi_index
)
FC_REFLECT
(
eos
::
chain
::
producer_object
::
id_type
,
(
_id
))
FC_REFLECT
(
eos
::
chain
::
producer_object
,
(
id
)(
owner
)(
last_aslot
)(
signing_key
)(
total_missed
)(
last_confirmed_block_num
)
(
configuration
))
libraries/native_contract/native_contract_chain_initializer.cpp
浏览文件 @
9a9e3c7b
...
...
@@ -76,7 +76,7 @@ void native_contract_chain_initializer::register_types(chain_controller& chain,
SET_PRE_HANDLER
(
staked
,
staked
,
setproducer
);
SET_APP_HANDLER
(
staked
,
staked
,
setproducer
);
//
SET_VAL_HANDLER( staked, staked, setproxy );
SET_VAL_HANDLER
(
staked
,
staked
,
setproxy
);
SET_PRE_HANDLER
(
staked
,
staked
,
setproxy
);
SET_APP_HANDLER
(
staked
,
staked
,
setproxy
);
...
...
@@ -127,7 +127,7 @@ std::vector<chain::Message> native_contract_chain_initializer::prepare_database(
acct
.
staking_balance
));
messages_to_process
.
emplace_back
(
std
::
move
(
message
));
if
(
acct
.
liquid_balance
>
0
)
{
message
=
chain
::
Message
(
config
::
SystemContractName
,
vector
<
AccountName
>
{
config
::
EosContractN
ame
},
message
=
chain
::
Message
(
config
::
EosContractName
,
vector
<
AccountName
>
{
config
::
SystemContractName
,
acct
.
n
ame
},
vector
<
types
::
AccountPermission
>
{},
"transfer"
,
types
::
transfer
(
config
::
SystemContractName
,
acct
.
name
,
acct
.
liquid_balance
,
"Genesis Allocation"
));
...
...
@@ -137,7 +137,7 @@ std::vector<chain::Message> native_contract_chain_initializer::prepare_database(
// Create initial producers
auto
CreateProducer
=
boost
::
adaptors
::
transformed
([
config
=
genesis
.
initial_configuration
](
const
auto
&
p
)
{
return
chain
::
Message
(
config
::
S
ystemContractName
,
{
config
::
StakedBalanceContractN
ame
},
return
chain
::
Message
(
config
::
S
takedBalanceContractName
,
{
p
.
owner_n
ame
},
vector
<
types
::
AccountPermission
>
{},
"setproducer"
,
types
::
setproducer
(
p
.
owner_name
,
p
.
block_signing_key
,
config
));
});
...
...
libraries/types/include/eos/types/native.hpp
浏览文件 @
9a9e3c7b
...
...
@@ -87,7 +87,7 @@ namespace eos { namespace types {
Name
(
uint64_t
v
=
0
)
:
value
(
v
){
FC_ASSERT
(
!
(
v
>>
(
5
*
12
)),
"invalid name id"
);
}
;
}
explicit
operator
String
()
const
{
static
const
char
*
charmap
=
".abcdefghijklmnopqrstuvwxyz12345"
;
...
...
@@ -101,6 +101,7 @@ namespace eos { namespace types {
boost
::
algorithm
::
trim_right_if
(
str
,
[](
char
c
){
return
c
==
'.'
;
}
);
return
str
;
}
String
toString
()
const
{
return
String
(
*
this
);
}
Name
&
operator
=
(
uint64_t
v
)
{
FC_ASSERT
(
!
(
v
>>
(
5
*
12
)),
"invalid name id"
);
...
...
tests/tests/block_tests.cpp
浏览文件 @
9a9e3c7b
...
...
@@ -68,11 +68,11 @@ BOOST_FIXTURE_TEST_CASE(produce_blocks, testing_fixture)
Make_Blockchain
(
chain
)
BOOST_CHECK_EQUAL
(
chain
.
head_block_num
(),
0
);
chain
.
produce_blocks
();
chain
.
produce_blocks
();
BOOST_CHECK_EQUAL
(
chain
.
head_block_num
(),
1
);
chain
.
produce_blocks
(
5
);
chain
.
produce_blocks
(
5
);
BOOST_CHECK_EQUAL
(
chain
.
head_block_num
(),
6
);
chain
.
produce_blocks
(
chain
.
get_global_properties
().
active_producers
.
size
());
chain
.
produce_blocks
(
chain
.
get_global_properties
().
active_producers
.
size
());
BOOST_CHECK_EQUAL
(
chain
.
head_block_num
(),
chain
.
get_global_properties
().
active_producers
.
size
()
+
6
);
}
FC_LOG_AND_RETHROW
()
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录