Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
99beccbd
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,发现更多精彩内容 >>
未验证
提交
99beccbd
编写于
5月 31, 2018
作者:
T
Thomas Cox
提交者:
GitHub
5月 31, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into thomasbcox-missing-rcs
上级
bac3e228
dd1e386a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
105 addition
and
0 deletion
+105
-0
tests/nodeos_run_test.py
tests/nodeos_run_test.py
+105
-0
未找到文件。
tests/nodeos_run_test.py
浏览文件 @
99beccbd
...
...
@@ -159,6 +159,8 @@ try:
cmdError
(
"eos wallet create"
)
errorExit
(
"Failed to create wallet %s."
%
(
defproduceraWalletName
))
Print
(
"Wallet
\"
%s
\"
password=%s."
%
(
defproduceraWalletName
,
defproduceraWallet
.
password
.
encode
(
"utf-8"
)))
defproduceraAccount
=
cluster
.
defproduceraAccount
defproducerbAccount
=
cluster
.
defproducerbAccount
...
...
@@ -505,6 +507,16 @@ try:
errorExit
(
"Failed to push message to currency1111 contract"
)
transId
=
testUtils
.
Node
.
getTransId
(
trans
[
1
])
Print
(
"push duplicate transfer action to currency1111 contract"
)
transDuplicate
=
node
.
pushMessage
(
contract
,
action
,
data
,
opts
,
True
)
if
transDuplicate
is
not
None
and
transDuplicate
[
0
]:
transDuplicateId
=
testUtils
.
Node
.
getTransId
(
transDuplicate
[
1
])
if
transId
!=
transDuplicateId
:
cmdError
(
"%s push message currency1111 duplicate transfer incorrectly accepted, but they were generated with different transaction ids, it is likely a timing issue, report if problem persists,
\n
orig: %s
\n
dup: %s"
%
(
ClientName
,
trans
,
transDuplicate
))
else
:
cmdError
(
"%s push message currency1111 transfer,
\n
orig: %s
\n
dup: %s"
%
(
ClientName
,
trans
,
transDuplicate
))
errorExit
(
"Failed to reject duplicate message for currency1111 contract"
)
Print
(
"verify transaction exists"
)
if
not
node
.
waitForTransIdOnNode
(
transId
):
cmdError
(
"%s get transaction trans_id"
%
(
ClientName
))
...
...
@@ -575,6 +587,99 @@ try:
Print
(
"FAILURE - Failed to parse block transaction. %s"
%
(
myTrans
))
raise
Print
(
"Unlocking wallet
\"
%s
\"
."
%
(
defproduceraWallet
.
name
))
if
not
walletMgr
.
unlockWallet
(
defproduceraWallet
):
cmdError
(
"%s wallet unlock"
%
(
ClientName
))
errorExit
(
"Failed to unlock wallet %s"
%
(
defproduceraWallet
.
name
))
Print
(
"push transfer action to currency1111 contract that would go negative"
)
contract
=
"currency1111"
action
=
"transfer"
data
=
"{
\"
from
\"
:
\"
defproducera
\"
,
\"
to
\"
:
\"
currency1111
\"
,
\"
quantity
\"
:"
data
+=
"
\"
00.0051 CUR
\"
,
\"
memo
\"
:
\"
test
\"
}"
opts
=
"--permission defproducera@active"
trans
=
node
.
pushMessage
(
contract
,
action
,
data
,
opts
,
True
)
if
trans
is
None
or
trans
[
0
]:
cmdError
(
"%s push message currency1111 transfer should have failed"
%
(
ClientName
))
errorExit
(
"Failed to reject invalid transfer message to currency1111 contract"
)
Print
(
"read current contract balance"
)
amountStr
=
node
.
getTableAccountBalance
(
"currency1111"
,
defproduceraAccount
.
name
)
expected
=
"0.0050 CUR"
actual
=
amountStr
if
actual
!=
expected
:
errorExit
(
"FAILURE - Wrong currency1111 balance (expected=%s, actual=%s)"
%
(
str
(
expected
),
str
(
actual
)),
raw
=
True
)
amountStr
=
node
.
getTableAccountBalance
(
"currency1111"
,
currencyAccount
.
name
)
expected
=
"99999.9950 CUR"
actual
=
amountStr
if
actual
!=
expected
:
errorExit
(
"FAILURE - Wrong currency1111 balance (expected=%s, actual=%s)"
%
(
str
(
expected
),
str
(
actual
)),
raw
=
True
)
Print
(
"push another transfer action to currency1111 contract"
)
contract
=
"currency1111"
action
=
"transfer"
data
=
"{
\"
from
\"
:
\"
defproducera
\"
,
\"
to
\"
:
\"
currency1111
\"
,
\"
quantity
\"
:"
data
+=
"
\"
00.0050 CUR
\"
,
\"
memo
\"
:
\"
test
\"
}"
opts
=
"--permission defproducera@active"
trans
=
node
.
pushMessage
(
contract
,
action
,
data
,
opts
)
if
trans
is
None
or
not
trans
[
0
]:
cmdError
(
"%s push message currency1111 transfer"
%
(
ClientName
))
errorExit
(
"Failed to push message to currency1111 contract"
)
transId
=
testUtils
.
Node
.
getTransId
(
trans
[
1
])
Print
(
"read current contract balance"
)
amountStr
=
node
.
getCurrencyBalance
(
"currency1111"
,
defproduceraAccount
.
name
,
"CUR"
)
expected
=
"0.0000 CUR"
try
:
actual
=
amountStr
.
strip
()
assert
(
expected
==
actual
or
not
actual
)
except
(
AssertionError
,
KeyError
)
as
_
:
Print
(
"ERROR: Failed get currecy balance assertion. (expected=<%s>, actual=<%s>)"
%
(
str
(
expected
),
str
(
actual
)))
raise
amountStr
=
node
.
getTableAccountBalance
(
"currency1111"
,
currencyAccount
.
name
)
expected
=
"100000.0000 CUR"
actual
=
amountStr
if
actual
!=
expected
:
errorExit
(
"FAILURE - Wrong currency1111 balance (expected=%s, actual=%s)"
%
(
str
(
expected
),
str
(
actual
)),
raw
=
True
)
Print
(
"push transfer action to currency1111 contract that would go negative"
)
contract
=
"currency1111"
action
=
"transfer"
data
=
"{
\"
from
\"
:
\"
defproducera
\"
,
\"
to
\"
:
\"
currency1111
\"
,
\"
quantity
\"
:"
data
+=
"
\"
00.0025 CUR
\"
,
\"
memo
\"
:
\"
test
\"
}"
opts
=
"--permission defproducera@active"
trans
=
node
.
pushMessage
(
contract
,
action
,
data
,
opts
,
True
)
if
trans
is
None
or
trans
[
0
]:
cmdError
(
"%s push message currency1111 transfer should have failed"
%
(
ClientName
))
errorExit
(
"Failed to reject invalid transfer message to currency1111 contract"
)
Print
(
"read current contract balance"
)
amountStr
=
node
.
getCurrencyBalance
(
"currency1111"
,
defproduceraAccount
.
name
,
"CUR"
)
expected
=
"0.0000 CUR"
try
:
actual
=
amountStr
.
strip
()
assert
(
expected
==
actual
or
not
actual
)
except
(
AssertionError
,
KeyError
)
as
_
:
Print
(
"ERROR: Failed get currecy balance assertion. (expected=<%s>, actual=<%s>)"
%
(
str
(
expected
),
str
(
actual
)))
raise
amountStr
=
node
.
getTableAccountBalance
(
"currency1111"
,
currencyAccount
.
name
)
expected
=
"100000.0000 CUR"
actual
=
amountStr
if
actual
!=
expected
:
errorExit
(
"FAILURE - Wrong currency1111 balance (expected=%s, actual=%s)"
%
(
str
(
expected
),
str
(
actual
)),
raw
=
True
)
Print
(
"Locking wallet
\"
%s
\"
."
%
(
defproduceraWallet
.
name
))
if
not
walletMgr
.
lockWallet
(
defproduceraWallet
):
cmdError
(
"%s wallet lock"
%
(
ClientName
))
errorExit
(
"Failed to lock wallet %s"
%
(
defproduceraWallet
.
name
))
Print
(
"Exchange Contract Tests"
)
Print
(
"upload exchange contract"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录