Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
preconditions.hpp File Reference
#include <sysio/chain/types.hpp>
#include <sysio/chain/webassembly/common.hpp>
#include <sysio/chain/webassembly/sys-vm.hpp>
#include <sysio/vm/backend.hpp>
#include <sysio/vm/host_function.hpp>
Include dependency graph for preconditions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sysio::chain::webassembly::detail::is_whitelisted_legacy_type< T >
 
struct  sysio::chain::webassembly::detail::is_whitelisted_type< T >
 
struct  sysio::chain::webassembly::detail::is_whitelisted_type< vm::span< T > >
 
struct  sysio::chain::webassembly::detail::is_whitelisted_type< vm::argument_proxy< T *, 0 > >
 
struct  sysio::chain::webassembly::remove_argument_proxy< T >
 
struct  sysio::chain::webassembly::remove_argument_proxy< vm::argument_proxy< T *, A > >
 

Namespaces

namespace  sysio
 
namespace  sysio::chain
 
namespace  sysio::chain::webassembly
 
namespace  sysio::chain::webassembly::detail
 

Functions

template<typename T , std::size_t A>
constexpr std::integral_constant< bool, A !=0 > sysio::chain::webassembly::detail::is_legacy_ptr (legacy_ptr< T, A >)
 
template<typename T >
constexpr std::false_type sysio::chain::webassembly::detail::is_legacy_ptr (T)
 
template<typename T , std::size_t A>
constexpr std::integral_constant< bool, A !=0 > sysio::chain::webassembly::detail::is_legacy_span (legacy_span< T, A >)
 
template<typename T >
constexpr std::false_type sysio::chain::webassembly::detail::is_legacy_span (T)
 
 sysio::chain::webassembly::SYS_VM_PRECONDITION (context_free_check, SYS_VM_INVOKE_ONCE([&](auto &&...) { SYS_ASSERT(ctx.get_host().get_context().is_context_free(), unaccessible_api, "this API may only be called from context_free apply");}))
 
 sysio::chain::webassembly::SYS_VM_PRECONDITION (context_aware_check, SYS_VM_INVOKE_ONCE([&](auto &&...) { SYS_ASSERT(!ctx.get_host().get_context().is_context_free(), unaccessible_api, "only context free api's can be used in this context");}))
 
 sysio::chain::webassembly::SYS_VM_PRECONDITION (privileged_check, SYS_VM_INVOKE_ONCE([&](auto &&...) { SYS_ASSERT(ctx.get_host().get_context().is_privileged(), unaccessible_api, "${code} does not have permission to call this API",("code", ctx.get_host().get_context().get_receiver()));}))
 
template<typename T >
vm::span< const char > sysio::chain::webassembly::detail::to_span (const vm::argument_proxy< T * > &val)
 
template<typename T >
vm::span< Tsysio::chain::webassembly::detail::to_span (const vm::span< T > &val)
 
 sysio::chain::webassembly::SYS_VM_PRECONDITION (core_precondition, SYS_VM_INVOKE_ON_ALL(([&](auto &&arg, auto &&... rest) { using namespace sysio::vm;using arg_t=std::decay_t< decltype(arg)>;static_assert(is_whitelisted_type_v< arg_t >, "whitelisted type violation");if constexpr(is_span_type_v< arg_t >||vm::is_argument_proxy_type_v< arg_t >) { sysio::vm::invoke_on< false, sysio::vm::invoke_on_all_t >([&arg](auto &&narg, auto &&... nrest) { using nested_arg_t=std::decay_t< decltype(narg)>;if constexpr(sysio::vm::is_span_type_v< nested_arg_t >||vm::is_argument_proxy_type_v< nested_arg_t >) SYS_ASSERT(!is_aliasing(detail::to_span(arg), detail::to_span(narg)), wasm_exception, "pointers not allowed to alias");}, rest...);} })))
 
 sysio::chain::webassembly::SYS_VM_PRECONDITION (is_nan_check, SYS_VM_INVOKE_ON_ALL([&](auto &&arg, auto &&... rest) { if constexpr(should_check_nan_v< std::remove_cv_t< typename remove_argument_proxy< std::decay_t< decltype(arg)> >::type > >) { SYS_ASSERT(!webassembly::is_nan(*arg), transaction_exception, "NaN is not an allowed value for a secondary key");} }))
 
 sysio::chain::webassembly::SYS_VM_PRECONDITION (legacy_static_check_wl_args, SYS_VM_INVOKE_ONCE([&](auto &&... args) { static_assert(are_whitelisted_legacy_types_v< std::decay_t< decltype(args)>... >, "legacy whitelisted type violation");}))
 

Variables

template<typename T >
constexpr bool sysio::chain::webassembly::detail::is_softfloat_type_v
 
template<typename T >
constexpr bool sysio::chain::webassembly::detail::is_wasm_arithmetic_type_v
 
template<typename T >
constexpr bool sysio::chain::webassembly::should_check_nan_v