Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
authorization.cpp
Go to the documentation of this file.
3
4namespace sysio { namespace chain { namespace webassembly {
5 void interface::require_auth( account_name account ) const {
6 context.require_authorization( account );
7 }
8
9 bool interface::has_auth( account_name account ) const {
10 return context.has_authorization( account );
11 }
12
14 permission_name permission ) const {
15 context.require_authorization( account, permission );
16 }
17
19 context.require_recipient( recipient );
20 }
21
22 bool interface::is_account( account_name account ) const {
23 return context.is_account( account );
24 }
25
33
35 account_name account,
36 uint32_t struct_version,
37 vm::span<char> packed_result
38 ) const {
39 struct_version = std::min(uint32_t(0), struct_version);
40 get_code_hash_result result = {struct_version};
41 context.get_code_hash(account, result.code_sequence, result.code_hash, result.vm_type, result.vm_version);
42
43 auto s = fc::raw::pack_size(result);
44 if (s <= packed_result.size()) {
45 datastream<char*> ds(packed_result.data(), s);
46 fc::raw::pack(ds, result);
47 }
48 return s;
49 }
50}}} // ns sysio::chain::webassembly
51
52FC_REFLECT(sysio::chain::webassembly::get_code_hash_result, (struct_version)(code_sequence)(code_hash)(vm_type)(vm_version))
bool is_account(account_name account) const
void require_auth(account_name account) const
void require_auth2(account_name account, permission_name permission) const
uint32_t get_code_hash(account_name account, uint32_t struct_version, vm::span< char > packed_result) const
bool has_auth(account_name account) const
void require_recipient(account_name recipient)
constexpr std::size_t size() const noexcept
Definition span.hpp:73
constexpr T * data() const noexcept
Definition span.hpp:72
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
size_t pack_size(const T &v)
Definition raw.hpp:671
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Immutable except for fc::from_variant.
Definition name.hpp:43
char * s