Skip to content

Commit 026fb4b

Browse files
committed
Replace N macro with operator ""_n
This commit updates generated-tests after the N macro in eos has been replaced with operator ""_n.
1 parent 870d22f commit 026fb4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3115
-3173
lines changed

generated-tests/address.cpp

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,34 @@ std::vector<uint8_t> wasm_address_0= read_wasm(wasm_str_address_0.c_str());
66
BOOST_DATA_TEST_CASE(address_0_check_throw, boost::unit_test::data::xrange(0,11), index) { try {
77
TESTER tester;
88
tester.produce_block();
9-
tester.create_account( N(wasmtest) );
9+
tester.create_account( "wasmtest"_n );
1010
tester.produce_block();
11-
tester.set_code(N(wasmtest), wasm_address_0);
11+
tester.set_code("wasmtest"_n, wasm_address_0);
1212
tester.produce_block();
1313

1414
action test;
15-
test.account = N(wasmtest);
15+
test.account = "wasmtest"_n;
1616
test.name = account_name((uint64_t)index);
17-
test.authorization = {{N(wasmtest), config::active_name}};
17+
test.authorization = {{"wasmtest"_n, config::active_name}};
1818

19-
BOOST_CHECK_THROW(push_action(tester, std::move(test), N(wasmtest).to_uint64_t()), wasm_execution_error);
19+
BOOST_CHECK_THROW(push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t()), wasm_execution_error);
2020
tester.produce_block();
2121
} FC_LOG_AND_RETHROW() }
2222

2323
BOOST_DATA_TEST_CASE(address_0_pass, boost::unit_test::data::xrange(11,12), index) { try {
2424
TESTER tester;
2525
tester.produce_block();
26-
tester.create_account( N(wasmtest) );
26+
tester.create_account( "wasmtest"_n );
2727
tester.produce_block();
28-
tester.set_code(N(wasmtest), wasm_address_0);
28+
tester.set_code("wasmtest"_n, wasm_address_0);
2929
tester.produce_block();
3030

3131
action test;
32-
test.account = N(wasmtest);
32+
test.account = "wasmtest"_n;
3333
test.name = account_name((uint64_t)index);
34-
test.authorization = {{N(wasmtest), config::active_name}};
34+
test.authorization = {{"wasmtest"_n, config::active_name}};
3535

36-
push_action(tester, std::move(test), N(wasmtest).to_uint64_t());
36+
push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t());
3737
tester.produce_block();
3838
BOOST_REQUIRE_EQUAL( tester.validate(), true );
3939
} FC_LOG_AND_RETHROW() }
@@ -44,34 +44,34 @@ std::vector<uint8_t> wasm_address_2= read_wasm(wasm_str_address_2.c_str());
4444
BOOST_DATA_TEST_CASE(address_2_check_throw, boost::unit_test::data::xrange(0,15), index) { try {
4545
TESTER tester;
4646
tester.produce_block();
47-
tester.create_account( N(wasmtest) );
47+
tester.create_account( "wasmtest"_n );
4848
tester.produce_block();
49-
tester.set_code(N(wasmtest), wasm_address_2);
49+
tester.set_code("wasmtest"_n, wasm_address_2);
5050
tester.produce_block();
5151

5252
action test;
53-
test.account = N(wasmtest);
53+
test.account = "wasmtest"_n;
5454
test.name = account_name((uint64_t)index);
55-
test.authorization = {{N(wasmtest), config::active_name}};
55+
test.authorization = {{"wasmtest"_n, config::active_name}};
5656

57-
BOOST_CHECK_THROW(push_action(tester, std::move(test), N(wasmtest).to_uint64_t()), wasm_execution_error);
57+
BOOST_CHECK_THROW(push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t()), wasm_execution_error);
5858
tester.produce_block();
5959
} FC_LOG_AND_RETHROW() }
6060

