Commit f43cd835 authored by duanjinfei's avatar duanjinfei

fix erc721 test case

parent f0b3f991
......@@ -21,7 +21,7 @@
"accStartIndex": 0,
"sendTranAfterSleep": 120,
"isGetAccBalance": false,
"transferType": []
"transferType": [29]
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment