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
f43cd835
Commit
f43cd835
authored
May 24, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix erc721 test case
parent
f0b3f991
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
app.json
config/app.json
+1
-1
partlyRelatedCase.go
operator/partlyRelatedCase.go
+11
-3
No files found.
config/app.json
View file @
f43cd835
...
...
@@ -21,7 +21,7 @@
"accStartIndex"
:
0
,
"sendTranAfterSleep"
:
120
,
"isGetAccBalance"
:
false
,
"transferType"
:
[]
"transferType"
:
[
29
]
}
...
...
operator/partlyRelatedCase.go
View file @
f43cd835
...
...
@@ -1267,12 +1267,13 @@ func PrReErc721TranFromCase(startIndex int, txCount int, testAccArr *tool.AccArr
}
beforeToErc721Bal
:=
make
(
map
[
common
.
Address
]
*
big
.
Int
,
0
)
fromAddr
:=
testAccArr
.
ToAddr
[
0
]
erc721Trade
.
FromAddr
=
fromAddr
beforeFromErc721Bal
,
err
:=
erc721Contract
.
BalanceOf
(
&
bind
.
CallOpts
{},
fromAddr
)
if
err
!=
nil
{
log
.
Error
(
"Get erc721 bal error:"
,
err
.
Error
())
return
nil
,
nil
}
log
.
Info
(
"Erc721
接受
者相关 From balance:"
,
beforeFromErc721Bal
.
String
())
log
.
Info
(
"Erc721
发送
者相关 From balance:"
,
beforeFromErc721Bal
.
String
())
auth
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
testAccArr
.
ToPrv
[
0
],
tool
.
Cfg
.
ChainId
)
if
err
!=
nil
{
log
.
Errorf
(
"DeployTokenTransfer func newKeyedTransactorWithChainID err:"
,
err
)
...
...
@@ -1287,9 +1288,16 @@ func PrReErc721TranFromCase(startIndex int, txCount int, testAccArr *tool.AccArr
log
.
Error
(
"Get erc721 bal error:"
,
err
.
Error
())
return
nil
,
nil
}
log
.
Info
(
"Erc721 接受者相关 to balance:"
,
toErc721Bal
.
String
())
owner
,
err
:=
erc721Contract
.
OwnerOf
(
&
bind
.
CallOpts
{},
big
.
NewInt
(
int64
(
startIndex
)))
if
err
!=
nil
{
log
.
Error
(
"Get tokenID owner failed"
)
return
nil
,
nil
}
if
erc721Trade
.
FromAddr
.
Hex
()
!=
owner
.
Hex
()
{
log
.
Error
(
"TokenID:"
,
startIndex
,
" ,is not belong to:"
,
erc721Trade
.
FromAddr
)
}
log
.
Info
(
"Erc721 发送者相关 to balance:"
,
toErc721Bal
.
String
())
beforeToErc721Bal
[
toAddr
]
=
toErc721Bal
erc721Trade
.
FromAddr
=
fromAddr
erc721Trade
.
TokenId
=
big
.
NewInt
(
int64
(
startIndex
))
auth
.
Nonce
=
big
.
NewInt
(
nonce
)
auth
.
NoSend
=
true
...
...
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