Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
action.cpp
Go to the documentation of this file.
4
5namespace sysio { namespace chain { namespace webassembly {
7 auto s = context.get_action().data.size();
8 if( memory.size() == 0 ) return s;
9
10 auto copy_size = std::min( static_cast<size_t>(memory.size()), s );
11 std::memcpy( memory.data(), context.get_action().data.data(), copy_size );
12
13 return copy_size;
14 }
15
17 return context.get_action().data.size();
18 }
19
21 return context.get_receiver();
22 }
23
25 auto max_action_return_value_size =
26 context.control.get_global_properties().configuration.max_action_return_value_size;
27 SYS_ASSERT(packed_blob.size() <= max_action_return_value_size,
28 action_return_value_exception,
29 "action return value size must be less or equal to ${s} bytes", ("s", max_action_return_value_size));
30 context.action_return_value.assign( packed_blob.data(), packed_blob.data() + packed_blob.size() );
31 }
32}}} // ns sysio::chain::webassembly
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
int32_t read_action_data(legacy_span< char > memory) const
Definition action.cpp:6
void set_action_return_value(span< const char > packed_blob)
Definition action.cpp:24
constexpr std::size_t size() const noexcept
Definition span.hpp:73
constexpr T * data() const noexcept
Definition span.hpp:72
signed int int32_t
Definition stdint.h:123
Immutable except for fc::from_variant.
Definition name.hpp:43
char * s