6161
BOOST_DATA_TEST_CASE(address_2_pass, boost::unit_test::data::xrange(15,17), index) { try {
6262
TESTER tester;
6363
tester.produce_block();
64-
tester.create_account( N(wasmtest) );
64+
tester.create_account( "wasmtest"_n );
6565
tester.produce_block();
66-
tester.set_code(N(wasmtest), wasm_address_2);
66+
tester.set_code("wasmtest"_n, wasm_address_2);
6767
tester.produce_block();
6868

6969
action test;
70-
test.account = N(wasmtest);
70+
test.account = "wasmtest"_n;
7171
test.name = account_name((uint64_t)index);
72-
test.authorization = {{N(wasmtest), config::active_name}};
72+
test.authorization = {{"wasmtest"_n, config::active_name}};
7373

74-
push_action(tester, std::move(test), N(wasmtest).to_uint64_t());
74+
push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t());
7575
tester.produce_block();
7676
BOOST_REQUIRE_EQUAL( tester.validate(), true );
7777
} FC_LOG_AND_RETHROW() }
@@ -82,34 +82,34 @@ std::vector<uint8_t> wasm_address_3= read_wasm(wasm_str_address_3.c_str());
8282
BOOST_DATA_TEST_CASE(address_3_check_throw, boost::unit_test::data::xrange(0,3), index) { try {
8383
TESTER tester;
8484
tester.produce_block();
85-
tester.create_account( N(wasmtest) );
85+
tester.create_account( "wasmtest"_n );
8686
tester.produce_block();
87-
tester.set_code(N(wasmtest), wasm_address_3);
87+
tester.set_code("wasmtest"_n, wasm_address_3);
8888
tester.produce_block();
8989

9090
action test;
91-
test.account = N(wasmtest);
91+
test.account = "wasmtest"_n;
9292
test.name = account_name((uint64_t)index);
93-
test.authorization = {{N(wasmtest), config::active_name}};
93+
test.authorization = {{"wasmtest"_n, config::active_name}};
9494

95-
BOOST_CHECK_THROW(push_action(tester, std::move(test), N(wasmtest).to_uint64_t()), wasm_execution_error);
95+
BOOST_CHECK_THROW(push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t()), wasm_execution_error);
9696
tester.produce_block();
9797
} FC_LOG_AND_RETHROW() }
9898

9999
BOOST_DATA_TEST_CASE(address_3_pass, boost::unit_test::data::xrange(3,4), index) { try {
100100
TESTER tester;
101101
tester.produce_block();
102-
tester.create_account( N(wasmtest) );
102+
tester.create_account( "wasmtest"_n );
103103
tester.produce_block();
104-
tester.set_code(N(wasmtest), wasm_address_3);
104+
tester.set_code("wasmtest"_n, wasm_address_3);
105105
tester.produce_block();
106106

107107
action test;
108-
test.account = N(wasmtest);
108+
test.account = "wasmtest"_n;
109109
test.name = account_name((uint64_t)index);
110-
test.authorization = {{N(wasmtest), config::active_name}};
110+
test.authorization = {{"wasmtest"_n, config::active_name}};
111111

112-
push_action(tester, std::move(test), N(wasmtest).to_uint64_t());
112+
push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t());
113113
tester.produce_block();
114114
BOOST_REQUIRE_EQUAL( tester.validate(), true );
115115
} FC_LOG_AND_RETHROW() }
@@ -120,35 +120,34 @@ std::vector<uint8_t> wasm_address_4= read_wasm(wasm_str_address_4.c_str());
120120
BOOST_DATA_TEST_CASE(address_4_check_throw, boost::unit_test::data::xrange(0,3), index) { try {
121121
TESTER tester;
122122
tester.produce_block();
123-
tester.create_account( N(wasmtest) );
123+
tester.create_account( "wasmtest"_n );
124124
tester.produce_block();
125-
tester.set_code(N(wasmtest), wasm_address_4);
125+
tester.set_code("wasmtest"_n, wasm_address_4);
126126
tester.produce_block();
127127

128128
action test;
129-
test.account = N(wasmtest);
129+
test.account = "wasmtest"_n;
130130
test.name = account_name((uint64_t)index);
131-
test.authorization = {{N(wasmtest), config::active_name}};
131+
test.authorization = {{"wasmtest"_n, config::active_name}};
132132

133-
BOOST_CHECK_THROW(push_action(tester, std::move(test), N(wasmtest).to_uint64_t()), wasm_execution_error);
133+
BOOST_CHECK_THROW(push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t()), wasm_execution_error);
134134
tester.produce_block();
135135
} FC_LOG_AND_RETHROW() }
136136

137137
BOOST_DATA_TEST_CASE(address_4_pass, boost::unit_test::data::xrange(3,4), index) { try {
138138
TESTER tester;
139139
tester.produce_block();
140-
tester.create_account( N(wasmtest) );
140+
tester.create_account( "wasmtest"_n );
141141
tester.produce_block();
142-
tester.set_code(N(wasmtest), wasm_address_4);
142+
tester.set_code("wasmtest"_n, wasm_address_4);
143143
tester.produce_block();
144144

145145
action test;
146-
test.account = N(wasmtest);
146+
test.account = "wasmtest"_n;
147147
test.name = account_name((uint64_t)index);
148-
test.authorization = {{N(wasmtest), config::active_name}};
148+
test.authorization = {{"wasmtest"_n, config::active_name}};
149149

150-
push_action(tester, std::move(test), N(wasmtest).to_uint64_t());
150+
push_action(tester, std::move(test), "wasmtest"_n.to_uint64_t());
151151
tester.produce_block();
152152
BOOST_REQUIRE_EQUAL( tester.validate(), true );
153153
} FC_LOG_AND_RETHROW() }
154-

0 commit comments

Comments
 (0)