@@ -494,6 +494,7 @@ BOOST_AUTO_TEST_CASE(uint_types)
494
494
495
495
const char * currency_abi = R"=====(
496
496
{
497
+ "version": "eosio::abi/1.1",
497
498
"types": [],
498
499
"structs": [{
499
500
"name": "transfer",
@@ -555,6 +556,7 @@ struct abi_gen_helper {
555
556
std::string stdc_include_param = std::string (" -I" ) + eosiolib_path + " /musl/upstream/include" ;
556
557
557
558
abi_def output;
559
+ output.version = " eosio::abi/1.1" ;
558
560
559
561
std::string contract;
560
562
std::vector<std::string> actions;
@@ -661,6 +663,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_all_types, abi_gen_helper)
661
663
662
664
const char * all_types_abi = R"=====(
663
665
{
666
+ "version": "eosio::abi/1.1",
664
667
"types": [],
665
668
"structs": [{
666
669
"name": "test_struct",
@@ -808,6 +811,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_double_action, abi_gen_helper)
808
811
809
812
const char * double_action_abi = R"=====(
810
813
{
814
+ "version": "eosio::abi/1.1",
811
815
"types": [],
812
816
"structs": [{
813
817
"name" : "A",
@@ -1026,6 +1030,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_full_table_decl, abi_gen_helper)
1026
1030
1027
1031
const char * full_table_decl_abi = R"=====(
1028
1032
{
1033
+ "version": "eosio::abi/1.1",
1029
1034
"types": [],
1030
1035
"structs": [{
1031
1036
"name" : "table1",
@@ -1124,6 +1129,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_template_base, abi_gen_helper)
1124
1129
1125
1130
const char * template_base_abi = R"=====(
1126
1131
{
1132
+ "version": "eosio::abi/1.1",
1127
1133
"types": [],
1128
1134
"structs": [{
1129
1135
"name" : "base32",
@@ -1179,6 +1185,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_action_and_table, abi_gen_helper)
1179
1185
1180
1186
const char * action_and_table_abi = R"=====(
1181
1187
{
1188
+ "version": "eosio::abi/1.1",
1182
1189
"types": [],
1183
1190
"structs": [{
1184
1191
"name" : "table_action",
@@ -1238,6 +1245,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_simple_typedef, abi_gen_helper)
1238
1245
1239
1246
const char * simple_typedef_abi = R"=====(
1240
1247
{
1248
+ "version": "eosio::abi/1.1",
1241
1249
"types": [{
1242
1250
"new_type_name" : "my_base_alias",
1243
1251
"type" : "common_params"
@@ -1304,6 +1312,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_field_typedef, abi_gen_helper)
1304
1312
1305
1313
const char * field_typedef_abi = R"=====(
1306
1314
{
1315
+ "version": "eosio::abi/1.1",
1307
1316
"types": [{
1308
1317
"new_type_name" : "my_complex_field_alias",
1309
1318
"type" : "complex_field"
@@ -1379,6 +1388,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_vector_of_POD, abi_gen_helper)
1379
1388
1380
1389
const char * abigen_vector_of_POD_abi = R"=====(
1381
1390
{
1391
+ "version": "eosio::abi/1.1",
1382
1392
"types": [],
1383
1393
"structs": [{
1384
1394
"name": "table1",
@@ -1452,6 +1462,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_vector_of_structs, abi_gen_helper)
1452
1462
1453
1463
const char * abigen_vector_of_structs_abi = R"=====(
1454
1464
{
1465
+ "version": "eosio::abi/1.1",
1455
1466
"types": [],
1456
1467
"structs": [{
1457
1468
"name": "my_struct",
@@ -1557,6 +1568,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_vector_alias, abi_gen_helper)
1557
1568
1558
1569
const char * abigen_vector_alias_abi = R"=====(
1559
1570
{
1571
+ "version": "eosio::abi/1.1",
1560
1572
"types": [{
1561
1573
"new_type_name": "array_of_rows",
1562
1574
"type": "row[]"
@@ -1633,6 +1645,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_eosioabi_macro, abi_gen_helper)
1633
1645
1634
1646
const char * abigen_eosioabi_macro_abi = R"=====(
1635
1647
{
1648
+ "version": "eosio::abi/1.1",
1636
1649
"types": [],
1637
1650
"structs": [{
1638
1651
"name": "hi",
@@ -1695,6 +1708,7 @@ BOOST_FIXTURE_TEST_CASE(abigen_contract_inheritance, abi_gen_helper)
1695
1708
1696
1709
const char * abigen_contract_inheritance_abi = R"=====(
1697
1710
{
1711
+ "version": "eosio::abi/1.1",
1698
1712
"types": [],
1699
1713
"structs": [{
1700
1714
"name": "hi",
@@ -2046,6 +2060,7 @@ BOOST_AUTO_TEST_CASE(abi_cycle)
2046
2060
2047
2061
const char * struct_cycle_abi = R"=====(
2048
2062
{
2063
+ "version": "eosio::abi/1.1",
2049
2064
"types": [],
2050
2065
"structs": [{
2051
2066
"name": "A",
@@ -2782,6 +2797,7 @@ BOOST_AUTO_TEST_CASE(packed_transaction)
2782
2797
2783
2798
const char * packed_transaction_abi = R"=====(
2784
2799
{
2800
+ "version": "eosio::abi/1.1",
2785
2801
"types": [{
2786
2802
"new_type_name": "compression_type",
2787
2803
"type": "int64"
@@ -2864,6 +2880,7 @@ BOOST_AUTO_TEST_CASE(abi_type_repeat)
2864
2880
2865
2881
const char * repeat_abi = R"=====(
2866
2882
{
2883
+ "version": "eosio::abi/1.1",
2867
2884
"types": [{
2868
2885
"new_type_name": "actor_name",
2869
2886
"type": "name"
@@ -2924,6 +2941,7 @@ BOOST_AUTO_TEST_CASE(abi_struct_repeat)
2924
2941
2925
2942
const char * repeat_abi = R"=====(
2926
2943
{
2944
+ "version": "eosio::abi/1.1",
2927
2945
"types": [{
2928
2946
"new_type_name": "actor_name",
2929
2947
"type": "name"
@@ -2980,6 +2998,7 @@ BOOST_AUTO_TEST_CASE(abi_action_repeat)
2980
2998
2981
2999
const char * repeat_abi = R"=====(
2982
3000
{
3001
+ "version": "eosio::abi/1.1",
2983
3002
"types": [{
2984
3003
"new_type_name": "actor_name",
2985
3004
"type": "name"
@@ -3039,6 +3058,7 @@ BOOST_AUTO_TEST_CASE(abi_table_repeat)
3039
3058
3040
3059
const char * repeat_abi = R"=====(
3041
3060
{
3061
+ "version": "eosio::abi/1.1",
3042
3062
"types": [{
3043
3063
"new_type_name": "actor_name",
3044
3064
"type": "name"
@@ -3101,6 +3121,7 @@ BOOST_AUTO_TEST_CASE(abi_type_def)
3101
3121
// inifinite loop in types
3102
3122
const char * repeat_abi = R"=====(
3103
3123
{
3124
+ "version": "eosio::abi/1.1",
3104
3125
"types": [{
3105
3126
"new_type_name": "account_name",
3106
3127
"type": "name"
@@ -3153,6 +3174,7 @@ BOOST_AUTO_TEST_CASE(abi_type_loop)
3153
3174
// inifinite loop in types
3154
3175
const char * repeat_abi = R"=====(
3155
3176
{
3177
+ "version": "eosio::abi/1.1",
3156
3178
"types": [{
3157
3179
"new_type_name": "account_name",
3158
3180
"type": "name"
@@ -3196,6 +3218,7 @@ BOOST_AUTO_TEST_CASE(abi_type_redefine)
3196
3218
// inifinite loop in types
3197
3219
const char * repeat_abi = R"=====(
3198
3220
{
3221
+ "version": "eosio::abi/1.1",
3199
3222
"types": [{
3200
3223
"new_type_name": "account_name",
3201
3224
"type": "account_name"
@@ -3236,6 +3259,7 @@ BOOST_AUTO_TEST_CASE(abi_type_redefine_to_name)
3236
3259
// inifinite loop in types
3237
3260
const char * repeat_abi = R"=====(
3238
3261
{
3262
+ "version": "eosio::abi/1.1",
3239
3263
"types": [{
3240
3264
"new_type_name": "name",
3241
3265
"type": "name"
@@ -3257,6 +3281,7 @@ BOOST_AUTO_TEST_CASE(abi_type_nested_in_vector)
3257
3281
// inifinite loop in types
3258
3282
const char * repeat_abi = R"=====(
3259
3283
{
3284
+ "version": "eosio::abi/1.1",
3260
3285
"types": [],
3261
3286
"structs": [{
3262
3287
"name": "store_t",
@@ -3282,6 +3307,7 @@ BOOST_AUTO_TEST_CASE(abi_account_name_in_eosio_abi)
3282
3307
// inifinite loop in types
3283
3308
const char * repeat_abi = R"=====(
3284
3309
{
3310
+ "version": "eosio::abi/1.1",
3285
3311
"types": [{
3286
3312
"new_type_name": "account_name",
3287
3313
"type": "name"
@@ -3324,6 +3350,7 @@ BOOST_AUTO_TEST_CASE(abi_large_array)
3324
3350
try {
3325
3351
const char * abi_str = R"=====(
3326
3352
{
3353
+ "version": "eosio::abi/1.1",
3327
3354
"types": [],
3328
3355
"structs": [{
3329
3356
"name": "hi",
@@ -3361,6 +3388,7 @@ BOOST_AUTO_TEST_CASE(abi_is_type_recursion)
3361
3388
try {
3362
3389
const char * abi_str = R"=====(
3363
3390
{
3391
+ "version": "eosio::abi/1.1",
3364
3392
"types": [
3365
3393
{
3366
3394
"new_type_name": "a[]",
@@ -3404,6 +3432,7 @@ BOOST_AUTO_TEST_CASE(abi_recursive_structs)
3404
3432
try {
3405
3433
const char * abi_str = R"=====(
3406
3434
{
3435
+ "version": "eosio::abi/1.1",
3407
3436
"types": [],
3408
3437
"structs": [
3409
3438
{
@@ -3556,6 +3585,7 @@ BOOST_AUTO_TEST_CASE(variants)
3556
3585
BOOST_AUTO_TEST_CASE (extend )
3557
3586
{
3558
3587
auto abi = R"( {
3588
+ "version": "eosio::abi/1.1",
3559
3589
"structs": [
3560
3590
{"name": "s", "base": "", "fields": [
3561
3591
{"name": "i0", "type": "int8"},
@@ -3593,6 +3623,7 @@ BOOST_AUTO_TEST_CASE(extend)
3593
3623
BOOST_AUTO_TEST_CASE (version)
3594
3624
{
3595
3625
try {
3626
+ BOOST_CHECK_THROW ( abi_serializer (fc::json::from_string (R"( {})" ).as <abi_def>(), max_serialization_time), unsupported_abi_version_exception );
3596
3627
BOOST_CHECK_THROW ( abi_serializer (fc::json::from_string (R"( {"version": ""})" ).as <abi_def>(), max_serialization_time), unsupported_abi_version_exception );
3597
3628
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 );
3598
3629
abi_serializer (fc::json::from_string (R"( {"version": "eosio::abi/1.0"})" ).as <abi_def>(), max_serialization_time);
0 commit comments