Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::wasm_validations::ensure_apply_exported_visitor Struct Reference

#include <wasm_sysio_validation.hpp>

Static Public Member Functions

static void validate (const IR::Module &m)
 

Detailed Description

Definition at line 42 of file wasm_sysio_validation.hpp.

Member Function Documentation

◆ validate()

void sysio::chain::wasm_validations::ensure_apply_exported_visitor::validate ( const IR::Module & m)
static

Definition at line 76 of file wasm_sysio_validation.cpp.

76 {
77 bool found_it = false;
78
79 for(const Export& exprt : m.exports) {
80 if(exprt.kind != ObjectKind::function)
81 continue;
82 if(exprt.name != "apply")
83 continue;
84 if(m.types[m.functions.getType(exprt.index).index] == FunctionType::get(ResultType::none, {ValueType::i64, ValueType::i64, ValueType::i64})) {
85 found_it = true;
86 break;
87 }
88 }
89
90 if(!found_it)
91 FC_THROW_EXCEPTION(wasm_execution_error, "Smart contract's apply function not exported; non-existent; or wrong type");
92}
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
static IR_API const FunctionType * get(ResultType ret, const std::initializer_list< ValueType > &parameters)
Definition Types.cpp:38
IndexSpace< FunctionDef, IndexedFunctionType > functions
Definition Module.h:133
std::vector< const FunctionType * > types
Definition Module.h:131
std::vector< Export > exports
Definition Module.h:138
Here is the call graph for this function:

The documentation for this struct was generated from the following files: