Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
ec58b685
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,发现更多精彩内容 >>
提交
ec58b685
编写于
12月 18, 2017
作者:
B
Bart Wyatt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
various fixes for gcc 5.4 (aka Ubuntu 16.04 default)
上级
9d26d14c
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
49 addition
and
31 deletion
+49
-31
libraries/chain/chain_controller.cpp
libraries/chain/chain_controller.cpp
+3
-3
libraries/chain/contracts/chain_initializer.cpp
libraries/chain/contracts/chain_initializer.cpp
+1
-1
libraries/chain/contracts/eosio_contract.cpp
libraries/chain/contracts/eosio_contract.cpp
+5
-5
libraries/chain/include/eosio/chain/contracts/abi_serializer.hpp
...es/chain/include/eosio/chain/contracts/abi_serializer.hpp
+23
-8
libraries/chain/include/eosio/chain/contracts/genesis_state.hpp
...ies/chain/include/eosio/chain/contracts/genesis_state.hpp
+2
-0
libraries/chain/include/eosio/chain/contracts/types.hpp
libraries/chain/include/eosio/chain/contracts/types.hpp
+2
-2
libraries/chain/wasm_interface.cpp
libraries/chain/wasm_interface.cpp
+5
-4
libraries/fc/include/fc/crypto/common.hpp
libraries/fc/include/fc/crypto/common.hpp
+1
-1
libraries/fc/include/fc/static_variant.hpp
libraries/fc/include/fc/static_variant.hpp
+1
-1
libraries/testing/tester.cpp
libraries/testing/tester.cpp
+2
-2
plugins/account_history_plugin/account_history_plugin.cpp
plugins/account_history_plugin/account_history_plugin.cpp
+2
-2
plugins/producer_plugin/producer_plugin.cpp
plugins/producer_plugin/producer_plugin.cpp
+1
-1
plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
+1
-1
未找到文件。
libraries/chain/chain_controller.cpp
浏览文件 @
ec58b685
...
...
@@ -377,7 +377,7 @@ void chain_controller::_apply_cycle_trace( const cycle_trace& res )
for
(
const
auto
&
st
:
res
.
shard_traces
)
{
for
(
const
auto
&
tr
:
st
.
transaction_traces
)
{
for
(
const
auto
&
dt
:
tr
.
deferred_transactions
)
{
_db
.
create
<
generated_transaction_object
>
([
&
](
auto
&
obj
)
{
_db
.
create
<
generated_transaction_object
>
([
&
](
generated_transaction_object
&
obj
)
{
obj
.
trx_id
=
dt
.
id
();
obj
.
sender
=
dt
.
sender
;
obj
.
sender_id
=
dt
.
sender_id
;
...
...
@@ -630,7 +630,7 @@ void chain_controller::__apply_block(const signed_block& next_block)
flat_set
<
public_key_type
>
chain_controller
::
get_required_keys
(
const
signed_transaction
&
trx
,
const
flat_set
<
public_key_type
>&
candidate_keys
)
const
{
auto
checker
=
make_auth_checker
(
[
&
](
auto
p
){
return
get_permission
(
p
).
auth
;
},
auto
checker
=
make_auth_checker
(
[
&
](
const
permission_level
&
p
){
return
get_permission
(
p
).
auth
;
},
get_global_properties
().
configuration
.
max_authority_depth
,
candidate_keys
);
...
...
@@ -652,7 +652,7 @@ void chain_controller::check_authorization( const vector<action>& actions,
bool
allow_unused_signatures
,
flat_set
<
account_name
>
provided_accounts
)
const
{
auto
checker
=
make_auth_checker
(
[
&
](
auto
p
){
return
get_permission
(
p
).
auth
;
},
auto
checker
=
make_auth_checker
(
[
&
](
const
permission_level
&
p
){
return
get_permission
(
p
).
auth
;
},
get_global_properties
().
configuration
.
max_authority_depth
,
provided_keys
,
provided_accounts
);
...
...
libraries/chain/contracts/chain_initializer.cpp
浏览文件 @
ec58b685
...
...
@@ -147,7 +147,7 @@ abi_def chain_initializer::eos_contract_abi()
{
"account"
,
"account_name"
},
{
"permission"
,
"permission_name"
},
{
"parent"
,
"permission_name"
},
{
"
authority
"
,
"authority"
},
{
"
data
"
,
"authority"
},
}
});
...
...
libraries/chain/contracts/eosio_contract.cpp
浏览文件 @
ec58b685
...
...
@@ -415,8 +415,8 @@ void apply_eosio_updateauth(apply_context& context) {
EOS_ASSERT
(
!
update
.
permission
.
empty
(),
action_validate_exception
,
"Cannot create authority with empty name"
);
EOS_ASSERT
(
update
.
permission
!=
update
.
parent
,
action_validate_exception
,
"Cannot set an authority as its own parent"
);
EOS_ASSERT
(
validate
(
update
.
authority
),
action_validate_exception
,
"Invalid authority: ${auth}"
,
(
"auth"
,
update
.
authority
));
EOS_ASSERT
(
validate
(
update
.
data
),
action_validate_exception
,
"Invalid authority: ${auth}"
,
(
"auth"
,
update
.
data
));
if
(
update
.
permission
==
"active"
)
EOS_ASSERT
(
update
.
parent
==
"owner"
,
action_validate_exception
,
"Cannot change active authority's parent from owner"
,
(
"update.parent"
,
update
.
parent
)
);
if
(
update
.
permission
==
"owner"
)
...
...
@@ -426,7 +426,7 @@ void apply_eosio_updateauth(apply_context& context) {
context
.
require_authorization
(
update
.
account
);
db
.
get
<
account_object
,
by_name
>
(
update
.
account
);
validate_authority_precondition
(
context
,
update
.
authority
);
validate_authority_precondition
(
context
,
update
.
data
);
auto
permission
=
db
.
find
<
permission_object
,
by_owner
>
(
boost
::
make_tuple
(
update
.
account
,
update
.
permission
));
...
...
@@ -443,7 +443,7 @@ void apply_eosio_updateauth(apply_context& context) {
// TODO/QUESTION: If we are updating an existing permission, should we check if the message declared
// permission satisfies the permission we want to modify?
db
.
modify
(
*
permission
,
[
&
update
,
&
parent_id
](
permission_object
&
po
)
{
po
.
auth
=
update
.
authority
;
po
.
auth
=
update
.
data
;
po
.
parent
=
parent_id
;
});
}
else
{
...
...
@@ -452,7 +452,7 @@ void apply_eosio_updateauth(apply_context& context) {
db
.
create
<
permission_object
>
([
&
update
,
&
parent_id
](
permission_object
&
po
)
{
po
.
name
=
update
.
permission
;
po
.
owner
=
update
.
account
;
po
.
auth
=
update
.
authority
;
po
.
auth
=
update
.
data
;
po
.
parent
=
parent_id
;
});
}
...
...
libraries/chain/include/eosio/chain/contracts/abi_serializer.hpp
浏览文件 @
ec58b685
...
...
@@ -92,33 +92,48 @@ namespace impl {
* @tparam T - the type to check
*/
template
<
typename
T
>
constexpr
bool
single_type_requires_abi_v
=
std
::
is_base_of
<
transaction
,
T
>::
value
||
std
::
is_same
<
T
,
action
>::
value
||
std
::
is_same
<
T
,
transaction_trace
>::
value
||
std
::
is_same
<
T
,
action_trace
>::
value
;
constexpr
bool
single_type_requires_abi_v
()
{
return
std
::
is_base_of
<
transaction
,
T
>::
value
||
std
::
is_same
<
T
,
action
>::
value
||
std
::
is_same
<
T
,
transaction_trace
>::
value
||
std
::
is_same
<
T
,
action_trace
>::
value
;
}
/**
* Basic constexpr for a type, aliases the basic check directly
* @tparam T - the type to check
*/
template
<
typename
T
>
constexpr
bool
type_requires_abi_v
=
single_type_requires_abi_v
<
T
>
;
struct
type_requires_abi
{
static
constexpr
bool
value
()
{
return
single_type_requires_abi_v
<
T
>
();
}
};
/**
* specialization that catches common container patterns and checks their contained-type
* @tparam Container - a templated container type whose first argument is the contained type
*/
template
<
template
<
typename
...
>
class
Container
,
typename
T
,
typename
...
Args
>
constexpr
bool
type_requires_abi_v
<
Container
<
T
,
Args
...
>>
=
single_type_requires_abi_v
<
T
>
;
struct
type_requires_abi
<
Container
<
T
,
Args
...
>>
{
static
constexpr
bool
value
()
{
return
single_type_requires_abi_v
<
T
>
();
}
};
template
<
typename
T
>
constexpr
bool
type_requires_abi_v
()
{
return
type_requires_abi
<
T
>::
value
();
}
/**
* convenience aliases for creating overload-guards based on whether the type contains ABI related info
*/
template
<
typename
T
>
using
not_require_abi_t
=
std
::
enable_if_t
<!
type_requires_abi_v
<
T
>
,
int
>
;
using
not_require_abi_t
=
std
::
enable_if_t
<!
type_requires_abi_v
<
T
>
()
,
int
>
;
template
<
typename
T
>
using
require_abi_t
=
std
::
enable_if_t
<
type_requires_abi_v
<
T
>
,
int
>
;
using
require_abi_t
=
std
::
enable_if_t
<
type_requires_abi_v
<
T
>
()
,
int
>
;
/**
* Reflection visitor that uses a resolver to resolve ABIs for nested types
...
...
libraries/chain/include/eosio/chain/contracts/genesis_state.hpp
浏览文件 @
ec58b685
...
...
@@ -50,9 +50,11 @@ struct genesis_state_type {
.
max_block_acts_per_scope
=
config
::
default_max_block_acts_per_scope
,
.
target_block_acts
=
config
::
default_target_block_acts
,
.
max_block_acts
=
config
::
default_max_block_acts
,
.
real_threads
=
0
,
// TODO: unused?
.
max_storage_size
=
config
::
default_max_storage_size
,
.
max_transaction_lifetime
=
config
::
default_max_trx_lifetime
,
.
max_authority_depth
=
config
::
default_max_auth_depth
,
.
max_transaction_exec_time
=
0
,
// TODO: unused?
.
max_inline_depth
=
config
::
default_max_inline_depth
,
.
max_inline_action_size
=
config
::
default_max_inline_action_size
,
.
max_generated_transaction_size
=
config
::
default_max_gen_trx_size
...
...
libraries/chain/include/eosio/chain/contracts/types.hpp
浏览文件 @
ec58b685
...
...
@@ -299,7 +299,7 @@ struct updateauth {
account_name
account
;
permission_name
permission
;
permission_name
parent
;
authority
authority
;
authority
data
;
static
scope_name
get_scope
()
{
return
config
::
system_account_name
;
...
...
@@ -410,7 +410,7 @@ FC_REFLECT( eosio::chain::contracts::setabi , (account
FC_REFLECT
(
eosio
::
chain
::
contracts
::
setproducer
,
(
name
)(
key
)(
configuration
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
okproducer
,
(
voter
)(
producer
)(
approve
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
setproxy
,
(
stakeholder
)(
proxy
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
updateauth
,
(
account
)(
permission
)(
parent
)(
authority
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
updateauth
,
(
account
)(
permission
)(
parent
)(
data
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
deleteauth
,
(
account
)(
permission
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
linkauth
,
(
account
)(
code
)(
type
)(
requirement
)
)
FC_REFLECT
(
eosio
::
chain
::
contracts
::
unlinkauth
,
(
account
)(
code
)(
type
)
)
...
...
libraries/chain/wasm_interface.cpp
浏览文件 @
ec58b685
...
...
@@ -130,6 +130,10 @@ namespace eosio { namespace chain {
* the instance handed out to other threads
*/
struct
code_info
{
code_info
(
size_t
mem_end
,
vector
<
char
>&&
mem_image
)
:
mem_end
(
mem_end
),
mem_image
(
std
::
forward
<
vector
<
char
>>
(
mem_image
))
{}
// a clean image of the memory used to sanitize things on checkin
size_t
mem_start
=
0
;
size_t
mem_end
=
1
<<
16
;
...
...
@@ -249,10 +253,7 @@ namespace eosio { namespace chain {
// grab the lock and put this in the cache as unavailble
with_lock
([
&
,
this
]()
{
// find or create a new entry
auto
iter
=
_cache
.
emplace
(
code_id
,
code_info
{
.
mem_end
=
mem_end
,
.
mem_image
=
std
::
move
(
mem_image
)
}).
first
;
auto
iter
=
_cache
.
emplace
(
code_id
,
std
::
move
(
code_info
(
mem_end
,
std
::
move
(
mem_image
)))).
first
;
iter
->
second
.
instances
.
emplace_back
(
std
::
make_unique
<
wasm_cache
::
entry
>
(
instance
,
module
));
pending_result
=
optional_entry_ref
(
*
iter
->
second
.
instances
.
back
().
get
());
...
...
libraries/fc/include/fc/crypto/common.hpp
浏览文件 @
ec58b685
...
...
@@ -82,7 +82,7 @@ namespace fc { namespace crypto {
template
<
typename
KeyType
>
std
::
string
operator
()(
const
KeyType
&
key
)
const
{
using
data_type
=
typename
KeyType
::
data_type
;
constexpr
int
position
=
Storage
::
template
position
<
KeyType
>;
constexpr
int
position
=
Storage
::
template
position
<
KeyType
>
()
;
constexpr
bool
is_default
=
position
==
DefaultPosition
;
checksummed_data
<
data_type
>
wrapper
;
...
...
libraries/fc/include/fc/static_variant.hpp
浏览文件 @
ec58b685
...
...
@@ -353,7 +353,7 @@ public:
bool
contains
()
const
{
return
which
()
==
tag
<
X
>::
value
;
}
template
<
typename
X
>
static
constexpr
int
position
=
impl
::
position
<
X
,
Types
...
>::
pos
;
static
constexpr
int
position
()
{
return
impl
::
position
<
X
,
Types
...
>::
pos
;
}
template
<
int
Pos
,
std
::
enable_if_t
<
Pos
<
impl
::
type_info
<
Types
...>
::
size
,
int
>
=
1
>
using
type_at
=
typename
impl
::
type_at
<
Pos
,
Types
...
>::
type
;
...
...
libraries/testing/tester.cpp
浏览文件 @
ec58b685
...
...
@@ -148,8 +148,8 @@ namespace eosio { namespace testing {
contracts
::
updateauth
{
.
account
=
account
,
.
permission
=
perm
,
.
authority
=
move
(
auth
)
,
.
parent
=
parent
.
parent
=
parent
,
.
data
=
move
(
auth
),
});
set_tapos
(
trx
);
...
...
plugins/account_history_plugin/account_history_plugin.cpp
浏览文件 @
ec58b685
...
...
@@ -333,10 +333,10 @@ void account_history_plugin_impl::applied_block(const signed_block& block)
{
const
auto
update
=
msg
.
as
<
types
::
updateauth
>
();
remove
<
public_key_history_multi_index
,
by_account_permission
>
(
db
,
update
.
account
,
update
.
permission
);
add
(
db
,
update
.
authority
.
keys
,
update
.
account
,
update
.
permission
);
add
(
db
,
update
.
data
.
keys
,
update
.
account
,
update
.
permission
);
remove
<
account_control_history_multi_index
,
by_controlled_authority
>
(
db
,
update
.
account
,
update
.
permission
);
add
(
db
,
update
.
authority
.
accounts
,
update
.
account
,
update
.
permission
);
add
(
db
,
update
.
data
.
accounts
,
update
.
account
,
update
.
permission
);
}
else
if
(
msg
.
type
==
DELETE_AUTH
)
{
...
...
plugins/producer_plugin/producer_plugin.cpp
浏览文件 @
ec58b685
...
...
@@ -184,7 +184,7 @@ void producer_plugin_impl::schedule_production_loop() {
//_timer.expires_from_now(boost::posix_time::microseconds(time_to_next_block_time));
_timer
.
expires_from_now
(
boost
::
posix_time
::
microseconds
(
time_to_next_block_time
)
);
//_timer.async_wait(boost::bind(&producer_plugin_impl::block_production_loop, this));
_timer
.
async_wait
(
[
&
](
auto
){
block_production_loop
();
}
);
_timer
.
async_wait
(
[
&
](
const
boost
::
system
::
error_code
&
){
block_production_loop
();
}
);
}
block_production_condition
::
block_production_condition_enum
producer_plugin_impl
::
block_production_loop
()
{
...
...
plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
浏览文件 @
ec58b685
...
...
@@ -144,7 +144,7 @@ struct txn_test_gen_plugin_impl {
void
arm_timer
(
boost
::
asio
::
high_resolution_timer
::
time_point
s
)
{
timer
.
expires_at
(
s
+
std
::
chrono
::
milliseconds
(
timer_timeout
));
timer
.
async_wait
([
this
](
auto
ec
)
{
timer
.
async_wait
([
this
](
const
boost
::
system
::
error_code
&
ec
)
{
if
(
ec
)
return
;
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录