9
9
#include < eosio/chain/wast_to_wasm.hpp>
10
10
#include < eosio/chain_plugin/chain_plugin.hpp>
11
11
12
- #include < asserter/asserter.wast.hpp>
13
- #include < asserter/asserter.abi.hpp>
14
-
15
- #include < eosio.token/eosio.token.wast.hpp>
16
- #include < eosio.token/eosio.token.abi.hpp>
17
-
18
- #include < eosio.system/eosio.system.wast.hpp>
19
- #include < eosio.system/eosio.system.abi.hpp>
12
+ #include < contracts.hpp>
20
13
21
14
#include < fc/io/fstream.hpp>
22
15
@@ -51,8 +44,8 @@ BOOST_FIXTURE_TEST_CASE( get_scope_test, TESTER ) try {
51
44
create_accounts (accs);
52
45
produce_block ();
53
46
54
- set_code ( N (eosio.token ), eosio_token_wast );
55
- set_abi ( N (eosio.token ), eosio_token_abi );
47
+ set_code ( N (eosio.token ), contracts::eosio_token_wasm () );
48
+ set_abi ( N (eosio.token ), contracts:: eosio_token_abi(). data () );
56
49
produce_blocks (1 );
57
50
58
51
// create currency
@@ -76,14 +69,14 @@ BOOST_FIXTURE_TEST_CASE( get_scope_test, TESTER ) try {
76
69
eosio::chain_apis::read_only::get_table_by_scope_params param{N (eosio.token ), N (accounts), " inita" , " " , 10 };
77
70
eosio::chain_apis::read_only::get_table_by_scope_result result = plugin.read_only ::get_table_by_scope (param);
78
71
79
- BOOST_REQUIRE_EQUAL (4 , result.rows .size ());
72
+ BOOST_REQUIRE_EQUAL (4u , result.rows .size ());
80
73
BOOST_REQUIRE_EQUAL (" " , result.more );
81
74
if (result.rows .size () >= 4 ) {
82
75
BOOST_REQUIRE_EQUAL (name (N (eosio.token )), result.rows [0 ].code );
83
76
BOOST_REQUIRE_EQUAL (name (N (inita)), result.rows [0 ].scope );
84
77
BOOST_REQUIRE_EQUAL (name (N (accounts)), result.rows [0 ].table );
85
78
BOOST_REQUIRE_EQUAL (name (N (eosio)), result.rows [0 ].payer );
86
- BOOST_REQUIRE_EQUAL (1 , result.rows [0 ].count );
79
+ BOOST_REQUIRE_EQUAL (1u , result.rows [0 ].count );
87
80
88
81
BOOST_REQUIRE_EQUAL (name (N (initb)), result.rows [1 ].scope );
89
82
BOOST_REQUIRE_EQUAL (name (N (initc)), result.rows [2 ].scope );
@@ -93,7 +86,7 @@ BOOST_FIXTURE_TEST_CASE( get_scope_test, TESTER ) try {
93
86
param.lower_bound = " initb" ;
94
87
param.upper_bound = " initc" ;
95
88
result = plugin.read_only ::get_table_by_scope (param);
96
- BOOST_REQUIRE_EQUAL (2 , result.rows .size ());
89
+ BOOST_REQUIRE_EQUAL (2u , result.rows .size ());
97
90
BOOST_REQUIRE_EQUAL (" " , result.more );
98
91
if (result.rows .size () >= 2 ) {
99
92
BOOST_REQUIRE_EQUAL (name (N (initb)), result.rows [0 ].scope );
@@ -102,17 +95,17 @@ BOOST_FIXTURE_TEST_CASE( get_scope_test, TESTER ) try {
102
95
103
96
param.limit = 1 ;
104
97
result = plugin.read_only ::get_table_by_scope (param);
105
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
98
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
106
99
BOOST_REQUIRE_EQUAL (" initc" , result.more );
107
100
108
101
param.table = name (0 );
109
102
result = plugin.read_only ::get_table_by_scope (param);
110
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
103
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
111
104
BOOST_REQUIRE_EQUAL (" initc" , result.more );
112
105
113
106
param.table = N (invalid);
114
107
result = plugin.read_only ::get_table_by_scope (param);
115
- BOOST_REQUIRE_EQUAL (0 , result.rows .size ());
108
+ BOOST_REQUIRE_EQUAL (0u , result.rows .size ());
116
109
BOOST_REQUIRE_EQUAL (" " , result.more );
117
110
118
111
} FC_LOG_AND_RETHROW() // / get_scope_test
@@ -127,8 +120,8 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
127
120
create_accounts (accs);
128
121
produce_block ();
129
122
130
- set_code ( N (eosio.token ), eosio_token_wast );
131
- set_abi ( N (eosio.token ), eosio_token_abi );
123
+ set_code ( N (eosio.token ), contracts::eosio_token_wasm () );
124
+ set_abi ( N (eosio.token ), contracts:: eosio_token_abi(). data () );
132
125
produce_blocks (1 );
133
126
134
127
// create currency
@@ -201,7 +194,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
201
194
p.json = true ;
202
195
p.index_position = " primary" ;
203
196
eosio::chain_apis::read_only::get_table_rows_result result = plugin.read_only ::get_table_rows (p);
204
- BOOST_REQUIRE_EQUAL (4 , result.rows .size ());
197
+ BOOST_REQUIRE_EQUAL (4u , result.rows .size ());
205
198
BOOST_REQUIRE_EQUAL (false , result.more );
206
199
if (result.rows .size () >= 4 ) {
207
200
BOOST_REQUIRE_EQUAL (" 9999.0000 AAA" , result.rows [0 ][" balance" ].as_string ());
@@ -213,7 +206,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
213
206
// get table: reverse ordered
214
207
p.reverse = true ;
215
208
result = plugin.read_only ::get_table_rows (p);
216
- BOOST_REQUIRE_EQUAL (4 , result.rows .size ());
209
+ BOOST_REQUIRE_EQUAL (4u , result.rows .size ());
217
210
BOOST_REQUIRE_EQUAL (false , result.more );
218
211
if (result.rows .size () >= 4 ) {
219
212
BOOST_REQUIRE_EQUAL (" 9999.0000 AAA" , result.rows [3 ][" balance" ].as_string ());
@@ -226,7 +219,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
226
219
p.reverse = true ;
227
220
p.show_payer = true ;
228
221
result = plugin.read_only ::get_table_rows (p);
229
- BOOST_REQUIRE_EQUAL (4 , result.rows .size ());
222
+ BOOST_REQUIRE_EQUAL (4u , result.rows .size ());
230
223
BOOST_REQUIRE_EQUAL (false , result.more );
231
224
if (result.rows .size () >= 4 ) {
232
225
BOOST_REQUIRE_EQUAL (" 9999.0000 AAA" , result.rows [3 ][" data" ][" balance" ].as_string ());
@@ -245,7 +238,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
245
238
p.upper_bound = " CCC" ;
246
239
p.reverse = false ;
247
240
result = plugin.read_only ::get_table_rows (p);
248
- BOOST_REQUIRE_EQUAL (2 , result.rows .size ());
241
+ BOOST_REQUIRE_EQUAL (2u , result.rows .size ());
249
242
BOOST_REQUIRE_EQUAL (false , result.more );
250
243
if (result.rows .size () >= 2 ) {
251
244
BOOST_REQUIRE_EQUAL (" 8888.0000 BBB" , result.rows [0 ][" balance" ].as_string ());
@@ -257,7 +250,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
257
250
p.upper_bound = " CCC" ;
258
251
p.reverse = true ;
259
252
result = plugin.read_only ::get_table_rows (p);
260
- BOOST_REQUIRE_EQUAL (2 , result.rows .size ());
253
+ BOOST_REQUIRE_EQUAL (2u , result.rows .size ());
261
254
BOOST_REQUIRE_EQUAL (false , result.more );
262
255
if (result.rows .size () >= 2 ) {
263
256
BOOST_REQUIRE_EQUAL (" 8888.0000 BBB" , result.rows [1 ][" balance" ].as_string ());
@@ -269,7 +262,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
269
262
p.limit = 1 ;
270
263
p.reverse = false ;
271
264
result = plugin.read_only ::get_table_rows (p);
272
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
265
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
273
266
BOOST_REQUIRE_EQUAL (true , result.more );
274
267
if (result.rows .size () >= 1 ) {
275
268
BOOST_REQUIRE_EQUAL (" 9999.0000 AAA" , result.rows [0 ][" balance" ].as_string ());
@@ -280,7 +273,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
280
273
p.limit = 1 ;
281
274
p.reverse = true ;
282
275
result = plugin.read_only ::get_table_rows (p);
283
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
276
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
284
277
BOOST_REQUIRE_EQUAL (true , result.more );
285
278
if (result.rows .size () >= 1 ) {
286
279
BOOST_REQUIRE_EQUAL (" 10000.0000 SYS" , result.rows [0 ][" balance" ].as_string ());
@@ -292,7 +285,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
292
285
p.limit = 1 ;
293
286
p.reverse = false ;
294
287
result = plugin.read_only ::get_table_rows (p);
295
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
288
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
296
289
BOOST_REQUIRE_EQUAL (true , result.more );
297
290
if (result.rows .size () >= 1 ) {
298
291
BOOST_REQUIRE_EQUAL (" 8888.0000 BBB" , result.rows [0 ][" balance" ].as_string ());
@@ -304,7 +297,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
304
297
p.limit = 1 ;
305
298
p.reverse = true ;
306
299
result = plugin.read_only ::get_table_rows (p);
307
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
300
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
308
301
BOOST_REQUIRE_EQUAL (true , result.more );
309
302
if (result.rows .size () >= 1 ) {
310
303
BOOST_REQUIRE_EQUAL (" 7777.0000 CCC" , result.rows [0 ][" balance" ].as_string ());
@@ -322,8 +315,8 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
322
315
create_accounts (accs);
323
316
produce_block ();
324
317
325
- set_code ( N (eosio.token ), eosio_token_wast );
326
- set_abi ( N (eosio.token ), eosio_token_abi );
318
+ set_code ( N (eosio.token ), contracts::eosio_token_wasm () );
319
+ set_abi ( N (eosio.token ), contracts:: eosio_token_abi(). data () );
327
320
produce_blocks (1 );
328
321
329
322
// create currency
@@ -342,8 +335,13 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
342
335
}
343
336
produce_blocks (1 );
344
337
345
- set_code ( config::system_account_name, eosio_system_wast );
346
- set_abi ( config::system_account_name, eosio_system_abi );
338
+ set_code ( config::system_account_name, contracts::eosio_system_wasm () );
339
+ set_abi ( config::system_account_name, contracts::eosio_system_abi ().data () );
340
+
341
+ base_tester::push_action (config::system_account_name, N (init),
342
+ config::system_account_name, mutable_variant_object ()
343
+ (" version" , 0 )
344
+ (" core" , CORE_SYM_STR));
347
345
348
346
// bidname
349
347
auto bidname = [this ]( const account_name& bidder, const account_name& newname, const asset& bid ) {
@@ -370,7 +368,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
370
368
p.index_position = " secondary" ; // ordered by high_bid
371
369
p.key_type = " i64" ;
372
370
eosio::chain_apis::read_only::get_table_rows_result result = plugin.read_only ::get_table_rows (p);
373
- BOOST_REQUIRE_EQUAL (4 , result.rows .size ());
371
+ BOOST_REQUIRE_EQUAL (4u , result.rows .size ());
374
372
BOOST_REQUIRE_EQUAL (false , result.more );
375
373
if (result.rows .size () >= 4 ) {
376
374
BOOST_REQUIRE_EQUAL (" html" , result.rows [0 ][" newname" ].as_string ());
@@ -394,7 +392,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
394
392
p.reverse = true ;
395
393
p.show_payer = true ;
396
394
result = plugin.read_only ::get_table_rows (p);
397
- BOOST_REQUIRE_EQUAL (4 , result.rows .size ());
395
+ BOOST_REQUIRE_EQUAL (4u , result.rows .size ());
398
396
BOOST_REQUIRE_EQUAL (false , result.more );
399
397
if (result.rows .size () >= 4 ) {
400
398
BOOST_REQUIRE_EQUAL (" html" , result.rows [3 ][" data" ][" newname" ].as_string ());
@@ -423,7 +421,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
423
421
p.show_payer = false ;
424
422
p.limit = 1 ;
425
423
result = plugin.read_only ::get_table_rows (p);
426
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
424
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
427
425
BOOST_REQUIRE_EQUAL (true , result.more );
428
426
if (result.rows .size () >= 1 ) {
429
427
BOOST_REQUIRE_EQUAL (" html" , result.rows [0 ][" newname" ].as_string ());
@@ -436,7 +434,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
436
434
p.show_payer = false ;
437
435
p.limit = 1 ;
438
436
result = plugin.read_only ::get_table_rows (p);
439
- BOOST_REQUIRE_EQUAL (1 , result.rows .size ());
437
+ BOOST_REQUIRE_EQUAL (1u , result.rows .size ());
440
438
BOOST_REQUIRE_EQUAL (true , result.more );
441
439
if (result.rows .size () >= 1 ) {
442
440
BOOST_REQUIRE_EQUAL (" com" , result.rows [0 ][" newname" ].as_string ());
0 commit comments