File tree 1 file changed +9
-6
lines changed 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 3
3
#include < eosiolib_native/vm_api.h>
4
4
#include < eosio/chain/eos_api.hpp>
5
5
6
+ #include < fc/io/fstream.hpp>
7
+
6
8
#include " debug_context.hpp"
7
9
8
10
using namespace eosio ;
@@ -149,6 +151,7 @@ static int vm_run_script_(const char* str) {
149
151
}
150
152
151
153
int main (int argc, char ** argv) {
154
+
152
155
init_wallet ();
153
156
154
157
get_vm_api ()->is_unittest_mode = is_unittest_mode;
@@ -167,13 +170,13 @@ int main(int argc, char** argv) {
167
170
168
171
vm_run_script = get_vm_api ()->vm_run_script ;
169
172
get_vm_api ()->vm_run_script = vm_run_script_; // ("print('hello,world')");
170
- try {
171
- get_vm_api ()->vm_run_script (" print('hello,world')" );
172
- } catch (...) {
173
- vmdlog (" +++%s\n " , fc::exception ::current_exception->to_detail_string ().c_str ());
174
- }
175
173
176
- vmdlog (" ++++%p \n " , fc::exception ::current_exception);
174
+ if (appbase::app ().has_option (" script" )) {
175
+ string content;
176
+ string script = appbase::app ().get_option (" script" );
177
+ fc::read_file_contents (script, content);
178
+ get_vm_api ()->vm_run_script (content.c_str ());
179
+ }
177
180
178
181
try {
179
182
main_tester->create_account (N (newacc));
You can’t perform that action at this time.
0 commit comments