Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
48ce6805
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,发现更多精彩内容 >>
未验证
提交
48ce6805
编写于
9月 17, 2018
作者:
T
Todd Fleming
提交者:
GitHub
9月 17, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5673 from EOSIO/abi-no-default-version
abi_def: don't default version
上级
2d7ba0be
8db85257
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
8 deletion
+42
-8
contracts/identity/test/identity_test.abi
contracts/identity/test/identity_test.abi
+1
-0
contracts/payloadless/payloadless.abi
contracts/payloadless/payloadless.abi
+1
-0
contracts/test_ram_limit/test_ram_limit.abi
contracts/test_ram_limit/test_ram_limit.abi
+1
-0
libraries/chain/include/eosio/chain/abi_def.hpp
libraries/chain/include/eosio/chain/abi_def.hpp
+2
-3
programs/eosio-abigen/main.cpp
programs/eosio-abigen/main.cpp
+1
-0
unittests/abi_tests.cpp
unittests/abi_tests.cpp
+36
-5
未找到文件。
contracts/identity/test/identity_test.abi
浏览文件 @
48ce6805
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
...
...
contracts/payloadless/payloadless.abi
浏览文件 @
48ce6805
{
"version": "eosio::abi/1.0",
"____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-04-19T09:07:16",
"types": [],
"structs": [{
...
...
contracts/test_ram_limit/test_ram_limit.abi
浏览文件 @
48ce6805
{
"____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-03-29T02:09:11",
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
...
...
libraries/chain/include/eosio/chain/abi_def.hpp
浏览文件 @
48ce6805
...
...
@@ -107,8 +107,7 @@ struct may_not_exist {
struct
abi_def
{
abi_def
()
=
default
;
abi_def
(
const
vector
<
type_def
>&
types
,
const
vector
<
struct_def
>&
structs
,
const
vector
<
action_def
>&
actions
,
const
vector
<
table_def
>&
tables
,
const
vector
<
clause_pair
>&
clauses
,
const
vector
<
error_message
>&
error_msgs
)
:
version
(
"eosio::abi/1.1"
)
,
types
(
types
)
:
types
(
types
)
,
structs
(
structs
)
,
actions
(
actions
)
,
tables
(
tables
)
...
...
@@ -116,7 +115,7 @@ struct abi_def {
,
error_messages
(
error_msgs
)
{}
string
version
=
"
eosio::abi/1.1
"
;
string
version
=
""
;
vector
<
type_def
>
types
;
vector
<
struct_def
>
structs
;
vector
<
action_def
>
actions
;
...
...
programs/eosio-abigen/main.cpp
浏览文件 @
48ce6805
...
...
@@ -86,6 +86,7 @@ int main(int argc, const char **argv) { abi_def output; try {
vector
<
string
>
actions
;
int
result
=
Tool
.
run
(
create_find_macro_factory
(
contract
,
actions
,
abi_context
).
get
());
if
(
!
result
)
{
output
.
version
=
"eosio::abi/1.0"
;
result
=
Tool
.
run
(
create_factory
(
abi_verbose
,
abi_opt_sfs
,
abi_context
,
output
,
contract
,
actions
).
get
());
if
(
!
result
)
{
abi_serializer
abis
(
output
,
fc
::
seconds
(
1
));
// No risk to client side serialization taking a long time
...
...
unittests/abi_tests.cpp
浏览文件 @
48ce6805
...
...
@@ -495,6 +495,7 @@ BOOST_AUTO_TEST_CASE(uint_types)
const
char
*
currency_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "transfer",
...
...
@@ -556,6 +557,7 @@ struct abi_gen_helper {
std
::
string
stdc_include_param
=
std
::
string
(
"-I"
)
+
eosiolib_path
+
"/musl/upstream/include"
;
abi_def
output
;
output
.
version
=
"eosio::abi/1.0"
;
std
::
string
contract
;
std
::
vector
<
std
::
string
>
actions
;
...
...
@@ -662,6 +664,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_all_types, abi_gen_helper)
const
char
*
all_types_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "test_struct",
...
...
@@ -809,6 +812,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_double_action, abi_gen_helper)
const
char
*
double_action_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name" : "A",
...
...
@@ -870,7 +874,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_all_indexes, abi_gen_helper)
const
char
*
all_indexes_abi
=
R"=====(
{
"version": "eosio::abi/1.
1
",
"version": "eosio::abi/1.
0
",
"types": [],
"structs": [{
"name": "table1",
...
...
@@ -1027,6 +1031,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_full_table_decl, abi_gen_helper)
const
char
*
full_table_decl_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name" : "table1",
...
...
@@ -1125,6 +1130,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_template_base, abi_gen_helper)
const
char
*
template_base_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name" : "base32",
...
...
@@ -1180,6 +1186,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_action_and_table, abi_gen_helper)
const
char
*
action_and_table_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name" : "table_action",
...
...
@@ -1239,6 +1246,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_simple_typedef, abi_gen_helper)
const
char
*
simple_typedef_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name" : "my_base_alias",
"type" : "common_params"
...
...
@@ -1305,6 +1313,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_field_typedef, abi_gen_helper)
const
char
*
field_typedef_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name" : "my_complex_field_alias",
"type" : "complex_field"
...
...
@@ -1380,6 +1389,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_vector_of_POD, abi_gen_helper)
const
char
*
abigen_vector_of_POD_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "table1",
...
...
@@ -1453,6 +1463,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_vector_of_structs, abi_gen_helper)
const
char
*
abigen_vector_of_structs_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "my_struct",
...
...
@@ -1558,6 +1569,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_vector_alias, abi_gen_helper)
const
char
*
abigen_vector_alias_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "array_of_rows",
"type": "row[]"
...
...
@@ -1634,6 +1646,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_eosioabi_macro, abi_gen_helper)
const
char
*
abigen_eosioabi_macro_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "hi",
...
...
@@ -1696,6 +1709,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_contract_inheritance, abi_gen_helper)
const
char
*
abigen_contract_inheritance_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "hi",
...
...
@@ -1777,7 +1791,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_no_eosioabi_macro, abi_gen_helper)
const
char
*
abigen_no_eosioabi_macro_abi
=
R"=====(
{
"version": "eosio::abi/1.
1
",
"version": "eosio::abi/1.
0
",
"types": [],
"structs": [{
"name": "hi",
...
...
@@ -2047,6 +2061,7 @@ BOOST_AUTO_TEST_CASE(abi_cycle)
const
char
*
struct_cycle_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "A",
...
...
@@ -2783,6 +2798,7 @@ BOOST_AUTO_TEST_CASE(packed_transaction)
const
char
*
packed_transaction_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "compression_type",
"type": "int64"
...
...
@@ -2865,6 +2881,7 @@ BOOST_AUTO_TEST_CASE(abi_type_repeat)
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "actor_name",
"type": "name"
...
...
@@ -2925,6 +2942,7 @@ BOOST_AUTO_TEST_CASE(abi_struct_repeat)
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "actor_name",
"type": "name"
...
...
@@ -2981,6 +2999,7 @@ BOOST_AUTO_TEST_CASE(abi_action_repeat)
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "actor_name",
"type": "name"
...
...
@@ -3040,6 +3059,7 @@ BOOST_AUTO_TEST_CASE(abi_table_repeat)
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "actor_name",
"type": "name"
...
...
@@ -3102,6 +3122,7 @@ BOOST_AUTO_TEST_CASE(abi_type_def)
// inifinite loop in types
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
...
...
@@ -3154,6 +3175,7 @@ BOOST_AUTO_TEST_CASE(abi_type_loop)
// inifinite loop in types
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
...
...
@@ -3197,6 +3219,7 @@ BOOST_AUTO_TEST_CASE(abi_type_redefine)
// inifinite loop in types
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "account_name"
...
...
@@ -3237,6 +3260,7 @@ BOOST_AUTO_TEST_CASE(abi_type_redefine_to_name)
// inifinite loop in types
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "name",
"type": "name"
...
...
@@ -3258,6 +3282,7 @@ BOOST_AUTO_TEST_CASE(abi_type_nested_in_vector)
// inifinite loop in types
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "store_t",
...
...
@@ -3283,6 +3308,7 @@ BOOST_AUTO_TEST_CASE(abi_account_name_in_eosio_abi)
// inifinite loop in types
const
char
*
repeat_abi
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
...
...
@@ -3325,6 +3351,7 @@ BOOST_AUTO_TEST_CASE(abi_large_array)
try
{
const
char
*
abi_str
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "hi",
...
...
@@ -3362,6 +3389,7 @@ BOOST_AUTO_TEST_CASE(abi_is_type_recursion)
try
{
const
char
*
abi_str
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [
{
"new_type_name": "a[]",
...
...
@@ -3405,6 +3433,7 @@ BOOST_AUTO_TEST_CASE(abi_recursive_structs)
try
{
const
char
*
abi_str
=
R"=====(
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [
{
...
...
@@ -3500,7 +3529,7 @@ BOOST_AUTO_TEST_CASE(abi_deep_structs_validate)
BOOST_AUTO_TEST_CASE
(
variants
)
{
auto
duplicate_variant_abi
=
R"({
"version": "eosio::abi/1.
0
",
"version": "eosio::abi/1.
1
",
"variants": [
{"name": "v1", "types": ["int8", "string", "bool"]},
{"name": "v1", "types": ["int8", "string", "bool"]},
...
...
@@ -3508,14 +3537,14 @@ BOOST_AUTO_TEST_CASE(variants)
})"
;
auto
variant_abi_invalid_type
=
R"({
"version": "eosio::abi/1.
0
",
"version": "eosio::abi/1.
1
",
"variants": [
{"name": "v1", "types": ["int91", "string", "bool"]},
],
})"
;
auto
variant_abi
=
R"({
"version": "eosio::abi/1.
0
",
"version": "eosio::abi/1.
1
",
"types": [
{"new_type_name": "foo", "type": "s"},
{"new_type_name": "bar", "type": "s"},
...
...
@@ -3566,6 +3595,7 @@ BOOST_AUTO_TEST_CASE(variants)
BOOST_AUTO_TEST_CASE
(
extend
)
{
auto
abi
=
R"({
"version": "eosio::abi/1.1",
"structs": [
{"name": "s", "base": "", "fields": [
{"name": "i0", "type": "int8"},
...
...
@@ -3603,6 +3633,7 @@ BOOST_AUTO_TEST_CASE(extend)
BOOST_AUTO_TEST_CASE
(
version
)
{
try
{
BOOST_CHECK_THROW
(
abi_serializer
(
fc
::
json
::
from_string
(
R"({})"
).
as
<
abi_def
>
(),
max_serialization_time
),
unsupported_abi_version_exception
);
BOOST_CHECK_THROW
(
abi_serializer
(
fc
::
json
::
from_string
(
R"({"version": ""})"
).
as
<
abi_def
>
(),
max_serialization_time
),
unsupported_abi_version_exception
);
BOOST_CHECK_THROW
(
abi_serializer
(
fc
::
json
::
from_string
(
R"({"version": "eosio::abi/9.0"})"
).
as
<
abi_def
>
(),
max_serialization_time
),
unsupported_abi_version_exception
);
abi_serializer
(
fc
::
json
::
from_string
(
R"({"version": "eosio::abi/1.0"})"
).
as
<
abi_def
>
(),
max_serialization_time
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录