Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
6283188f
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6283188f
编写于
8月 26, 2017
作者:
B
Brian Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Splitting out tracking account transactions into its own index.
上级
f0d14a0c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
18 deletion
+61
-18
libraries/chain/include/eos/chain/types.hpp
libraries/chain/include/eos/chain/types.hpp
+2
-0
plugins/account_history_plugin/include/eos/account_history_plugin/account_transaction_history_object.hpp
...unt_history_plugin/account_transaction_history_object.hpp
+57
-0
plugins/account_history_plugin/include/eos/account_history_plugin/transaction_history_object.hpp
...eos/account_history_plugin/transaction_history_object.hpp
+2
-18
未找到文件。
libraries/chain/include/eos/chain/types.hpp
浏览文件 @
6283188f
...
...
@@ -174,6 +174,7 @@ namespace eos { namespace chain {
generated_transaction_object_type
,
producer_object_type
,
chain_property_object_type
,
account_transaction_history_object_type
,
///< Defined by account_history_plugin
transaction_history_object_type
,
///< Defined by account_history_plugin
balance_object_type
,
///< Defined by native_contract library
staked_balance_object_type
,
///< Defined by native_contract library
...
...
@@ -223,6 +224,7 @@ FC_REFLECT_ENUM(eos::chain::object_type,
(
generated_transaction_object_type
)
(
producer_object_type
)
(
chain_property_object_type
)
(
account_transaction_history_object_type
)
(
transaction_history_object_type
)
(
balance_object_type
)
(
staked_balance_object_type
)
...
...
plugins/account_history_plugin/include/eos/account_history_plugin/account_transaction_history_object.hpp
0 → 100644
浏览文件 @
6283188f
#pragma once
#include <chainbase/chainbase.hpp>
#include <eos/chain/types.hpp>
namespace
std
{
template
<
>
struct
hash
<
eos
::
chain
::
AccountName
>
{
size_t
operator
()(
const
eos
::
chain
::
AccountName
&
name
)
const
{
return
(
uint64_t
)
name
;
}
};
}
namespace
eos
{
using
chain
::
AccountName
;
using
chain
::
shared_vector
;
using
chain
::
transaction_id_type
;
using
namespace
boost
::
multi_index
;
class
account_transaction_history_object
:
public
chainbase
::
object
<
chain
::
account_transaction_history_object_type
,
account_transaction_history_object
>
{
OBJECT_CTOR
(
account_transaction_history_object
)
id_type
id
;
AccountName
account_name
;
transaction_id_type
transaction_id
;
};
struct
by_id
;
struct
by_account_name
;
struct
by_account_name_trx_id
;
using
account_transaction_history_multi_index
=
chainbase
::
shared_multi_index_container
<
account_transaction_history_object
,
indexed_by
<
ordered_unique
<
tag
<
by_id
>
,
BOOST_MULTI_INDEX_MEMBER
(
account_transaction_history_object
,
account_transaction_history_object
::
id_type
,
id
)
>
,
hashed_non_unique
<
tag
<
by_account_name
>
,
BOOST_MULTI_INDEX_MEMBER
(
account_transaction_history_object
,
AccountName
,
account_name
),
std
::
hash
<
AccountName
>>
,
hashed_unique
<
tag
<
by_account_name_trx_id
>
,
composite_key
<
account_transaction_history_object
,
member
<
account_transaction_history_object
,
AccountName
,
&
account_transaction_history_object
::
account_name
>
,
member
<
account_transaction_history_object
,
transaction_id_type
,
&
account_transaction_history_object
::
transaction_id
>
>
,
composite_key_hash
<
std
::
hash
<
AccountName
>
,
std
::
hash
<
transaction_id_type
>
>
>
>
>
;
typedef
chainbase
::
generic_index
<
account_transaction_history_multi_index
>
account_transaction_history_index
;
}
CHAINBASE_SET_INDEX_TYPE
(
eos
::
account_transaction_history_object
,
eos
::
account_transaction_history_multi_index
)
FC_REFLECT
(
eos
::
account_transaction_history_object
,
(
account_name
)(
transaction_id
)
)
plugins/account_history_plugin/include/eos/account_history_plugin/transaction_history_object.hpp
浏览文件 @
6283188f
...
...
@@ -2,20 +2,7 @@
#include <chainbase/chainbase.hpp>
namespace
std
{
template
<
>
struct
hash
<
eos
::
chain
::
AccountName
>
{
size_t
operator
()(
const
eos
::
chain
::
AccountName
&
name
)
const
{
return
(
uint64_t
)
name
;
}
};
}
namespace
eos
{
using
chain
::
AccountName
;
using
chain
::
block_id_type
;
using
chain
::
transaction_id_type
;
using
namespace
boost
::
multi_index
;
...
...
@@ -26,18 +13,15 @@ class transaction_history_object : public chainbase::object<chain::transaction_h
id_type
id
;
block_id_type
block_id
;
transaction_id_type
transaction_id
;
AccountName
account_name
;
};
struct
by_id
;
struct
by_trx_id
;
struct
by_account_name
;
using
transaction_history_multi_index
=
chainbase
::
shared_multi_index_container
<
transaction_history_object
,
indexed_by
<
ordered_unique
<
tag
<
by_id
>
,
BOOST_MULTI_INDEX_MEMBER
(
transaction_history_object
,
transaction_history_object
::
id_type
,
id
)
>
,
hashed_non_unique
<
tag
<
by_trx_id
>
,
BOOST_MULTI_INDEX_MEMBER
(
transaction_history_object
,
transaction_id_type
,
transaction_id
),
std
::
hash
<
transaction_id_type
>>
,
hashed_non_unique
<
tag
<
by_account_name
>
,
BOOST_MULTI_INDEX_MEMBER
(
transaction_history_object
,
AccountName
,
account_name
),
std
::
hash
<
AccountName
>>
hashed_unique
<
tag
<
by_trx_id
>
,
BOOST_MULTI_INDEX_MEMBER
(
transaction_history_object
,
transaction_id_type
,
transaction_id
),
std
::
hash
<
transaction_id_type
>>
>
>
;
...
...
@@ -47,5 +31,5 @@ typedef chainbase::generic_index<transaction_history_multi_index> transaction_hi
CHAINBASE_SET_INDEX_TYPE
(
eos
::
transaction_history_object
,
eos
::
transaction_history_multi_index
)
FC_REFLECT
(
eos
::
transaction_history_object
,
(
block_id
)(
transaction_id
)
(
account_name
)
)
FC_REFLECT
(
eos
::
transaction_history_object
,
(
block_id
)(
transaction_id
)
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录