Commit 58539737 authored by gshx's avatar gshx

Merge branch 'heco-testnet' of https://code.wuban.net.cn/liwei/multisend into heco-testnet

parents c1319fd1 d5340652
......@@ -14,7 +14,7 @@ func buildSendTx(nonce uint64, to common.Address, amount *big.Int, gasLimit uint
func buildOriginalTx(nonce uint64, to common.Address, amount int64, chainId *big.Int, privateKey *ecdsa.PrivateKey) (*types.Transaction, error) {
return buildTx(nonce, to, big.NewInt(int64(amount)), 0, big.NewInt(0), nil, chainId, privateKey)
return buildTx(nonce, to, big.NewInt(amount), 0, big.NewInt(0), nil, chainId, privateKey)
}
......
......@@ -401,7 +401,7 @@ type TxParams struct {
BatchTxSize int64 `json:"batch_tx_size,omitempty"`
BatchTxHashSize int64 `json:"batch_tx_hash_size,omitempty"`
TxCount int64 `json:"tx_count"`
EveryTxAmount int64 `json:"every_tx_amount"`
EveryTxAmount int64 `json:"everyTxAmount"`
//Rate int64 `json:"rate"`
//ExpectedTime int64 `json:"expected_time"`
}
......@@ -434,6 +434,13 @@ func (web *WebServicer) TxsHandler(w http.ResponseWriter, r *http.Request) {
}
if len(params.ToAddrs) == 0 {
http.Error(w, fmt.Sprintf("expected params.ToAddrs length >0 but actually: %d ", len(params.ToAddrs)), http.StatusBadRequest)
return
}
id := uuid.New()
consTxNum := 0
......@@ -521,6 +528,8 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in
tx, err = buildOriginalTx(originalTxParam.Nonce, common.HexToAddress(fromAddr), requestAmount, big.NewInt(256), nil)
} else {
//fmt.Printf("amount: %d idx: %d addrsL: %d \n", amount, i, addrsL)
tx, err = buildOriginalTx(originalTxParam.Nonce, common.HexToAddress(toAddrs[i%addrsL]), amount, big.NewInt(256), nil)
}
......
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