Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
712285eb
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,发现更多精彩内容 >>
未验证
提交
712285eb
编写于
1月 24, 2018
作者:
K
Kevin Heifner
提交者:
GitHub
1月 24, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1175 from EOSIO/DAWN-507-verify-balance-GH-#1139
DAWN-507 verify balance
上级
2e8de73e
322d08eb
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
36 deletion
+41
-36
libraries/chain/include/eosio/chain/transaction.hpp
libraries/chain/include/eosio/chain/transaction.hpp
+5
-1
plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp
.../chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp
+2
-2
plugins/mongo_db_plugin/mongo_db_plugin.cpp
plugins/mongo_db_plugin/mongo_db_plugin.cpp
+1
-1
programs/eosioc/main.cpp
programs/eosioc/main.cpp
+2
-7
tests/eosiod_run_test.py
tests/eosiod_run_test.py
+30
-24
tests/testUtils.py
tests/testUtils.py
+1
-1
未找到文件。
libraries/chain/include/eosio/chain/transaction.hpp
浏览文件 @
712285eb
...
...
@@ -37,7 +37,7 @@ namespace eosio { namespace chain {
account_name
account
;
action_name
name
;
vector
<
permission_level
>
authorization
;
vector
<
char
>
data
;
bytes
data
;
action
(){}
...
...
@@ -57,6 +57,10 @@ namespace eosio { namespace chain {
data
=
fc
::
raw
::
pack
(
value
);
}
action
(
vector
<
permission_level
>
auth
,
account_name
account
,
action_name
name
,
const
bytes
&
data
)
:
account
(
account
),
name
(
name
),
authorization
(
move
(
auth
)),
data
(
data
)
{
}
template
<
typename
T
>
T
as
()
const
{
FC_ASSERT
(
account
==
T
::
get_account
()
);
...
...
plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp
浏览文件 @
712285eb
...
...
@@ -176,7 +176,7 @@ public:
struct
get_table_rows_result
{
vector
<
fc
::
variant
>
rows
;
///< one row per item, either encoded as hex String or JSON object
bool
more
;
///< true if last element in data is not the end and sizeof data() < limit
bool
more
=
false
;
///< true if last element in data is not the end and sizeof data() < limit
};
get_table_rows_result
get_table_rows
(
const
get_table_rows_params
&
params
)
const
;
...
...
@@ -376,7 +376,7 @@ FC_REFLECT(eosio::chain_apis::read_only::get_block_params, (block_num_or_id))
FC_REFLECT_DERIVED
(
eosio
::
chain_apis
::
read_only
::
get_block_results
,
(
eosio
::
chain
::
signed_block
),
(
id
)(
block_num
)(
ref_block_prefix
)
);
FC_REFLECT
(
eosio
::
chain_apis
::
read_write
::
push_transaction_results
,
(
transaction_id
)(
processed
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_table_rows_params
,
(
json
)(
table_key
)(
scope
)(
code
)(
table
)(
lower_bound
)(
upper_bound
)(
limit
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_table_rows_params
,
(
json
)(
scope
)(
code
)(
table
)(
table_key
)(
lower_bound
)(
upper_bound
)(
limit
)
)
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_table_rows_result
,
(
rows
)(
more
)
);
FC_REFLECT
(
eosio
::
chain_apis
::
read_only
::
get_currency_balance_params
,
(
code
)(
account
)(
symbol
));
...
...
plugins/mongo_db_plugin/mongo_db_plugin.cpp
浏览文件 @
712285eb
...
...
@@ -185,7 +185,7 @@ namespace {
if
(
msg
.
account
==
chain
::
config
::
system_account_name
)
{
abis
.
set_abi
(
mongo_db_plugin_impl
::
eos_abi
);
}
else
{
auto
from_account
=
find_account
(
accounts
,
msg
.
name
);
auto
from_account
=
find_account
(
accounts
,
msg
.
account
);
auto
abi
=
fc
::
json
::
from_string
(
bsoncxx
::
to_json
(
from_account
.
view
()[
"abi"
].
get_document
())).
as
<
abi_def
>
();
abis
.
set_abi
(
abi
);
}
...
...
programs/eosioc/main.cpp
浏览文件 @
712285eb
...
...
@@ -1130,7 +1130,7 @@ int main( int argc, char** argv ) {
auto
push
=
app
.
add_subcommand
(
"push"
,
localized
(
"Push arbitrary transactions to the blockchain"
),
false
);
push
->
require_subcommand
();
// push action
s
// push action
string
contract
;
string
action
;
string
data
;
...
...
@@ -1156,12 +1156,7 @@ int main( int argc, char** argv ) {
auto
accountPermissions
=
get_account_permissions
(
permissions
);
signed_transaction
trx
;
eosio
::
chain
::
action
act
;
act
.
account
=
contract
;
act
.
name
=
action
;
act
.
authorization
=
accountPermissions
;
act
.
data
=
result
.
get_object
()[
"binargs"
].
as
<
bytes
>
();
trx
.
actions
.
push_back
(
act
);
trx
.
actions
.
emplace_back
(
accountPermissions
,
contract
,
action
,
result
.
get_object
()[
"binargs"
].
as
<
bytes
>
());
if
(
tx_force_unique
)
{
trx
.
actions
.
emplace_back
(
generate_nonce
()
);
...
...
tests/eosiod_run_test.py
浏览文件 @
712285eb
...
...
@@ -417,10 +417,13 @@ try:
if
abiName
!=
"transfer"
or
abiActionName
!=
"transfer"
or
abiType
!=
"transfer"
:
errorExit
(
"FAILURE - get table currency account failed"
,
raw
=
True
)
if
amINoon
and
exitEarly
:
Print
(
"Stoping test at this point pending additional fixes."
)
testSuccessful
=
True
exit
(
0
)
if
amINoon
:
Print
(
"push issue action to currency contract"
)
contract
=
"currency"
action
=
"issue"
data
=
"{
\"
to
\"
:
\"
currency
\"
,
\"
quantity
\"
:
\"
100000.0000 CUR
\"
}"
opts
=
"--permission currency@active"
trans
=
node
.
pushMessage
(
contract
,
action
,
data
,
opts
)
Print
(
"Verify currency contract has proper initial balance"
)
contract
=
"currency"
...
...
@@ -432,14 +435,14 @@ try:
balanceKey
=
"balance"
keyKey
=
"key"
if
row0
[
balanceKey
]
!=
1000000000
or
row0
[
keyKey
]
!=
"account"
:
if
row0
[
balanceKey
]
!=
1000000000
:
errorExit
(
"FAILURE - get table currency account failed"
,
raw
=
True
)
Print
(
"push
message
to currency contract"
)
Print
(
"push
transfer action
to currency contract"
)
contract
=
"currency"
action
=
"transfer"
data
=
"{
\"
from
\"
:
\"
currency
\"
,
\"
to
\"
:
\"
inita
\"
,
\"
quantity
\"
:
50
}"
opts
=
"--
scope currency,inita --
permission currency@active"
data
=
"{
\"
from
\"
:
\"
currency
\"
,
\"
to
\"
:
\"
inita
\"
,
\"
quantity
\"
:
\"
00.0050 CUR
\"
,
\"
memo
\"
:
\"
test
\"
}"
opts
=
"--permission currency@active"
trans
=
node
.
pushMessage
(
contract
,
action
,
data
,
opts
)
if
trans
is
None
:
cmdError
(
"%s push message currency transfer"
%
(
ClientName
))
...
...
@@ -475,14 +478,15 @@ try:
Print
(
"Exchange Contract Tests"
)
Print
(
"upload exchange contract"
)
wastFile
=
"contracts/exchange/exchange.wast"
abiFile
=
"contracts/exchange/exchange.abi"
Print
(
"Publish contract"
)
trans
=
node
.
publishContract
(
exchangeAccount
.
name
,
wastFile
,
abiFile
,
waitForTransBlock
=
True
)
if
trans
is
None
:
cmdError
(
"%s set contract exchange"
%
(
ClientName
))
errorExit
(
"Failed to publish contract."
)
# TODO Exchange contract currently not working on eos-noon
if
not
amINoon
:
wastFile
=
"contracts/exchange/exchange.wast"
abiFile
=
"contracts/exchange/exchange.abi"
Print
(
"Publish exchange contract"
)
trans
=
node
.
publishContract
(
exchangeAccount
.
name
,
wastFile
,
abiFile
,
waitForTransBlock
=
True
)
if
trans
is
None
:
cmdError
(
"%s set contract exchange"
%
(
ClientName
))
errorExit
(
"Failed to publish contract."
)
wastFile
=
"contracts/simpledb/simpledb.wast"
abiFile
=
"contracts/simpledb/simpledb.abi"
...
...
@@ -511,12 +515,14 @@ try:
cmdError
(
"%s set action permission set"
%
(
ClientName
))
errorExit
(
"Failed to set permission"
)
Print
(
"remove permission"
)
requirement
=
"null"
trans
=
node
.
setPermission
(
testeraAccount
.
name
,
code
,
pType
,
requirement
,
waitForTransBlock
=
True
)
if
trans
is
None
:
cmdError
(
"%s set action permission set"
%
(
ClientName
))
errorExit
(
"Failed to remove permission"
)
# TODO remove failed on eos-noon
if
not
amINoon
:
Print
(
"remove permission"
)
requirement
=
"null"
trans
=
node
.
setPermission
(
testeraAccount
.
name
,
code
,
pType
,
requirement
,
waitForTransBlock
=
True
)
if
trans
is
None
:
cmdError
(
"%s set action permission set"
%
(
ClientName
))
errorExit
(
"Failed to remove permission"
)
Print
(
"Locking all wallets."
)
if
not
walletMgr
.
lockAllWallets
():
...
...
@@ -574,8 +580,8 @@ try:
# errorExit("mongo get messages by transaction id %s" % (transId))
Print
(
"Request invalid block numbered %d"
%
(
currentBlockNum
+
100
))
block
=
node
.
getBlock
(
currentBlockNum
+
100
,
silentErrors
=
True
,
retry
=
False
)
Print
(
"Request invalid block numbered %d"
%
(
currentBlockNum
+
100
0
))
block
=
node
.
getBlock
(
currentBlockNum
+
100
0
,
silentErrors
=
True
,
retry
=
False
)
if
block
is
not
None
:
errorExit
(
"ERROR: Received block where not expected"
)
else
:
...
...
tests/testUtils.py
浏览文件 @
712285eb
...
...
@@ -726,7 +726,7 @@ class Node(object):
def
pushMessage
(
self
,
contract
,
action
,
data
,
opts
):
cmd
=
None
if
Utils
.
amINoon
:
cmd
=
"%s %s push action
s
%s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
contract
,
action
)
cmd
=
"%s %s push action %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
contract
,
action
)
else
:
cmd
=
"%s %s push message %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
contract
,
action
)
cmdArr
=
cmd
.
split
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录