Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
14827605
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,发现更多精彩内容 >>
提交
14827605
编写于
7月 25, 2018
作者:
B
Brian Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added exitOnError flag to Node.transferFunds.
上级
91ba62b4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
24 deletion
+15
-24
tests/Cluster.py
tests/Cluster.py
+0
-1
tests/Node.py
tests/Node.py
+10
-2
tests/nodeos_run_test.py
tests/nodeos_run_test.py
+2
-12
tests/nodeos_under_min_avail_ram.py
tests/nodeos_under_min_avail_ram.py
+2
-6
tests/nodeos_voting_test.py
tests/nodeos_voting_test.py
+1
-3
未找到文件。
tests/Cluster.py
浏览文件 @
14827605
...
...
@@ -460,7 +460,6 @@ class Cluster(object):
Utils
.
Print
(
"Transfer %s units from account %s to %s on eos server port %d"
%
(
transferAmountStr
,
fromm
.
name
,
to
.
name
,
node
.
port
))
trans
=
node
.
transferFunds
(
fromm
,
to
,
transferAmountStr
)
assert
(
trans
)
transId
=
Node
.
getTransId
(
trans
)
if
transId
is
None
:
return
False
...
...
tests/Node.py
浏览文件 @
14827605
...
...
@@ -546,7 +546,7 @@ class Node(object):
return
ret
# Trasfer funds. Returns "transfer" json return object
def
transferFunds
(
self
,
source
,
destination
,
amountStr
,
memo
=
"memo"
,
force
=
False
,
waitForTransBlock
=
False
):
def
transferFunds
(
self
,
source
,
destination
,
amountStr
,
memo
=
"memo"
,
force
=
False
,
waitForTransBlock
=
False
,
exitOnError
=
True
):
assert
isinstance
(
amountStr
,
str
)
assert
(
source
)
assert
(
isinstance
(
source
,
Account
))
...
...
@@ -568,11 +568,19 @@ class Node(object):
except
subprocess
.
CalledProcessError
as
ex
:
msg
=
ex
.
output
.
decode
(
"utf-8"
)
Utils
.
Print
(
"ERROR: Exception during funds transfer. %s"
%
(
msg
))
if
exitOnError
:
Utils
.
cmdError
(
"could not transfer
\"
%s
\"
from %s to %s"
%
(
amountStr
,
source
,
destination
))
errorExit
(
"Failed to transfer
\"
%s
\"
from %s to %s"
%
(
amountStr
,
source
,
destination
))
return
None
assert
(
trans
)
if
trans
is
None
:
Utils
.
cmdError
(
"could not transfer
\"
%s
\"
from %s to %s"
%
(
amountStr
,
source
,
destination
))
errorExit
(
"Failed to transfer
\"
%s
\"
from %s to %s"
%
(
amountStr
,
source
,
destination
))
transId
=
Node
.
getTransId
(
trans
)
if
waitForTransBlock
and
not
self
.
waitForTransInBlock
(
transId
):
if
exitOnError
:
Utils
.
cmdError
(
"could not find transfer with transId=%s in block"
%
(
transId
))
errorExit
(
"Failed to find transfer with transId=%s in block"
%
(
transId
))
return
None
return
trans
...
...
tests/nodeos_run_test.py
浏览文件 @
14827605
...
...
@@ -220,10 +220,7 @@ try:
transferAmount
=
"97.5321 {0}"
.
format
(
CORE_SYMBOL
)
Print
(
"Transfer funds %s from account %s to %s"
%
(
transferAmount
,
defproduceraAccount
.
name
,
testeraAccount
.
name
))
if
node
.
transferFunds
(
defproduceraAccount
,
testeraAccount
,
transferAmount
,
"test transfer"
)
is
None
:
cmdError
(
"%s transfer"
%
(
ClientName
))
errorExit
(
"Failed to transfer funds %d from account %s to %s"
%
(
transferAmount
,
defproduceraAccount
.
name
,
testeraAccount
.
name
))
node
.
transferFunds
(
defproduceraAccount
,
testeraAccount
,
transferAmount
,
"test transfer"
)
expectedAmount
=
transferAmount
Print
(
"Verify transfer, Expected: %s"
%
(
expectedAmount
))
...
...
@@ -235,10 +232,7 @@ try:
transferAmount
=
"0.0100 {0}"
.
format
(
CORE_SYMBOL
)
Print
(
"Force transfer funds %s from account %s to %s"
%
(
transferAmount
,
defproduceraAccount
.
name
,
testeraAccount
.
name
))
if
node
.
transferFunds
(
defproduceraAccount
,
testeraAccount
,
transferAmount
,
"test transfer"
,
force
=
True
)
is
None
:
cmdError
(
"%s transfer"
%
(
ClientName
))
errorExit
(
"Failed to force transfer funds %d from account %s to %s"
%
(
transferAmount
,
defproduceraAccount
.
name
,
testeraAccount
.
name
))
node
.
transferFunds
(
defproduceraAccount
,
testeraAccount
,
transferAmount
,
"test transfer"
,
force
=
True
)
expectedAmount
=
"97.5421 {0}"
.
format
(
CORE_SYMBOL
)
Print
(
"Verify transfer, Expected: %s"
%
(
expectedAmount
))
...
...
@@ -265,10 +259,6 @@ try:
Print
(
"Transfer funds %s from account %s to %s"
%
(
transferAmount
,
testeraAccount
.
name
,
currencyAccount
.
name
))
trans
=
node
.
transferFunds
(
testeraAccount
,
currencyAccount
,
transferAmount
,
"test transfer a->b"
)
if
trans
is
None
:
cmdError
(
"%s transfer"
%
(
ClientName
))
errorExit
(
"Failed to transfer funds %d from account %s to %s"
%
(
transferAmount
,
testeraAccount
.
name
,
currencyAccount
.
name
))
transId
=
Node
.
getTransId
(
trans
)
expectedAmount
=
"98.0311 {0}"
.
format
(
CORE_SYMBOL
)
# 5000 initial deposit
...
...
tests/nodeos_under_min_avail_ram.py
浏览文件 @
14827605
...
...
@@ -124,9 +124,7 @@ try:
trans
=
nodes
[
0
].
createInitializeAccount
(
account
,
cluster
.
eosioAccount
,
stakedDeposit
=
500000
,
waitForTransBlock
=
False
,
stakeNet
=
50000
,
stakeCPU
=
50000
,
buyRAM
=
50000
,
exitOnError
=
True
)
transferAmount
=
"70000000.0000 {0}"
.
format
(
CORE_SYMBOL
)
Print
(
"Transfer funds %s from account %s to %s"
%
(
transferAmount
,
cluster
.
eosioAccount
.
name
,
account
.
name
))
if
nodes
[
0
].
transferFunds
(
cluster
.
eosioAccount
,
account
,
transferAmount
,
"test transfer"
)
is
None
:
errorExit
(
"Failed to transfer funds %d from account %s to %s"
%
(
transferAmount
,
cluster
.
eosioAccount
.
name
,
account
.
name
))
nodes
[
0
].
transferFunds
(
cluster
.
eosioAccount
,
account
,
transferAmount
,
"test transfer"
)
trans
=
nodes
[
0
].
delegatebw
(
account
,
1000000.0000
,
68000000.0000
,
exitOnError
=
True
)
contractAccount
=
cluster
.
createAccountKeys
(
1
)[
0
]
...
...
@@ -136,9 +134,7 @@ try:
trans
=
nodes
[
0
].
createInitializeAccount
(
contractAccount
,
cluster
.
eosioAccount
,
stakedDeposit
=
500000
,
waitForTransBlock
=
False
,
stakeNet
=
50000
,
stakeCPU
=
50000
,
buyRAM
=
50000
,
exitOnError
=
True
)
transferAmount
=
"90000000.0000 {0}"
.
format
(
CORE_SYMBOL
)
Print
(
"Transfer funds %s from account %s to %s"
%
(
transferAmount
,
cluster
.
eosioAccount
.
name
,
contractAccount
.
name
))
if
nodes
[
0
].
transferFunds
(
cluster
.
eosioAccount
,
contractAccount
,
transferAmount
,
"test transfer"
)
is
None
:
errorExit
(
"Failed to transfer funds %d from account %s to %s"
%
(
transferAmount
,
cluster
.
eosioAccount
.
name
,
contractAccount
.
name
))
nodes
[
0
].
transferFunds
(
cluster
.
eosioAccount
,
contractAccount
,
transferAmount
,
"test transfer"
)
trans
=
nodes
[
0
].
delegatebw
(
contractAccount
,
1000000.0000
,
88000000.0000
,
exitOnError
=
True
)
contractDir
=
"contracts/integration_test"
...
...
tests/nodeos_voting_test.py
浏览文件 @
14827605
...
...
@@ -258,9 +258,7 @@ try:
trans
=
node
.
createInitializeAccount
(
account
,
cluster
.
eosioAccount
,
stakedDeposit
=
0
,
waitForTransBlock
=
False
,
stakeNet
=
1000
,
stakeCPU
=
1000
,
buyRAM
=
1000
,
exitOnError
=
True
)
transferAmount
=
"100000000.0000 {0}"
.
format
(
CORE_SYMBOL
)
Print
(
"Transfer funds %s from account %s to %s"
%
(
transferAmount
,
cluster
.
eosioAccount
.
name
,
account
.
name
))
if
node
.
transferFunds
(
cluster
.
eosioAccount
,
account
,
transferAmount
,
"test transfer"
)
is
None
:
errorExit
(
"Failed to transfer funds %d from account %s to %s"
%
(
transferAmount
,
cluster
.
eosioAccount
.
name
,
account
.
name
))
node
.
transferFunds
(
cluster
.
eosioAccount
,
account
,
transferAmount
,
"test transfer"
)
trans
=
node
.
delegatebw
(
account
,
20000000.0000
,
20000000.0000
,
exitOnError
=
True
)
# containers for tracking producers
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录