|
1 | 1 | #include <golos/protocol/protocol.hpp> |
| 2 | +#include <golos/plugins/private_message/private_message_operations.hpp> |
| 3 | +#include <golos/plugins/follow/follow_operations.hpp> |
2 | 4 | #include <golos/chain/steem_objects.hpp> |
3 | 5 | #include <fc/smart_ref_impl.hpp> |
4 | 6 |
|
5 | 7 | using namespace golos::chain; |
6 | 8 | using namespace golos::protocol; |
| 9 | +using namespace golos::plugins::private_message; |
| 10 | +using namespace golos::plugins::follow; |
7 | 11 |
|
8 | 12 | using std::string; |
9 | 13 | using std::map; |
@@ -186,6 +190,13 @@ namespace detail_ns { |
186 | 190 | } |
187 | 191 | }; |
188 | 192 |
|
| 193 | + template<> |
| 194 | + struct js_name<private_contact_type> { |
| 195 | + static std::string name() { |
| 196 | + return "private_contact_type"; |
| 197 | + } |
| 198 | + }; |
| 199 | + |
189 | 200 | template<typename O> |
190 | 201 | struct js_name<chainbase::object_id<O>> { |
191 | 202 | static std::string name() { |
@@ -395,6 +406,15 @@ namespace detail_ns { |
395 | 406 | } |
396 | 407 | }; |
397 | 408 |
|
| 409 | + template<> |
| 410 | + struct serializer<private_contact_type, true> { |
| 411 | + static void init() { |
| 412 | + } |
| 413 | + |
| 414 | + static void generate() { |
| 415 | + } |
| 416 | + }; |
| 417 | + |
398 | 418 | template<typename T> |
399 | 419 | struct serializer<fc::optional<T>, false> { |
400 | 420 | static void init() { |
@@ -503,14 +523,51 @@ int main(int argc, char **argv) { |
503 | 523 | } |
504 | 524 | std::cout << "\n"; |
505 | 525 |
|
| 526 | + versioned_chain_properties cp; |
| 527 | + std::cout << "ChainTypes.chain_properties=\n"; |
| 528 | + for (int i = 0; i < cp.count(); ++i) { |
| 529 | + cp.set_which(i); |
| 530 | + cp.visit(detail_ns::serialize_type_visitor(i)); |
| 531 | + } |
| 532 | + std::cout << "\n"; |
| 533 | + |
| 534 | +// follow_plugin_operation fp; |
| 535 | +// std::cout << "ChainTypes.follow_operations=\n"; |
| 536 | +// for (int i = 0; i < fp.count(); ++i) { |
| 537 | +// fp.set_which(i); |
| 538 | +// fp.visit(detail_ns::serialize_type_visitor(i)); |
| 539 | +// } |
| 540 | +// std::cout << "\n"; |
| 541 | + |
| 542 | + std::cout << "ChainTypes.private_contact_types=\n"; |
| 543 | + for (uint8_t i = unknown; i < private_contact_type_size; ++i) { |
| 544 | + std::cout << " " << fc::json::to_string(static_cast<private_contact_type>(i)) << "\n"; |
| 545 | + } |
| 546 | + std::cout << "\n"; |
| 547 | + |
| 548 | +// private_message_plugin_operation pmp; |
| 549 | +// std::cout << "ChainTypes.private_message_operations=\n"; |
| 550 | +// for (int i = 0; i < pmp.count(); ++i) { |
| 551 | +// pmp.set_which(i); |
| 552 | +// pmp.visit(detail_ns::serialize_type_visitor(i)); |
| 553 | +// } |
| 554 | +// std::cout << "\n"; |
| 555 | + |
506 | 556 | detail_ns::js_name<operation>::name("operation"); |
507 | 557 | detail_ns::js_name<future_extensions>::name("future_extensions"); |
| 558 | + detail_ns::js_name<versioned_chain_properties>::name("chain_properties"); |
| 559 | + detail_ns::js_name<follow_plugin_operation>::name("follow"); |
| 560 | + detail_ns::js_name<private_message_plugin_operation>::name("private_message"); |
508 | 561 | detail_ns::serializer<signed_block>::init(); |
509 | 562 | detail_ns::serializer<block_header>::init(); |
510 | 563 | detail_ns::serializer<signed_block_header>::init(); |
511 | 564 | detail_ns::serializer<operation>::init(); |
| 565 | + detail_ns::serializer<versioned_chain_properties>::init(); |
| 566 | + detail_ns::serializer<follow_plugin_operation>::init(); |
| 567 | + detail_ns::serializer<private_message_plugin_operation>::init(); |
512 | 568 | detail_ns::serializer<transaction>::init(); |
513 | 569 | detail_ns::serializer<signed_transaction>::init(); |
| 570 | + |
514 | 571 | for (const auto &gen : detail_ns::serializers) { |
515 | 572 | gen(); |
516 | 573 | } |
|
0 commit comments