Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
6f0cac9d
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,发现更多精彩内容 >>
提交
6f0cac9d
编写于
1月 30, 2018
作者:
K
Kevin Heifner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moving to non-native transfer
上级
aff77933
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
25 deletion
+38
-25
contracts/eosio.system/eosio.system.abi
contracts/eosio.system/eosio.system.abi
+12
-1
contracts/eosio.system/eosio.system.hpp
contracts/eosio.system/eosio.system.hpp
+4
-8
libraries/chain/include/eosio/chain/config.hpp
libraries/chain/include/eosio/chain/config.hpp
+1
-0
plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp
plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp
+1
-2
plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
+3
-3
programs/eosioc/main.cpp
programs/eosioc/main.cpp
+17
-11
未找到文件。
contracts/eosio.system/eosio.system.abi
浏览文件 @
6f0cac9d
...
...
@@ -10,8 +10,16 @@
"fields": [
{"name":"from", "type":"account_name"},
{"name":"to", "type":"account_name"},
{"name":"quantity", "type":"uint64"}
{"name":"quantity", "type":"asset"},
{"name":"memo", "type":"string"}
]
},{
"name": "issue",
"base": "",
"fields": [
{"name":"to", "type":"account_name"},
{"name":"quantity", "type":"asset"}
]
},{
"name": "account",
"base": "",
...
...
@@ -24,6 +32,9 @@
"actions": [{
"name": "transfer",
"type": "transfer"
},{
"name": "issue",
"type": "issue"
}
],
"tables": [{
...
...
contracts/eosio.system/eosio.system.hpp
浏览文件 @
6f0cac9d
...
...
@@ -41,14 +41,10 @@ namespace eosiosystem {
static
void
apply
(
account_name
code
,
action_name
act
)
{
if
(
!
eosio
::
dispatch
<
contract
,
// typename currency::transfer_memo,
// typename currency::issue,
regproducer
,
regproxy
>
(
code
,
act
)
)
{
assert
(
false
,
"received unexpected action"
);
if
(
!
eosio
::
dispatch
<
contract
,
regproducer
,
regproxy
>
(
code
,
act
)
)
{
if
(
!
eosio
::
dispatch
<
currency
,
typename
currency
::
transfer_memo
,
typename
currency
::
issue
>
(
code
,
act
)
)
{
assert
(
false
,
"received unexpected action"
);
}
}
}
/// apply
};
...
...
libraries/chain/include/eosio/chain/config.hpp
浏览文件 @
6f0cac9d
...
...
@@ -19,6 +19,7 @@ const static uint64_t system_account_name = N(eosio);
const
static
uint64_t
nobody_account_name
=
N
(
nobody
);
const
static
uint64_t
anybody_account_name
=
N
(
anybody
);
const
static
uint64_t
producers_account_name
=
N
(
producers
);
const
static
uint64_t
eosio_system_acount_name
=
N
(
eosio
.
system
);
const
static
uint64_t
eosio_auth_scope
=
N
(
eosio
.
auth
);
const
static
uint64_t
eosio_all_scope
=
N
(
eosio
.
all
);
...
...
plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp
浏览文件 @
6f0cac9d
...
...
@@ -222,7 +222,6 @@ struct faucet_testnet_plugin_impl {
auto
&
plugin
=
_app
.
get_plugin
<
chain_plugin
>
();
plugin
.
get_chain_id
(
chainid
);
chain_controller
&
cc
=
plugin
.
chain
();
const
uint64_t
deposit
=
1
;
signed_transaction
trx
;
auto
memo
=
fc
::
variant
(
fc
::
time_point
::
now
()).
as_string
()
+
" "
+
fc
::
variant
(
fc
::
time_point
::
now
().
time_since_epoch
()).
as_string
();
...
...
@@ -233,7 +232,7 @@ struct faucet_testnet_plugin_impl {
auto
recovery_auth
=
chain
::
authority
{
1
,
{},
{{{
_create_account_name
,
"active"
},
1
}}};
trx
.
actions
.
emplace_back
(
vector
<
chain
::
permission_level
>
{{
_create_account_name
,
"active"
}},
contracts
::
newaccount
{
_create_account_name
,
new_account_name
,
owner_auth
,
active_auth
,
recovery_auth
,
deposit
});
contracts
::
newaccount
{
_create_account_name
,
new_account_name
,
owner_auth
,
active_auth
,
recovery_auth
});
trx
.
expiration
=
cc
.
head_block_time
()
+
fc
::
seconds
(
30
);
trx
.
set_reference_block
(
cc
.
head_block_id
());
...
...
plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
浏览文件 @
6f0cac9d
...
...
@@ -75,14 +75,14 @@ struct txn_test_gen_plugin_impl {
signed_transaction
trx
;
trx
.
expiration
=
cc
.
head_block_time
()
+
fc
::
seconds
(
30
);
trx
.
set_reference_block
(
cc
.
head_block_id
());
trx
.
actions
.
emplace_back
(
vector
<
chain
::
permission_level
>
{{
creator
,
"active"
}},
contracts
::
lock
{
creator
,
creator
,
300
});
//todo
trx.actions.emplace_back(vector<chain::permission_level>{{creator,"active"}}, contracts::lock{creator, creator, 300});
//create "A" account
{
auto
owner_auth
=
eosio
::
chain
::
authority
{
1
,
{{
txn_text_receiver_A_pub_key
,
1
}},
{}};
auto
active_auth
=
eosio
::
chain
::
authority
{
1
,
{{
txn_text_receiver_A_pub_key
,
1
}},
{}};
auto
recovery_auth
=
eosio
::
chain
::
authority
{
1
,
{},
{{{
creator
,
"active"
},
1
}}};
trx
.
actions
.
emplace_back
(
vector
<
chain
::
permission_level
>
{{
creator
,
"active"
}},
contracts
::
newaccount
{
creator
,
newaccountA
,
owner_auth
,
active_auth
,
recovery_auth
,
stake
});
//todo
trx.actions.emplace_back(vector<chain::permission_level>{{creator,"active"}}, contracts::newaccount{creator, newaccountA, owner_auth, active_auth, recovery_auth, stake});
}
//create "B" account
{
...
...
@@ -90,7 +90,7 @@ struct txn_test_gen_plugin_impl {
auto
active_auth
=
eosio
::
chain
::
authority
{
1
,
{{
txn_text_receiver_B_pub_key
,
1
}},
{}};
auto
recovery_auth
=
eosio
::
chain
::
authority
{
1
,
{},
{{{
creator
,
"active"
},
1
}}};
trx
.
actions
.
emplace_back
(
vector
<
chain
::
permission_level
>
{{
creator
,
"active"
}},
contracts
::
newaccount
{
creator
,
newaccountB
,
owner_auth
,
active_auth
,
recovery_auth
,
stake
});
//todo
trx.actions.emplace_back(vector<chain::permission_level>{{creator,"active"}}, contracts::newaccount{creator, newaccountB, owner_auth, active_auth, recovery_auth, stake});
}
trx
.
sign
(
creator_priv_key
,
chainid
);
cc
.
push_transaction
(
trx
);
...
...
programs/eosioc/main.cpp
浏览文件 @
6f0cac9d
...
...
@@ -831,22 +831,28 @@ int main( int argc, char** argv ) {
transfer
->
add_flag
(
"-s,--skip-sign"
,
skip_sign
,
localized
(
"Specify that unlocked wallet keys should not be used to sign transaction"
));
add_standard_transaction_options
(
transfer
);
transfer
->
set_callback
([
&
]
{
auto
transfer
=
fc
::
mutable_variant_object
(
"from"
,
sender
)
(
"to"
,
recipient
)
(
"quantity"
,
asset
(
amount
))
(
"memo"
,
memo
);
auto
args
=
fc
::
mutable_variant_object
(
"code"
,
name
(
config
::
eosio_system_acount_name
))
(
"action"
,
"transfer"
)
(
"args"
,
transfer
);
cerr
<<
"before call"
<<
endl
;
auto
result
=
call
(
json_to_bin_func
,
args
);
cerr
<<
"after call"
<<
endl
;
signed_transaction
trx
;
trx
.
actions
.
emplace_back
(
vector
<
chain
::
permission_level
>
{{
sender
,
"active"
}},
config
::
eosio_system_acount_name
,
"transfer"
,
result
.
get_object
()[
"binargs"
].
as
<
bytes
>
());
if
(
tx_force_unique
)
{
if
(
memo
.
size
()
==
0
)
{
// use the memo to add a nonce
memo
=
fc
::
to_string
(
generate_nonce_value
());
}
else
{
// add a nonce actions
trx
.
actions
.
emplace_back
(
generate_nonce
()
);
}
trx
.
actions
.
emplace_back
(
generate_nonce
()
);
}
trx
.
actions
.
emplace_back
(
vector
<
chain
::
permission_level
>
{{
sender
,
"active"
}},
contracts
::
transfer
{
.
from
=
sender
,
.
to
=
recipient
,
.
amount
=
amount
,
.
memo
=
memo
});
auto
info
=
get_info
();
trx
.
expiration
=
info
.
head_block_time
+
tx_expiration
;
trx
.
set_reference_block
(
info
.
head_block_id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录