Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
cf_transaction.cpp
Go to the documentation of this file.
4
5namespace sysio { namespace chain { namespace webassembly {
7 if( data.size() == 0 ) return transaction_size();
8
9 // always pack the transaction here as exact pack format is part of consensus
10 // and an alternative packed format could be stored in get_packed_transaction()
11 const packed_transaction& packed_trx = context.trx_context.packed_trx;
12 bytes trx = fc::raw::pack( static_cast<const transaction&>( packed_trx.get_transaction() ) );
13 size_t copy_size = std::min( static_cast<size_t>(data.size()), trx.size() );
14 std::memcpy( data.data(), trx.data(), copy_size );
15
16 return copy_size;
17 }
18
20 const packed_transaction& packed_trx = context.trx_context.packed_trx;
21 return fc::raw::pack_size( static_cast<const transaction&>( packed_trx.get_transaction() ) );
22 }
23
25 return context.trx_context.packed_trx.get_transaction().expiration.sec_since_epoch();
26 }
27
29 return context.trx_context.packed_trx.get_transaction().ref_block_num;
30 }
31
33 return context.trx_context.packed_trx.get_transaction().ref_block_prefix;
34 }
35
37 return context.get_action( type, index, buffer.data(), buffer.size() );
38 }
39}}} // ns sysio::chain::webassembly
int32_t get_action(uint32_t type, uint32_t index, legacy_span< char > buffer) const
int32_t read_transaction(legacy_span< char > data) const
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
size_t pack_size(const T &v)
Definition raw.hpp:671
unsigned int uint32_t
Definition stdint.h:126
signed int int32_t
Definition stdint.h:123
const transaction & get_transaction() const