提交 31ed46cd 编写于 作者: K Kevin Heifner

Move message_buffer to fc library

上级 3816e47b
......@@ -9,7 +9,7 @@
#include <deque>
#include <array>
namespace eosio {
namespace fc {
template <uint32_t buffer_len>
class mb_datastream;
......@@ -299,4 +299,4 @@ namespace eosio {
return mb_datastream<buffer_len>(*this);
}
} // namespace eosio
} // namespace fc
......@@ -6,7 +6,6 @@
#include <eosio/net_plugin/net_plugin.hpp>
#include <eosio/net_plugin/protocol.hpp>
#include <eosio/net_plugin/message_buffer.hpp>
#include <eosio/chain/chain_controller.hpp>
#include <eosio/chain/exceptions.hpp>
#include <eosio/chain/block.hpp>
......@@ -14,6 +13,7 @@
#include <eosio/utilities/key_conversion.hpp>
#include <eosio/chain/contracts/types.hpp>
#include <fc/network/message_buffer.hpp>
#include <fc/network/ip.hpp>
#include <fc/io/json.hpp>
#include <fc/io/raw.hpp>
......@@ -399,7 +399,7 @@ namespace eosio {
optional<sync_state> peer_requested; // this peer is requesting info from us
socket_ptr socket;
message_buffer<1024*1024> pending_message_buffer;
fc::message_buffer<1024*1024> pending_message_buffer;
vector<char> blk_buffer;
struct queued_write {
......
......@@ -3,7 +3,7 @@
* @copyright defined in eos/LICENSE.txt
*/
#include <eosio/net_plugin/message_buffer.hpp>
#include <fc/network/message_buffer.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
......@@ -36,7 +36,7 @@ constexpr auto def_buffer_size = 1024*1024*def_buffer_size_mb;
BOOST_AUTO_TEST_CASE(message_buffer_construction)
{
try {
eosio::message_buffer<def_buffer_size> mb;
fc::message_buffer<def_buffer_size> mb;
BOOST_CHECK_EQUAL(mb.total_bytes(), def_buffer_size);
BOOST_CHECK_EQUAL(mb.bytes_to_write(), def_buffer_size);
BOOST_CHECK_EQUAL(mb.bytes_to_read(), 0);
......@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(message_buffer_construction)
BOOST_AUTO_TEST_CASE(message_buffer_growth)
{
try {
eosio::message_buffer<def_buffer_size> mb;
fc::message_buffer<def_buffer_size> mb;
mb.add_buffer_to_chain();
BOOST_CHECK_EQUAL(mb.total_bytes(), 2 * def_buffer_size);
BOOST_CHECK_EQUAL(mb.bytes_to_write(), 2 * def_buffer_size);
......@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(message_buffer_peek_read)
try {
{
const uint32_t small = 32;
eosio::message_buffer<small> mb;
fc::message_buffer<small> mb;
BOOST_CHECK_EQUAL(mb.total_bytes(), small);
BOOST_CHECK_EQUAL(mb.bytes_to_write(), small);
BOOST_CHECK_EQUAL(mb.bytes_to_read(), 0);
......@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(message_buffer_write_ptr_to_end)
try {
{
const uint32_t small = 32;
eosio::message_buffer<small> mb;
fc::message_buffer<small> mb;
BOOST_CHECK_EQUAL(mb.total_bytes(), small);
BOOST_CHECK_EQUAL(mb.bytes_to_write(), small);
BOOST_CHECK_EQUAL(mb.bytes_to_read(), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册