21 namespace test_common {
22 fc::sha256 operator"" _h(
const char* input, std::size_t) {
56 std::vector<chain::packed_transaction> trxs ) {
58 for(
auto& trx : trxs ) {
59 block->transactions.emplace_back( trx );
61 block->producer = producer;
65 previous._hash[0] &= 0xffffffff00000000;
68 block->previous = previous;
73 auto prev = std::make_shared<chain::block_state>();
76 block->producer_signature = priv_key.sign( sig_digest );
78 std::vector<chain::private_key_type> signing_keys;
79 signing_keys.emplace_back( std::move( priv_key ));
81 std::vector<chain::signature_type> result;
82 result.reserve( signing_keys.size());
83 for(
const auto& k: signing_keys )
84 result.emplace_back( k.sign(
d ));
94 auto bsp = std::make_shared<chain::block_state>(
97 std::vector<chain::transaction_metadata_ptr>(),
100 const fc::flat_set<chain::digest_type>& cur_features,
101 const std::vector<chain::digest_type>& new_features ) {},
104 bsp->block_num = height;
112 static const std::string sep =
".";
114 for (
const auto& entry: obj) {
116 append(sep + entry.key() + path, value);
121 for (
size_t idx = 0; idx < arr.size(); idx++) {
122 const auto& entry = arr.at(idx);
124 append(std::string(
"[") + std::to_string(idx) + std::string(
"]") +
path,
value);
133 std::map<std::string, std::string> result;
134 to_kv_helper(v, [&result](
const std::string& k,
const std::string& v){
135 result.emplace(k, v);
224 return !(lhs == rhs);
233 return !(lhs == rhs);
248 template<
typename ...Ts>
249 std::ostream&
operator<<(std::ostream &
os,
const std::variant<Ts...>& v ) {
267 return !(lhs == rhs);
281 os << entry.first +
"=" + entry.second;
static private_key regenerate(const typename KeyType::data_type &data)
static string to_string(const variant &v, const yield_function_t &yield, const output_formatting format=output_formatting::stringify_large_ints_and_doubles)
constexpr int64_t count() const
wraps boost::filesystem::path to provide platform independent path manipulation.
static sha256 hash(const char *d, uint32_t dlen)
static constexpr time_point maximum()
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
variant_object & get_object()
void pack(Stream &s, const std::deque< T > &value)
datastream< ST > & operator<<(datastream< ST > &s, const sysio::chain::may_not_exist< T > &v)
uint32_t endian_reverse_u32(uint32_t x)
std::ostream & operator<<(std::ostream &st, const std::variant< fc::alt_bn128_error, bytes > &err)
bool operator==(const permission_level &lhs, const permission_level &rhs)
block_timestamp< config::block_interval_ms, config::block_timestamp_epoch > block_timestamp_type
bool operator!=(const permission_level &lhs, const permission_level &rhs)
std::shared_ptr< signed_block > signed_block_ptr
auto get_private_key(chain::name keyname, std::string role="owner")
auto to_kv(const fc::variant &v)
void to_kv_helper(const fc::variant &v, std::function< void(const std::string &, const std::string &)> &&append)
auto make_block_state(chain::block_id_type previous, uint32_t height, uint32_t slot, chain::name producer, std::vector< chain::packed_transaction > trxs)
auto get_public_key(chain::name keyname, std::string role="owner")
chain::bytes make_transfer_data(chain::name from, chain::name to, chain::asset quantity, std::string &&memo)
bool operator!=(const block_entry_v0 &lhs, const block_entry_v0 &rhs)
std::ostream & operator<<(std::ostream &os, const block_trace_v0 &bt)
bool operator==(const authorization_trace_v0 &lhs, const authorization_trace_v0 &rhs)
static asset from_string(const string &from)
Immutable except for fc::from_variant.
std::string to_string() const
std::vector< authorization_trace_v0 > authorization
std::vector< transaction_trace_v0 > transactions
chain::block_id_type previous_id
chain::block_timestamp_type timestamp
chain::block_id_type previous_id
std::variant< std::vector< transaction_trace_v2 >, std::vector< transaction_trace_v3 > > transactions
chain::checksum256_type action_mroot
chain::checksum256_type transaction_mroot
uint32_t schedule_version
chain::block_timestamp_type timestamp
chain::transaction_id_type id
std::vector< action_trace_v0 > actions
fc::unsigned_int net_usage_words
std::variant< std::vector< action_trace_v1 > > actions
std::vector< chain::signature_type > signatures
fc::enum_type< uint8_t, status_type > status
chain::transaction_id_type id
chain::transaction_header trx_header
void bt(const Operand &op, const Reg ®)
yubihsm_pkcs11_slot * slot