eos icon indicating copy to clipboard operation
eos copied to clipboard

wasm contain from_iso_string of time_point display "unresolvable"

Open NeverLandFly opened this issue 8 years ago • 7 comments

I'm trying to send a time string as input of an action. And I used from_iso_string in "eosiolib/time.hpp". The compile succeded. But faild on the setting contract step. The error message is:

Exception Details: 3070000 wasm_exception: WASM Exception env._ZN5eosio10time_point15from_iso_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE unresolveable {"module":"env","export":"_ZN5eosio10time_point15from_iso_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE"}

My code is: #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> #include <eosiolib/time.hpp> #include

using namespace eosio;

class try_time : public eosio::contract{ public: try_time(account_name self): eosio::contract(self){}

    ///@abi action
    void show(const std::string& time_str)
    {
        const time_point& current_time = time_point::from_iso_string(time_str);
        print(current_time.elapsed._count);
    }

}; EOSIO_ABI(try_time, (show))

NeverLandFly avatar Jul 29 '18 17:07 NeverLandFly

Well acutally i cant find the implementation of from_iso_string in the repository.

NeverLandFly avatar Jul 30 '18 13:07 NeverLandFly

eosio::time_point is a modified version of fc::time_point. The declaration for from_iso_string was accidentally left in and should be removed.

tbfleming avatar Jul 30 '18 13:07 tbfleming

And which function shall I use to translate a string into a time_point struct? I tried fc::time_point and it generated an compile error: /usr/local/eosio/include/libc++/upstream/include/float.h:69:15: fatal error: 'float.h' file not found #include_next <float.h>

NeverLandFly avatar Jul 31 '18 03:07 NeverLandFly

Actions contain binary data to reduce the need for contracts to parse text.

tbfleming avatar Jul 31 '18 03:07 tbfleming

OK I get that. Thanks.

NeverLandFly avatar Jul 31 '18 05:07 NeverLandFly

from_iso_string still left in eosio::time_point in both eos and eosio.wasmsdk reop.

spartucus avatar Aug 24 '18 06:08 spartucus

@spartucus Can you please create an issue in eosio.wasmske repo if you have not already. Thanks.

heifner avatar Aug 24 '18 13:08 heifner