提交 897dbaf5 编写于 作者: N Nathan Hourt

Resolve #1: Replace operations with messages

I've already removed operations from the system; in this commit I add a
new message type and integrate it into the transaction type.
上级 07f027c4
#pragma once
#include <eos/chain/protocol/types.hpp>
namespace eos { namespace chain {
/**
* @brief The message struct defines a blockchain message
*
* Messages are the heart of all activity on the blockchain -- all events and actions which take place in the chain are
* recorded as messages. Messages are sent from one account (@ref sender) to another account (@ref recipient), and are
* optionally also delivered to several other accounts (@ref notify_accounts).
*
* A message has a header that defines who sent it and who will be processing it. The message content is a binary blob,
* @ref data, whose type is determined by @ref type, which is dynamic and defined by the scripting language.
*/
struct message {
/// The account which sent the message
account sender;
/// The account to receive the message
account recipient;
/// Other accounts to notify about this message
vector<account> notify_accounts;
/// The message type -- this is defined by the contract(s) which create and/or process this message
message_type type;
/// The message contents
vector<char> data;
};
} } // namespace eos::chain
FC_REFLECT(eos::chain::message, (sender)(recipient)(notify_accounts)(type)(data))
......@@ -23,6 +23,7 @@
*/
#pragma once
#include <eos/chain/protocol/types.hpp>
#include <eos/chain/message.hpp>
#include <numeric>
......@@ -81,7 +82,8 @@ namespace eos { namespace chain {
*/
fc::time_point_sec expiration;
vector<string> messages;
/// The messages in this transaction
vector<message> messages;
/// Calculate the digest for a transaction
digest_type digest()const;
......
......@@ -90,8 +90,11 @@ namespace eos { namespace chain {
using chainbase::allocator;
using shared_string = boost::interprocess::basic_string<char, std::char_traits<char>, allocator<char>>;
typedef fc::ecc::private_key private_key_type;
typedef fc::sha256 chain_id_type;
using private_key_type = fc::ecc::private_key;
using chain_id_type = fc::sha256;
using account = std::string;
using message_type = std::string;
/**
* List all object types from all namespaces here so they can
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册