Commit 7d098078 authored by duanjinfei's avatar duanjinfei

change init account problem

parent 6fd5ed47
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
"goRoutine": 1, "goRoutine": 1,
"generateAccCount": 500, "generateAccCount": 500,
"isDeployContract": false, "isDeployContract": false,
"isInitAccountBalance": false, "isInitAccountBalance": true,
"isInitAccCoin": true, "isInitAccCoin": false,
"isInitContractCoin": true, "isInitContractCoin": false,
"isInitErc20": true, "isInitErc20": false,
"isInitErc721Mint": true, "isInitErc721Mint": false,
"isInitErc721":true , "isInitErc721": false,
"startTokenId": 1, "startTokenId": 1,
"endTokenId": 100, "endTokenId": 100,
"transferType": [1,2,3,4,5,6,7] "transferType": []
} }
......
...@@ -295,29 +295,33 @@ func InitCaseAccount(client *ethclient.Client, txArr []*types.Transaction) []*ty ...@@ -295,29 +295,33 @@ func InitCaseAccount(client *ethclient.Client, txArr []*types.Transaction) []*ty
} }
contractMap := tool.ParseContractConfig("./config/contractConfig.json") contractMap := tool.ParseContractConfig("./config/contractConfig.json")
contractLen := len(contractMap) contractLen := len(contractMap)
tempTxArr := make([]*types.Transaction, 0)
//初始化From账户-500tx //初始化From账户-500tx
if tool.Cfg.IsInitAccCoin { if tool.Cfg.IsInitAccCoin {
tempTxArr, nonce = InitAccountCoin(txArr, nonce, amount, accArr) tempTxArr := make([]*types.Transaction, 0)
tempTxArr, nonce = InitAccountCoin(tempTxArr, nonce, amount, accArr)
txArr = append(txArr, tempTxArr...) txArr = append(txArr, tempTxArr...)
} }
//初始化转账合约账户余额-10tx //初始化转账合约账户余额-10tx
if tool.Cfg.IsInitContractCoin { if tool.Cfg.IsInitContractCoin {
tempTxArr, nonce = InitContractCoin(txArr, nonce, contractLen, contractMap, trade) tempTxArr := make([]*types.Transaction, 0)
tempTxArr, nonce = InitContractCoin(tempTxArr, nonce, contractLen, contractMap, trade)
txArr = append(txArr, tempTxArr...) txArr = append(txArr, tempTxArr...)
} }
// 初始化erc20 并且mint // 初始化erc20 并且mint
if tool.Cfg.IsInitErc20 { if tool.Cfg.IsInitErc20 {
tempTxArr, nonce = InitErc20Acc(txArr, nonce, contractLen, contractMap, accArr, client, auth) tempTxArr := make([]*types.Transaction, 0)
tempTxArr, nonce = InitErc20Acc(tempTxArr, nonce, contractLen, contractMap, accArr, client, auth)
txArr = append(txArr, tempTxArr...) txArr = append(txArr, tempTxArr...)
} }
//初始化erc721 并且mint //初始化erc721 并且mint
if tool.Cfg.IsInitErc721Mint { if tool.Cfg.IsInitErc721Mint {
tempTxArr, nonce = InitErc721AccMint(txArr, nonce, contractLen, contractMap, accArr, client, auth) tempTxArr := make([]*types.Transaction, 0)
tempTxArr, nonce = InitErc721AccMint(tempTxArr, nonce, contractLen, contractMap, accArr, client, auth)
txArr = append(txArr, tempTxArr...) txArr = append(txArr, tempTxArr...)
} }
if tool.Cfg.IsInitErc721 { if tool.Cfg.IsInitErc721 {
tempTxArr, nonce = InitErc721AccTransfer(txArr, nonce, contractLen, contractMap, accArr, client, auth) tempTxArr := make([]*types.Transaction, 0)
tempTxArr, nonce = InitErc721AccTransfer(tempTxArr, nonce, contractLen, contractMap, accArr, client, auth)
txArr = append(txArr, tempTxArr...) txArr = append(txArr, tempTxArr...)
} }
log.Info("Init balance successful,wait send tran...........") log.Info("Init balance successful,wait send tran...........")
......
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