Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
c3c5f413
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,发现更多精彩内容 >>
提交
c3c5f413
编写于
6月 12, 2017
作者:
M
Matias Romeo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add API function to return account registered types
上级
f84c0287
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
2 deletion
+32
-2
libraries/chain/include/eos/chain/types.hpp
libraries/chain/include/eos/chain/types.hpp
+2
-2
plugins/chain_api_plugin/chain_api_plugin.cpp
plugins/chain_api_plugin/chain_api_plugin.cpp
+1
-0
plugins/chain_plugin/chain_plugin.cpp
plugins/chain_plugin/chain_plugin.cpp
+20
-0
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
...ns/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
+9
-0
未找到文件。
libraries/chain/include/eos/chain/types.hpp
浏览文件 @
c3c5f413
...
@@ -180,8 +180,8 @@ namespace eos { namespace chain {
...
@@ -180,8 +180,8 @@ namespace eos { namespace chain {
}
}
// eos::chain
}
}
// eos::chain
namespace
fc
{
namespace
fc
{
void
to_variant
(
const
shared_vector
<
eos
::
types
::
Field
>&
c
,
fc
::
variant
&
v
);
void
to_variant
(
const
eos
::
chain
::
shared_vector
<
eos
::
types
::
Field
>&
c
,
fc
::
variant
&
v
);
void
from_variant
(
const
fc
::
variant
&
v
,
shared_vector
<
eos
::
types
::
Field
>&
fields
);
void
from_variant
(
const
fc
::
variant
&
v
,
eos
::
chain
::
shared_vector
<
eos
::
types
::
Field
>&
fields
);
}
}
FC_REFLECT_ENUM
(
eos
::
chain
::
object_type
,
FC_REFLECT_ENUM
(
eos
::
chain
::
object_type
,
...
...
plugins/chain_api_plugin/chain_api_plugin.cpp
浏览文件 @
c3c5f413
...
@@ -49,6 +49,7 @@ void chain_api_plugin::plugin_startup() {
...
@@ -49,6 +49,7 @@ void chain_api_plugin::plugin_startup() {
app
().
get_plugin
<
http_plugin
>
().
add_api
({
app
().
get_plugin
<
http_plugin
>
().
add_api
({
CHAIN_RO_CALL
(
get_info
),
CHAIN_RO_CALL
(
get_info
),
CHAIN_RO_CALL
(
get_block
),
CHAIN_RO_CALL
(
get_block
),
CHAIN_RO_CALL
(
get_types
),
CHAIN_RW_CALL
(
push_block
),
CHAIN_RW_CALL
(
push_block
),
CHAIN_RW_CALL
(
push_transaction
)
CHAIN_RW_CALL
(
push_transaction
)
});
});
...
...
plugins/chain_plugin/chain_plugin.cpp
浏览文件 @
c3c5f413
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <eos/native_contract/native_contract_chain_initializer.hpp>
#include <eos/native_contract/native_contract_chain_initializer.hpp>
#include <fc/io/json.hpp>
#include <fc/io/json.hpp>
#include <fc/variant.hpp>
namespace
eos
{
namespace
eos
{
...
@@ -16,6 +17,8 @@ using fc::flat_map;
...
@@ -16,6 +17,8 @@ using fc::flat_map;
using
chain
::
block_id_type
;
using
chain
::
block_id_type
;
using
chain
::
fork_database
;
using
chain
::
fork_database
;
using
chain
::
block_log
;
using
chain
::
block_log
;
using
chain
::
type_index
;
using
chain
::
by_scope_name
;
class
chain_plugin_impl
{
class
chain_plugin_impl
{
public:
public:
...
@@ -162,6 +165,23 @@ read_only::get_block_results read_only::get_block(const read_only::get_block_par
...
@@ -162,6 +165,23 @@ read_only::get_block_results read_only::get_block(const read_only::get_block_par
"Could not find block: ${block}"
,
(
"block"
,
params
.
block_num_or_id
));
"Could not find block: ${block}"
,
(
"block"
,
params
.
block_num_or_id
));
}
}
read_only
::
get_types_results
read_only
::
get_types
(
const
get_types_params
&
params
)
const
{
auto
&
_db
=
app
().
get_plugin
<
database_plugin
>
().
db
();
auto
&
index
=
_db
.
get_index
<
type_index
,
by_scope_name
>
();
auto
range
=
index
.
equal_range
(
boost
::
make_tuple
(
params
.
account_name
)
);
get_types_results
res
;
for
(
const
auto
&
to
:
boost
::
make_iterator_range
(
range
.
first
,
range
.
second
)
)
{
fc
::
variant
v
;
fc
::
to_variant
(
to
,
v
);
res
.
emplace_back
(
v
);
}
return
res
;
}
read_write
::
push_block_results
read_write
::
push_block
(
const
read_write
::
push_block_params
&
params
)
{
read_write
::
push_block_results
read_write
::
push_block
(
const
read_write
::
push_block_params
&
params
)
{
db
.
push_block
(
params
);
db
.
push_block
(
params
);
return
read_write
::
push_block_results
();
return
read_write
::
push_block_results
();
...
...
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
浏览文件 @
c3c5f413
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
#include <eos/database_plugin/database_plugin.hpp>
#include <eos/database_plugin/database_plugin.hpp>
namespace
fc
{
class
variant
;
}
namespace
eos
{
namespace
eos
{
using
eos
::
chain
::
chain_controller
;
using
eos
::
chain
::
chain_controller
;
using
std
::
unique_ptr
;
using
std
::
unique_ptr
;
...
@@ -35,6 +37,12 @@ public:
...
@@ -35,6 +37,12 @@ public:
};
};
using
get_block_results
=
chain
::
signed_block
;
using
get_block_results
=
chain
::
signed_block
;
get_block_results
get_block
(
const
get_block_params
&
params
)
const
;
get_block_results
get_block
(
const
get_block_params
&
params
)
const
;
struct
get_types_params
{
string
account_name
;
};
using
get_types_results
=
std
::
vector
<
fc
::
variant
>
;
get_types_results
get_types
(
const
get_types_params
&
params
)
const
;
};
};
class
read_write
{
class
read_write
{
...
@@ -89,3 +97,4 @@ FC_REFLECT(eos::chain_apis::read_only::get_info_results,
...
@@ -89,3 +97,4 @@ FC_REFLECT(eos::chain_apis::read_only::get_info_results,
(
head_block_num
)(
head_block_id
)(
head_block_time
)(
head_block_producer
)
(
head_block_num
)(
head_block_id
)(
head_block_time
)(
head_block_producer
)
(
recent_slots
)(
participation_rate
))
(
recent_slots
)(
participation_rate
))
FC_REFLECT
(
eos
::
chain_apis
::
read_only
::
get_block_params
,
(
block_num_or_id
))
FC_REFLECT
(
eos
::
chain_apis
::
read_only
::
get_block_params
,
(
block_num_or_id
))
FC_REFLECT
(
eos
::
chain_apis
::
read_only
::
get_types_params
,
(
account_name
))
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录