Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
response_test_fixture Struct Reference
Collaboration diagram for response_test_fixture:

Classes

struct  mock_data_handler_provider
 
struct  mock_logfile_provider
 

Public Types

using response_impl_type = request_handler<mock_logfile_provider, mock_data_handler_provider>
 

Public Member Functions

 response_test_fixture ()
 
fc::variant get_block_trace (uint32_t block_height, const yield_function &yield={})
 

Public Attributes

std::function< get_block_t(uint32_t, const yield_function &)> mock_get_block
 
std::function< std::tuple< fc::variant, std::optional< fc::variant > >(const action_trace_v0 &, const yield_function &)> mock_data_handler_v0 = default_mock_data_handler_v0
 
std::function< std::tuple< fc::variant, std::optional< fc::variant > >(const action_trace_v1 &, const yield_function &)> mock_data_handler_v1 = default_mock_data_handler_v1
 
response_impl_type response_impl
 

Static Public Attributes

static constexpr auto default_mock_data_handler_v0
 
static constexpr auto default_mock_data_handler_v1
 

Detailed Description

Definition at line 13 of file test_responses.cpp.

Member Typedef Documentation

◆ response_impl_type

Constructor & Destructor Documentation

◆ response_test_fixture()

response_test_fixture::response_test_fixture ( )
inline

TODO: initialize extraction implementation here with mock_logfile_provider as template param

Definition at line 65 of file test_responses.cpp.

66 : response_impl(mock_logfile_provider(*this), mock_data_handler_provider(*this),
67 [](const std::string& msg ){ fc_dlog( fc::logger::get(DEFAULT_LOGGER), msg );})
68 {
69
70 }
static logger get(const fc::string &name=DEFAULT_LOGGER)
Definition logger.cpp:88
#define DEFAULT_LOGGER
Definition logger.hpp:7
#define fc_dlog(LOGGER, FORMAT,...)
Definition logger.hpp:77
response_impl_type response_impl
Here is the call graph for this function:

Member Function Documentation

◆ get_block_trace()

fc::variant response_test_fixture::get_block_trace ( uint32_t block_height,
const yield_function & yield = {} )
inline

Definition at line 72 of file test_responses.cpp.

72 {} ) {
73 return response_impl.get_block_trace( block_height, yield );
74 }
fc::variant get_block_trace(uint32_t block_height, const yield_function &yield={})

Member Data Documentation

◆ default_mock_data_handler_v0

auto response_test_fixture::default_mock_data_handler_v0
staticconstexpr
Initial value:
= [](const action_trace_v0& a, const yield_function&) ->std::tuple<fc::variant, std::optional<fc::variant>> {
return {fc::mutable_variant_object()("hex" , fc::to_hex(a.data.data(), a.data.size())),{}};
}
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
fc::string to_hex(const char *d, uint32_t s)
Definition hex.cpp:17
fc::optional_delegate< void()> yield_function
Definition common.hpp:13
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

Definition at line 35 of file test_responses.cpp.

35 {
36 return {fc::mutable_variant_object()("hex" , fc::to_hex(a.data.data(), a.data.size())),{}};
37 };

◆ default_mock_data_handler_v1

auto response_test_fixture::default_mock_data_handler_v1
staticconstexpr
Initial value:
= [](const action_trace_v1& a, const yield_function&) -> std::tuple<fc::variant, std::optional<fc::variant>>{
return {fc::mutable_variant_object()("hex" , fc::to_hex(a.data.data(), a.data.size())), {fc::mutable_variant_object()("hex" , fc::to_hex(a.return_value.data(), a.return_value.size()))}};
}

Definition at line 39 of file test_responses.cpp.

39 {
40 return {fc::mutable_variant_object()("hex" , fc::to_hex(a.data.data(), a.data.size())), {fc::mutable_variant_object()("hex" , fc::to_hex(a.return_value.data(), a.return_value.size()))}};
41 };

◆ mock_data_handler_v0

std::function<std::tuple<fc::variant, std::optional<fc::variant> >(const action_trace_v0&, const yield_function&)> response_test_fixture::mock_data_handler_v0 = default_mock_data_handler_v0

Definition at line 78 of file test_responses.cpp.

◆ mock_data_handler_v1

std::function<std::tuple<fc::variant, std::optional<fc::variant> >(const action_trace_v1&, const yield_function&)> response_test_fixture::mock_data_handler_v1 = default_mock_data_handler_v1

Definition at line 79 of file test_responses.cpp.

◆ mock_get_block

std::function<get_block_t(uint32_t, const yield_function&)> response_test_fixture::mock_get_block

Definition at line 77 of file test_responses.cpp.

◆ response_impl

response_impl_type response_test_fixture::response_impl

Definition at line 81 of file test_responses.cpp.


The documentation for this struct was generated from the following file: