Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
contract-case
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanjinfei
contract-case
Commits
97334fd6
Commit
97334fd6
authored
Jun 02, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print log
parent
e6974fbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
partlyRelatedCase.go
operator/partlyRelatedCase.go
+5
-1
No files found.
operator/partlyRelatedCase.go
View file @
97334fd6
...
...
@@ -1068,6 +1068,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
log
.
Error
(
"Get erc20 balanceOf error:"
,
err
.
Error
())
return
nil
,
nil
}
log
.
Infof
(
"ERC20 Before to addr:%s,toBal:"
,
testAccArr
.
ToAddr
[
i
]
.
Hex
(),
toBal
.
String
())
beforeAddrErc20Bal
[
testAccArr
.
ToAddr
[
i
]]
=
toBal
fromBal
,
err
:=
erc20Contract
.
BalanceOf
(
&
bind
.
CallOpts
{},
testAccArr
.
FromAddr
[
i
])
...
...
@@ -1075,6 +1076,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
log
.
Error
(
"Get erc20 balanceOf error:"
,
err
.
Error
())
return
nil
,
nil
}
log
.
Infof
(
"ERC20 Before from addr:%s,fromBal:"
,
testAccArr
.
FromAddr
[
i
]
.
Hex
(),
fromBal
.
String
())
beforeAddrErc20Bal
[
testAccArr
.
FromAddr
[
i
]]
=
fromBal
oneErc20Trade
.
ToAddr
=
[]
common
.
Address
{
testAccArr
.
ToAddr
[
i
]}
...
...
@@ -1087,7 +1089,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
auth
.
NoSend
=
true
auth
.
GasLimit
=
500000
auth
.
GasPrice
=
big
.
NewInt
(
10000000000
)
tx
,
err
:=
oneErc20Trade
.
Erc20OneTransferTx
(
auth
,
tokenTransfer
)
tx
,
err
:=
oneErc20Trade
.
Erc20OneTransfer
From
Tx
(
auth
,
tokenTransfer
)
if
err
!=
nil
{
return
nil
,
nil
}
...
...
@@ -1102,11 +1104,13 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
log
.
Error
(
"Get erc20 balanceOf error:"
,
err
.
Error
())
res
=
false
}
log
.
Infof
(
"ERC20 After to addr:%s,toBal:"
,
testAccArr
.
ToAddr
[
i
]
.
Hex
(),
to
.
String
())
if
to
.
Sub
(
to
,
beforeAddrErc20Bal
[
testAccArr
.
ToAddr
[
i
]])
.
Cmp
(
amount
)
!=
0
{
res
=
false
}
from
,
err
:=
erc20Contract
.
BalanceOf
(
&
bind
.
CallOpts
{},
testAccArr
.
FromAddr
[
i
])
log
.
Infof
(
"ERC20 After to addr:%s,fromBal:"
,
testAccArr
.
FromAddr
[
i
]
.
Hex
(),
from
.
String
())
if
err
!=
nil
{
log
.
Error
(
"Get erc20 balanceOf error:"
,
err
.
Error
())
res
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment