Commit 97334fd6 authored by duanjinfei's avatar duanjinfei

add print log

parent e6974fbb
...@@ -1068,6 +1068,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa ...@@ -1068,6 +1068,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
log.Error("Get erc20 balanceOf error:", err.Error()) log.Error("Get erc20 balanceOf error:", err.Error())
return nil, nil return nil, nil
} }
log.Infof("ERC20 Before to addr:%s,toBal:", testAccArr.ToAddr[i].Hex(), toBal.String())
beforeAddrErc20Bal[testAccArr.ToAddr[i]] = toBal beforeAddrErc20Bal[testAccArr.ToAddr[i]] = toBal
fromBal, err := erc20Contract.BalanceOf(&bind.CallOpts{}, testAccArr.FromAddr[i]) fromBal, err := erc20Contract.BalanceOf(&bind.CallOpts{}, testAccArr.FromAddr[i])
...@@ -1075,6 +1076,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa ...@@ -1075,6 +1076,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
log.Error("Get erc20 balanceOf error:", err.Error()) log.Error("Get erc20 balanceOf error:", err.Error())
return nil, nil return nil, nil
} }
log.Infof("ERC20 Before from addr:%s,fromBal:", testAccArr.FromAddr[i].Hex(), fromBal.String())
beforeAddrErc20Bal[testAccArr.FromAddr[i]] = fromBal beforeAddrErc20Bal[testAccArr.FromAddr[i]] = fromBal
oneErc20Trade.ToAddr = []common.Address{testAccArr.ToAddr[i]} oneErc20Trade.ToAddr = []common.Address{testAccArr.ToAddr[i]}
...@@ -1087,7 +1089,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa ...@@ -1087,7 +1089,7 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
auth.NoSend = true auth.NoSend = true
auth.GasLimit = 500000 auth.GasLimit = 500000
auth.GasPrice = big.NewInt(10000000000) auth.GasPrice = big.NewInt(10000000000)
tx, err := oneErc20Trade.Erc20OneTransferTx(auth, tokenTransfer) tx, err := oneErc20Trade.Erc20OneTransferFromTx(auth, tokenTransfer)
if err != nil { if err != nil {
return nil, nil return nil, nil
} }
...@@ -1102,11 +1104,13 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa ...@@ -1102,11 +1104,13 @@ func PrReOneErc20TranCase(txCount int, testAccArr *tool.AccArrFormat, contractMa
log.Error("Get erc20 balanceOf error:", err.Error()) log.Error("Get erc20 balanceOf error:", err.Error())
res = false 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 { if to.Sub(to, beforeAddrErc20Bal[testAccArr.ToAddr[i]]).Cmp(amount) != 0 {
res = false res = false
} }
from, err := erc20Contract.BalanceOf(&bind.CallOpts{}, testAccArr.FromAddr[i]) 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 { if err != nil {
log.Error("Get erc20 balanceOf error:", err.Error()) log.Error("Get erc20 balanceOf error:", err.Error())
res = false res = false
......
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