file system.h

Functions

Type Name
void eosio_assert (uint32_t test, const char * msg)
void eosio_assert_message (uint32_t test, const char * msg, uint32_t msg_len)
void eosio_assert_code (uint32_t test, uint64_t code)
Aborts processing of this action and unwinds all pending changes.
void eosio_exit (int32_t code)
uint64_t current_time (void)
bool is_feature_activated (const struct capi_checksum256 * feature_digest)
capi_name get_sender (void)

Detailed Description

Copyright

defined in eos/LICENSE

Functions Documentation

function eosio_assert

void eosio_assert(
    uint32_t test,
    const char * msg
)

Aborts processing of this action and unwinds all pending changes if the test condition is true

Parameters:

  • test - 0 to abort, 1 to ignore

Example:

eosio_assert(1 == 2, "One is not equal to two.");
eosio_assert(1 == 1, "One is not equal to one.");

Parameters:

  • msg - a null terminated string explaining the reason for failure

function eosio_assert_message

void eosio_assert_message(
    uint32_t test,
    const char * msg,
    uint32_t msg_len
)

Aborts processing of this action and unwinds all pending changes if the test condition is true

Parameters:

  • test - 0 to abort, 1 to ignore
  • msg - a pointer to the start of string explaining the reason for failure
  • msg_len - length of the string

function eosio_assert_code

void eosio_assert_code(
    uint32_t test,
    uint64_t code
)

Aborts processing of this action and unwinds all pending changes.

Aborts processing of this action and unwinds all pending changes if the test condition is true

Parameters:

  • test - 0 to abort, 1 to ignore
  • code - the error code

function eosio_exit

void eosio_exit(
    int32_t code
)

This method will abort execution of wasm without failing the contract. This is used to bypass all cleanup / destructors that would normally be called.

Parameters:

  • code - the exit code Example:
eosio_exit(0);
eosio_exit(1);
eosio_exit(2);
eosio_exit(3);

This method will abort execution of wasm without failing the contract. This is used to bypass all cleanup / destructors that would normally be called.

** WARNING: this method will immediately abort execution of wasm code that is on the stack and would be executed as the method normally returned. Problems can occur with write-caches, RAII, reference counting when this method aborts execution of wasm code immediately. **

Parameters:

  • code - the exit code Example:
eosio_exit(0);
eosio_exit(1);
eosio_exit(2);
eosio_exit(3);

function current_time

uint64_t current_time(
    void 
)

Returns the time in microseconds from 1970 of the current block

Returns:

time in microseconds from 1970 of the current block

function is_feature_activated

bool is_feature_activated(
    const struct capi_checksum256 * feature_digest
)

Check if specified protocol feature has been activated

Parameters:

  • feature_digest - digest of the protocol feature

Returns:

true if the specified protocol feature has been activated, false otherwise

function get_sender

capi_name get_sender(
    void 
)

Return name of account that sent current inline action

Returns:

name of account that sent the current inline action (empty name if not called from inline action)


The documentation for this class was generated from the following file: libraries/eosiolib/capi/eosio/system.h