提交 736230aa 编写于 作者: D Daniel Larimer

fix script function call names and build

上级 916c3683
......@@ -295,8 +295,8 @@ DEFINE_INTRINSIC_FUNCTION1(env,toUpper,toUpper,none,i32,charptr) {
void wasm_interface::vm_call( std::string name ) {
try {
try {
name += std::string( current_validate_context->msg.type ) + "_";
name += std::string( current_validate_context->msg.recipient );
name += "_" + std::string( current_validate_context->msg.recipient );
name += std::string( current_validate_context->msg.type );
FunctionInstance* apply = asFunctionNullable(getInstanceExport(current_module,name.c_str()));
if( !apply ) return; /// if not found then it is a no-op
......@@ -326,7 +326,7 @@ DEFINE_INTRINSIC_FUNCTION1(env,toUpper,toUpper,none,i32,charptr) {
{ try {
try {
// wlog( "on_init" );
FunctionInstance* apply = asFunctionNullable(getInstanceExport(current_module,"on_init"));
FunctionInstance* apply = asFunctionNullable(getInstanceExport(current_module,"init"));
if( !apply ) {
wlog( "no onInit method found" );
return; /// if not found then it is a no-op
......
......@@ -113,7 +113,7 @@ BOOST_FIXTURE_TEST_CASE(order_dependent_transactions, testing_fixture)
vector<uint8_t> assemble_wast( const std::string& wast ) {
std::cout << "\n" << wast << "\n";
// std::cout << "\n" << wast << "\n";
IR::Module module;
std::vector<WAST::Error> parseErrors;
WAST::parseModule(wast.c_str(),wast.size(),module,parseErrors);
......@@ -153,7 +153,7 @@ BOOST_FIXTURE_TEST_CASE(create_script, testing_fixture)
Make_Account(chain, simplecoin);
chain.produce_blocks(1);
#include "simplecoin.wast"
#include "wast/simplecoin.wast"
types::setcode handler;
handler.account = "simplecoin";
......
......@@ -51,7 +51,7 @@ struct Balance {
uint64_t balance;
};
void onInit() {
void init() {
static Balance initial = { 1000*1000 };
static AccountName simplecoin;
simplecoin = name_to_int64( "simplecoin" );
......
......@@ -22,9 +22,9 @@ const char* simplecoin_wast = R"====((module
(data (i32.const 80) "\n\00")
(data (i32.const 128) "insufficient funds\00")
(export "memory" (memory $0))
(export "on_init" (func $on_init))
(export "init" (func $init))
(export "apply_simplecoin_transfer" (func $apply_simplecoin_transfer))
(func $on_init
(func $init
(i64.store offset=24
(i32.const 0)
(call $name_to_int64
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册