Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
d2574cfa
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,发现更多精彩内容 >>
提交
d2574cfa
编写于
11月 11, 2017
作者:
K
Kevin Heifner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix for gcc compiler errors #665
上级
688593d2
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
82 addition
and
78 deletion
+82
-78
libraries/chain/chain_controller.cpp
libraries/chain/chain_controller.cpp
+3
-3
libraries/native_contract/eos_contract.cpp
libraries/native_contract/eos_contract.cpp
+7
-7
libraries/types/abi_serializer.cpp
libraries/types/abi_serializer.cpp
+2
-2
libraries/types/include/eos/types/abi_serializer.hpp
libraries/types/include/eos/types/abi_serializer.hpp
+1
-1
libraries/types/types.eos
libraries/types/types.eos
+4
-4
plugins/account_history_plugin/account_history_plugin.cpp
plugins/account_history_plugin/account_history_plugin.cpp
+2
-2
plugins/chain_plugin/chain_plugin.cpp
plugins/chain_plugin/chain_plugin.cpp
+8
-8
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
...ns/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
+11
-11
plugins/db_plugin/db_plugin.cpp
plugins/db_plugin/db_plugin.cpp
+7
-3
programs/eosc/main.cpp
programs/eosc/main.cpp
+4
-4
tests/api_tests/api_tests.cpp
tests/api_tests/api_tests.cpp
+1
-1
tests/tests/abi_tests.cpp
tests/tests/abi_tests.cpp
+32
-32
未找到文件。
libraries/chain/chain_controller.cpp
浏览文件 @
d2574cfa
...
...
@@ -1564,9 +1564,9 @@ processed_transaction chain_controller::transaction_from_variant( const fc::vari
result
.
messages
[
i
].
data
=
message_to_binary
(
result
.
messages
[
i
].
code
,
result
.
messages
[
i
].
type
,
data
);
/*
const auto& code_account = _db.get<account_object,by_name>( result.messages[i].code );
eosio::types::abi abi;
if( abi_serializer::to_abi(code_account.
abi,
abi) ) {
types::abi_serializer abis( abi );
eosio::types::abi
code_
abi;
if( abi_serializer::to_abi(code_account.
code_abi, code_
abi) ) {
types::abi_serializer abis(
code_
abi );
result.messages[i].data = abis.variant_to_binary( abis.get_action_type( result.messages[i].type ), data );
}
*/
...
...
libraries/native_contract/eos_contract.cpp
浏览文件 @
d2574cfa
...
...
@@ -197,7 +197,7 @@ void apply_eos_setcode(apply_context& context) {
/// if an ABI is specified make sure it is well formed and doesn't
/// reference any undefined types
abi_serializer
(
msg
.
abi
).
validate
();
abi_serializer
(
msg
.
code_
abi
).
validate
();
const
auto
&
account
=
db
.
get
<
account_object
,
by_name
>
(
msg
.
account
);
...
...
@@ -209,7 +209,7 @@ void apply_eos_setcode(apply_context& context) {
a
.
code
.
resize
(
msg
.
code
.
size
()
);
memcpy
(
a
.
code
.
data
(),
msg
.
code
.
data
(),
msg
.
code
.
size
()
);
a
.
set_abi
(
msg
.
abi
);
a
.
set_abi
(
msg
.
code_
abi
);
});
apply_context
init_context
(
context
.
mutable_controller
,
context
.
mutable_db
,
context
.
trx
,
context
.
msg
,
msg
.
account
);
...
...
@@ -370,8 +370,8 @@ void apply_eos_updateauth(apply_context& context) {
EOS_ASSERT
(
!
update
.
permission
.
empty
(),
message_validate_exception
,
"Cannot create authority with empty name"
);
EOS_ASSERT
(
update
.
permission
!=
update
.
parent
,
message_validate_exception
,
"Cannot set an authority as its own parent"
);
EOS_ASSERT
(
validate
(
update
.
authority
),
message_validate_exception
,
"Invalid authority: ${auth}"
,
(
"auth"
,
update
.
authority
));
EOS_ASSERT
(
validate
(
update
.
new_
authority
),
message_validate_exception
,
"Invalid authority: ${auth}"
,
(
"auth"
,
update
.
new_
authority
));
if
(
update
.
permission
==
"active"
)
EOS_ASSERT
(
update
.
parent
==
"owner"
,
message_validate_exception
,
"Cannot change active authority's parent"
);
if
(
update
.
permission
==
"owner"
)
...
...
@@ -381,7 +381,7 @@ void apply_eos_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
.
new_
authority
);
auto
permission
=
db
.
find
<
permission_object
,
by_owner
>
(
boost
::
make_tuple
(
update
.
account
,
update
.
permission
));
...
...
@@ -398,7 +398,7 @@ void apply_eos_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
.
new_
authority
;
po
.
parent
=
parent_id
;
});
}
else
if
(
context
.
controller
.
is_applying_block
())
{
...
...
@@ -407,7 +407,7 @@ void apply_eos_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
.
new_
authority
;
po
.
parent
=
parent_id
;
});
}
...
...
libraries/types/abi_serializer.cpp
浏览文件 @
d2574cfa
...
...
@@ -39,7 +39,7 @@ namespace eosio { namespace types {
abi_serializer
::
abi_serializer
(
const
abi
&
abi
)
{
configure_built_in_types
();
set
A
bi
(
abi
);
set
_a
bi
(
abi
);
}
void
abi_serializer
::
configure_built_in_types
()
{
...
...
@@ -98,7 +98,7 @@ namespace eosio { namespace types {
built_in_types
.
emplace
(
"abi"
,
packUnpack
<
abi
>
());
}
void
abi_serializer
::
set
Abi
(
const
abi
&
abi
)
{
void
abi_serializer
::
set
_abi
(
const
abi
&
abi
)
{
typedefs
.
clear
();
structs
.
clear
();
actions
.
clear
();
...
...
libraries/types/include/eos/types/abi_serializer.hpp
浏览文件 @
d2574cfa
...
...
@@ -19,7 +19,7 @@ using std::pair;
struct
abi_serializer
{
abi_serializer
(){
configure_built_in_types
();
}
abi_serializer
(
const
abi
&
abi
);
void
set
Abi
(
const
abi
&
abi
);
void
set
_abi
(
const
abi
&
abi
);
map
<
type_name
,
type_name
>
typedefs
;
map
<
type_name
,
struct_t
>
structs
;
...
...
libraries/types/types.eos
浏览文件 @
d2574cfa
...
...
@@ -104,10 +104,10 @@ struct newaccount
struct setcode
account account_name # the account that is handling the message
vm_type
uint8 # the virtual machine type
vm_version
uint8 # the virtual machine version
vm_type uint8 # the virtual machine type
vm_version uint8 # the virtual machine version
code bytes # the apply
abi
abi # the interface description of the code
code_abi
abi # the interface description of the code
struct setproducer
...
...
@@ -130,7 +130,7 @@ struct updateauth
account account_name
permission permission_name
parent permission_name
authority authority
new_
authority authority
struct deleteauth
account account_name
...
...
plugins/account_history_plugin/account_history_plugin.cpp
浏览文件 @
d2574cfa
...
...
@@ -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
.
new_
authority
.
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
.
new_
authority
.
accounts
,
update
.
account
,
update
.
permission
);
}
else
if
(
msg
.
type
==
DELETE_AUTH
)
{
...
...
plugins/chain_plugin/chain_plugin.cpp
浏览文件 @
d2574cfa
...
...
@@ -338,7 +338,7 @@ read_only::get_table_rows_result read_only::get_table_rows( const read_only::get
if
(
table_key
==
TERTIARY
)
return
get_table_rows_ex
<
chain
::
key64x64x64_value_index
,
chain
::
by_scope_tertiary
>
(
p
,
abi
);
}
FC_ASSERT
(
false
,
"invalid table type/key ${type}/${key}"
,
(
"type"
,
table_type
)(
"key"
,
table_key
)(
"abi"
,
abi
));
FC_ASSERT
(
false
,
"invalid table type/key ${type}/${key}"
,
(
"type"
,
table_type
)(
"key"
,
table_key
)(
"
code_
abi"
,
abi
));
}
read_only
::
get_block_results
read_only
::
get_block
(
const
read_only
::
get_block_params
&
params
)
const
{
...
...
@@ -385,9 +385,9 @@ read_write::push_transactions_results read_write::push_transactions(const read_w
read_only
::
get_code_results
read_only
::
get_code
(
const
get_code_params
&
params
)
const
{
get_code_results
result
;
result
.
name
=
params
.
name
;
result
.
account_name
=
params
.
account_
name
;
const
auto
&
d
=
db
.
get_database
();
const
auto
&
accnt
=
d
.
get
<
account_object
,
by_name
>
(
params
.
name
);
const
auto
&
accnt
=
d
.
get
<
account_object
,
by_name
>
(
params
.
account_
name
);
if
(
accnt
.
code
.
size
()
)
{
result
.
wast
=
chain
::
wasm_to_wast
(
(
const
uint8_t
*
)
accnt
.
code
.
data
(),
accnt
.
code
.
size
()
);
...
...
@@ -404,11 +404,11 @@ read_only::get_account_results read_only::get_account( const get_account_params&
using
namespace
native
::
eosio
;
get_account_results
result
;
result
.
name
=
params
.
name
;
result
.
account_name
=
params
.
account_
name
;
const
auto
&
d
=
db
.
get_database
();
const
auto
&
balance
=
d
.
get
<
balance_object
,
by_owner_name
>
(
params
.
name
);
const
auto
&
staked_balance
=
d
.
get
<
staked_balance_object
,
by_owner_name
>
(
params
.
name
);
const
auto
&
balance
=
d
.
get
<
balance_object
,
by_owner_name
>
(
params
.
account_
name
);
const
auto
&
staked_balance
=
d
.
get
<
staked_balance_object
,
by_owner_name
>
(
params
.
account_
name
);
result
.
eos_balance
=
asset
(
balance
.
balance
,
EOS_SYMBOL
);
result
.
staked_balance
=
asset
(
staked_balance
.
staked_balance
);
...
...
@@ -416,8 +416,8 @@ read_only::get_account_results read_only::get_account( const get_account_params&
result
.
last_unstaking_time
=
staked_balance
.
last_unstaking_time
;
const
auto
&
permissions
=
d
.
get_index
<
permission_index
,
by_owner
>
();
auto
perm
=
permissions
.
lower_bound
(
boost
::
make_tuple
(
params
.
name
)
);
while
(
perm
!=
permissions
.
end
()
&&
perm
->
owner
==
params
.
name
)
{
auto
perm
=
permissions
.
lower_bound
(
boost
::
make_tuple
(
params
.
account_
name
)
);
while
(
perm
!=
permissions
.
end
()
&&
perm
->
owner
==
params
.
account_
name
)
{
/// TODO: lookup perm->parent name
name
parent
;
...
...
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
浏览文件 @
d2574cfa
...
...
@@ -64,12 +64,12 @@ public:
get_info_results
get_info
(
const
get_info_params
&
)
const
;
struct
producer_info
{
name
name
;
name
producer_
name
;
};
struct
get_account_results
{
name
name
;
name
account_
name
;
asset
eos_balance
=
asset
(
0
,
EOS_SYMBOL
);
asset
staked_balance
;
asset
unstaking_balance
;
...
...
@@ -78,20 +78,20 @@ public:
optional
<
producer_info
>
producer
;
};
struct
get_account_params
{
name
name
;
name
account_
name
;
};
get_account_results
get_account
(
const
get_account_params
&
params
)
const
;
struct
get_code_results
{
name
name
;
name
account_
name
;
string
wast
;
fc
::
sha256
code_hash
;
optional
<
types
::
abi
>
abi
;
};
struct
get_code_params
{
name
name
;
name
account_
name
;
};
get_code_results
get_code
(
const
get_code_params
&
params
)
const
;
...
...
@@ -209,7 +209,7 @@ public:
const
auto
&
d
=
db
.
get_database
();
types
::
abi_serializer
abis
;
abis
.
set
A
bi
(
abi
);
abis
.
set
_a
bi
(
abi
);
const
auto
&
idx
=
d
.
get_index
<
IndexType
,
Scope
>
();
auto
lower
=
idx
.
lower_bound
(
boost
::
make_tuple
(
p
.
scope
,
p
.
code
,
p
.
table
)
);
...
...
@@ -321,11 +321,11 @@ FC_REFLECT( eosio::chain_apis::read_write::push_transaction_results, (transactio
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_table_rows_params
,
(
json
)(
table_key
)(
scope
)(
code
)(
table
)(
lower_bound
)(
upper_bound
)(
limit
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_table_rows_result
,
(
rows
)(
more
)
);
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_account_results
,
(
name
)(
eos_balance
)(
staked_balance
)(
unstaking_balance
)(
last_unstaking_time
)(
permissions
)(
producer
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_code_results
,
(
name
)(
code_hash
)(
wast
)(
abi
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_account_params
,
(
name
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_code_params
,
(
name
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
producer_info
,
(
name
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_account_results
,
(
account_
name
)(
eos_balance
)(
staked_balance
)(
unstaking_balance
)(
last_unstaking_time
)(
permissions
)(
producer
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_code_results
,
(
account_
name
)(
code_hash
)(
wast
)(
abi
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_account_params
,
(
account_
name
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_code_params
,
(
account_
name
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
producer_info
,
(
producer_
name
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
abi_json_to_bin_params
,
(
code
)(
action
)(
args
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
abi_json_to_bin_result
,
(
binargs
)(
required_scope
)(
required_auth
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
abi_bin_to_json_params
,
(
code
)(
action
)(
binargs
)
)
...
...
plugins/db_plugin/db_plugin.cpp
浏览文件 @
d2574cfa
...
...
@@ -190,11 +190,11 @@ namespace {
try
{
types
::
abi_serializer
abis
;
if
(
msg
.
code
==
config
::
eos_contract_name
)
{
abis
.
set
A
bi
(
db_plugin_impl
::
eos_abi
);
abis
.
set
_a
bi
(
db_plugin_impl
::
eos_abi
);
}
else
{
auto
from_account
=
find_account
(
accounts
,
msg
.
code
);
auto
abi
=
fc
::
json
::
from_string
(
bsoncxx
::
to_json
(
from_account
.
view
()[
"abi"
].
get_document
())).
as
<
types
::
abi
>
();
abis
.
set
A
bi
(
abi
);
abis
.
set
_a
bi
(
abi
);
}
auto
v
=
abis
.
binary_to_variant
(
abis
.
get_action_type
(
msg
.
type
),
msg
.
data
);
auto
json
=
fc
::
json
::
to_string
(
v
);
...
...
@@ -208,6 +208,10 @@ namespace {
}
}
catch
(
fc
::
exception
&
e
)
{
elog
(
"Unable to convert message.data to ABI type: ${t}, what: ${e}"
,
(
"t"
,
msg
.
type
)(
"e"
,
e
.
to_string
()));
}
catch
(
std
::
exception
&
e
)
{
elog
(
"Unable to convert message.data to ABI type: ${t}, std what: ${e}"
,
(
"t"
,
msg
.
type
)(
"e"
,
e
.
what
()));
}
catch
(...)
{
elog
(
"Unable to convert message.data to ABI type: ${t}"
,
(
"t"
,
msg
.
type
));
}
// if anything went wrong just store raw hex_data
msg_doc
.
append
(
kvp
(
"hex_data"
,
fc
::
variant
(
msg
.
data
).
as_string
()));
...
...
@@ -552,7 +556,7 @@ void db_plugin_impl::update_account(const chain::message& msg) {
document
update_from
{};
update_from
<<
"$set"
<<
open_document
<<
"abi"
<<
bsoncxx
::
from_json
(
fc
::
json
::
to_string
(
setcode
.
abi
))
<<
"abi"
<<
bsoncxx
::
from_json
(
fc
::
json
::
to_string
(
setcode
.
code_
abi
))
<<
"updatedAt"
<<
b_date
{
now
}
<<
close_document
;
...
...
programs/eosc/main.cpp
浏览文件 @
d2574cfa
...
...
@@ -387,7 +387,7 @@ struct set_account_permission_subcommand {
name
parent
;
if
(
parentStr
.
size
()
==
0
)
{
// see if we can auto-determine the proper parent
const
auto
account_result
=
call
(
get_account_func
,
fc
::
mutable_variant_object
(
"name"
,
accountStr
));
const
auto
account_result
=
call
(
get_account_func
,
fc
::
mutable_variant_object
(
"
account_
name"
,
accountStr
));
const
auto
&
existing_permissions
=
account_result
.
get_object
()[
"permissions"
].
get_array
();
auto
permissionPredicate
=
[
this
](
const
auto
&
perm
)
{
return
perm
.
is_object
()
&&
...
...
@@ -540,7 +540,7 @@ int main( int argc, char** argv ) {
getAccount
->
add_option
(
"name"
,
accountName
,
localized
(
"The name of the account to retrieve"
))
->
required
();
getAccount
->
set_callback
([
&
]
{
std
::
cout
<<
fc
::
json
::
to_pretty_string
(
call
(
get_account_func
,
fc
::
mutable_variant_object
(
"name"
,
accountName
)))
fc
::
mutable_variant_object
(
"
account_
name"
,
accountName
)))
<<
std
::
endl
;
});
...
...
@@ -552,7 +552,7 @@ int main( int argc, char** argv ) {
getCode
->
add_option
(
"-c,--code"
,
codeFilename
,
localized
(
"The name of the file to save the contract .wast to"
)
);
getCode
->
add_option
(
"-a,--abi"
,
abiFilename
,
localized
(
"The name of the file to save the contract .abi to"
)
);
getCode
->
set_callback
([
&
]
{
auto
result
=
call
(
get_code_func
,
fc
::
mutable_variant_object
(
"name"
,
accountName
));
auto
result
=
call
(
get_code_func
,
fc
::
mutable_variant_object
(
"
account_
name"
,
accountName
));
std
::
cout
<<
localized
(
"code hash: ${code_hash}"
,
(
"code_hash"
,
result
[
"code_hash"
].
as_string
()))
<<
std
::
endl
;
...
...
@@ -686,7 +686,7 @@ int main( int argc, char** argv ) {
handler
.
account
=
account
;
handler
.
code
.
assign
(
wasm
.
begin
(),
wasm
.
end
());
if
(
abi
->
count
())
handler
.
abi
=
fc
::
json
::
from_file
(
abiPath
).
as
<
types
::
abi
>
();
handler
.
code_
abi
=
fc
::
json
::
from_file
(
abiPath
).
as
<
types
::
abi
>
();
signed_transaction
trx
;
trx
.
scope
=
sort_names
({
config
::
eos_contract_name
,
account
});
...
...
tests/api_tests/api_tests.cpp
浏览文件 @
d2574cfa
...
...
@@ -526,7 +526,7 @@ BOOST_FIXTURE_TEST_CASE(test_case_name, testing_fixture)
#define RUN_CODE_ABI_WITH_TRANSFER(account_name, test_wast, test_abi) \
types::setcode handler; \
handler.
abi = fc::json::from_string(test_abi).as<types::abi>();
\
handler.
code_abi = fc::json::from_string(test_abi).as<types::abi>();
\
RUN_CODE_HANDLER_WITH_TRANSFER(account_name, test_wast)
#define TEST_CASE_RUN_CODE_ABI_W_XFER(test_case_name, account_name, test_wast, test_abi) \
...
...
tests/tests/abi_tests.cpp
浏览文件 @
d2574cfa
...
...
@@ -446,7 +446,7 @@ BOOST_FIXTURE_TEST_CASE(abi_cycle, testing_fixture)
BOOST_CHECK_EXCEPTION
(
abis
.
validate
(),
fc
::
assert_exception
,
is_assert_exception
);
abi
=
fc
::
json
::
from_string
(
struct_cycle_abi
).
as
<
types
::
abi
>
();
abis
.
setA
bi
(
abi
);
abis
.
set_a
bi
(
abi
);
BOOST_CHECK_EXCEPTION
(
abis
.
validate
(),
fc
::
assert_exception
,
is_assert_exception
);
}
FC_LOG_AND_RETHROW
()
}
...
...
@@ -751,7 +751,7 @@ BOOST_FIXTURE_TEST_CASE(updateauth, testing_fixture)
"account" : "updauth.acct",
"permission" : "updauth.prm",
"parent" : "updauth.prnt",
"authority" : {
"
new_
authority" : {
"threshold" : "2147483145",
"keys" : [ {"key" : "EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005},
{"key" : "EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ],
...
...
@@ -767,21 +767,21 @@ BOOST_FIXTURE_TEST_CASE(updateauth, testing_fixture)
BOOST_CHECK_EQUAL
(
"updauth.acct"
,
updateauth
.
account
);
BOOST_CHECK_EQUAL
(
"updauth.prm"
,
updateauth
.
permission
);
BOOST_CHECK_EQUAL
(
"updauth.prnt"
,
updateauth
.
parent
);
BOOST_CHECK_EQUAL
(
2147483145u
,
updateauth
.
authority
.
threshold
);
BOOST_REQUIRE_EQUAL
(
2
,
updateauth
.
authority
.
keys
.
size
());
BOOST_CHECK_EQUAL
(
"EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im"
,
(
std
::
string
)
updateauth
.
authority
.
keys
[
0
].
key
);
BOOST_CHECK_EQUAL
(
57005u
,
updateauth
.
authority
.
keys
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
"EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf"
,
(
std
::
string
)
updateauth
.
authority
.
keys
[
1
].
key
);
BOOST_CHECK_EQUAL
(
57605u
,
updateauth
.
authority
.
keys
[
1
].
weight
);
BOOST_REQUIRE_EQUAL
(
2
,
updateauth
.
authority
.
accounts
.
size
());
BOOST_CHECK_EQUAL
(
"prm.acct1"
,
updateauth
.
authority
.
accounts
[
0
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
"prm.prm1"
,
updateauth
.
authority
.
accounts
[
0
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
53005u
,
updateauth
.
authority
.
accounts
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
"prm.acct2"
,
updateauth
.
authority
.
accounts
[
1
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
"prm.prm2"
,
updateauth
.
authority
.
accounts
[
1
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
53405u
,
updateauth
.
authority
.
accounts
[
1
].
weight
);
BOOST_CHECK_EQUAL
(
2147483145u
,
updateauth
.
new_
authority
.
threshold
);
BOOST_REQUIRE_EQUAL
(
2
,
updateauth
.
new_
authority
.
keys
.
size
());
BOOST_CHECK_EQUAL
(
"EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im"
,
(
std
::
string
)
updateauth
.
new_
authority
.
keys
[
0
].
key
);
BOOST_CHECK_EQUAL
(
57005u
,
updateauth
.
new_
authority
.
keys
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
"EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf"
,
(
std
::
string
)
updateauth
.
new_
authority
.
keys
[
1
].
key
);
BOOST_CHECK_EQUAL
(
57605u
,
updateauth
.
new_
authority
.
keys
[
1
].
weight
);
BOOST_REQUIRE_EQUAL
(
2
,
updateauth
.
new_
authority
.
accounts
.
size
());
BOOST_CHECK_EQUAL
(
"prm.acct1"
,
updateauth
.
new_
authority
.
accounts
[
0
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
"prm.prm1"
,
updateauth
.
new_
authority
.
accounts
[
0
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
53005u
,
updateauth
.
new_
authority
.
accounts
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
"prm.acct2"
,
updateauth
.
new_
authority
.
accounts
[
1
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
"prm.prm2"
,
updateauth
.
new_
authority
.
accounts
[
1
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
53405u
,
updateauth
.
new_
authority
.
accounts
[
1
].
weight
);
auto
var2
=
verify_round_trip_conversion
(
abis
,
"updateauth"
,
var
);
auto
updateauth2
=
var2
.
as
<
eosio
::
types
::
updateauth
>
();
...
...
@@ -789,21 +789,21 @@ BOOST_FIXTURE_TEST_CASE(updateauth, testing_fixture)
BOOST_CHECK_EQUAL
(
updateauth
.
permission
,
updateauth2
.
permission
);
BOOST_CHECK_EQUAL
(
updateauth
.
parent
,
updateauth2
.
parent
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
threshold
,
updateauth2
.
authority
.
threshold
);
BOOST_REQUIRE_EQUAL
(
updateauth
.
authority
.
keys
.
size
(),
updateauth2
.
authority
.
keys
.
size
());
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
keys
[
0
].
key
,
updateauth2
.
authority
.
keys
[
0
].
key
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
keys
[
0
].
weight
,
updateauth2
.
authority
.
keys
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
keys
[
1
].
key
,
updateauth2
.
authority
.
keys
[
1
].
key
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
keys
[
1
].
weight
,
updateauth2
.
authority
.
keys
[
1
].
weight
);
BOOST_REQUIRE_EQUAL
(
updateauth
.
authority
.
accounts
.
size
(),
updateauth2
.
authority
.
accounts
.
size
());
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
accounts
[
0
].
permission
.
account
,
updateauth2
.
authority
.
accounts
[
0
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
accounts
[
0
].
permission
.
permission
,
updateauth2
.
authority
.
accounts
[
0
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
accounts
[
0
].
weight
,
updateauth2
.
authority
.
accounts
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
accounts
[
1
].
permission
.
account
,
updateauth2
.
authority
.
accounts
[
1
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
accounts
[
1
].
permission
.
permission
,
updateauth2
.
authority
.
accounts
[
1
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
updateauth
.
authority
.
accounts
[
1
].
weight
,
updateauth2
.
authority
.
accounts
[
1
].
weight
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
threshold
,
updateauth2
.
new_
authority
.
threshold
);
BOOST_REQUIRE_EQUAL
(
updateauth
.
new_authority
.
keys
.
size
(),
updateauth2
.
new_
authority
.
keys
.
size
());
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
keys
[
0
].
key
,
updateauth2
.
new_
authority
.
keys
[
0
].
key
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
keys
[
0
].
weight
,
updateauth2
.
new_
authority
.
keys
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
keys
[
1
].
key
,
updateauth2
.
new_
authority
.
keys
[
1
].
key
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
keys
[
1
].
weight
,
updateauth2
.
new_
authority
.
keys
[
1
].
weight
);
BOOST_REQUIRE_EQUAL
(
updateauth
.
new_authority
.
accounts
.
size
(),
updateauth2
.
new_
authority
.
accounts
.
size
());
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
accounts
[
0
].
permission
.
account
,
updateauth2
.
new_
authority
.
accounts
[
0
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
accounts
[
0
].
permission
.
permission
,
updateauth2
.
new_
authority
.
accounts
[
0
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
accounts
[
0
].
weight
,
updateauth2
.
new_
authority
.
accounts
[
0
].
weight
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
accounts
[
1
].
permission
.
account
,
updateauth2
.
new_
authority
.
accounts
[
1
].
permission
.
account
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
accounts
[
1
].
permission
.
permission
,
updateauth2
.
new_
authority
.
accounts
[
1
].
permission
.
permission
);
BOOST_CHECK_EQUAL
(
updateauth
.
new_authority
.
accounts
[
1
].
weight
,
updateauth2
.
new_
authority
.
accounts
[
1
].
weight
);
}
FC_LOG_AND_RETHROW
()
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录