Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
5255ae5a
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,发现更多精彩内容 >>
提交
5255ae5a
编写于
8月 29, 2017
作者:
D
Daniel Larimer
提交者:
GitHub
8月 29, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #259 from EOSIO/pushtrxs-243
implementing push_transactions api #243
上级
d301478e
acbf7130
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
4 deletion
+27
-4
plugins/chain_api_plugin/chain_api_plugin.cpp
plugins/chain_api_plugin/chain_api_plugin.cpp
+2
-1
plugins/chain_plugin/chain_plugin.cpp
plugins/chain_plugin/chain_plugin.cpp
+19
-2
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
...ns/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
+6
-1
未找到文件。
plugins/chain_api_plugin/chain_api_plugin.cpp
浏览文件 @
5255ae5a
...
...
@@ -55,7 +55,8 @@ void chain_api_plugin::plugin_startup() {
CHAIN_RO_CALL
(
abi_json_to_bin
),
CHAIN_RO_CALL
(
abi_bin_to_json
),
CHAIN_RW_CALL
(
push_block
),
CHAIN_RW_CALL
(
push_transaction
)
CHAIN_RW_CALL
(
push_transaction
),
CHAIN_RW_CALL
(
push_transactions
)
});
}
...
...
plugins/chain_plugin/chain_plugin.cpp
浏览文件 @
5255ae5a
...
...
@@ -263,9 +263,26 @@ read_write::push_block_results read_write::push_block(const read_write::push_blo
}
read_write
::
push_transaction_results
read_write
::
push_transaction
(
const
read_write
::
push_transaction_params
&
params
)
{
auto
ptrx
=
db
.
push_transaction
(
params
,
skip_flags
);
auto
pretty_input
=
db
.
transaction_from_variant
(
params
);
auto
ptrx
=
db
.
push_transaction
(
pretty_input
,
skip_flags
);
auto
pretty_trx
=
db
.
transaction_to_variant
(
ptrx
);
return
read_write
::
push_transaction_results
{
params
.
id
(),
pretty_trx
};
return
read_write
::
push_transaction_results
{
pretty_input
.
id
(),
pretty_trx
};
}
read_write
::
push_transactions_results
read_write
::
push_transactions
(
const
read_write
::
push_transactions_params
&
params
)
{
FC_ASSERT
(
params
.
size
()
<=
1000
,
"Attempt to push too many transactions at once"
);
push_transactions_results
result
;
result
.
reserve
(
params
.
size
());
for
(
const
auto
&
item
:
params
)
{
try
{
result
.
emplace_back
(
push_transaction
(
item
)
);
}
catch
(
const
fc
::
exception
&
e
)
{
result
.
emplace_back
(
read_write
::
push_transaction_results
{
chain
::
transaction_id_type
(),
fc
::
mutable_variant_object
(
"error"
,
e
.
to_detail_string
()
)
}
);
}
}
return
result
;
}
read_only
::
get_account_results
read_only
::
get_account
(
const
get_account_params
&
params
)
const
{
...
...
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
浏览文件 @
5255ae5a
...
...
@@ -206,12 +206,17 @@ public:
using
push_block_results
=
empty
;
push_block_results
push_block
(
const
push_block_params
&
params
);
using
push_transaction_params
=
chain
::
SignedTransaction
;
using
push_transaction_params
=
fc
::
variant_object
;
struct
push_transaction_results
{
chain
::
transaction_id_type
transaction_id
;
fc
::
variant
processed
;
};
push_transaction_results
push_transaction
(
const
push_transaction_params
&
params
);
using
push_transactions_params
=
vector
<
push_transaction_params
>
;
using
push_transactions_results
=
vector
<
push_transaction_results
>
;
push_transactions_results
push_transactions
(
const
push_transactions_params
&
params
);
};
}
// namespace chain_apis
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录