Commit ba73e98d authored by 李伟@五瓣科技's avatar 李伟@五瓣科技

update addr amount

parent 8e9d6b47
...@@ -12,9 +12,9 @@ func buildSendTx(nonce uint64, to common.Address, amount *big.Int, gasLimit uint ...@@ -12,9 +12,9 @@ func buildSendTx(nonce uint64, to common.Address, amount *big.Int, gasLimit uint
return buildTx(nonce, to, amount, gasLimit, gasPrice, data, chainId, privateKey) return buildTx(nonce, to, amount, gasLimit, gasPrice, data, chainId, privateKey)
} }
func buildOriginalTx(nonce uint64, to common.Address, chainId *big.Int, privateKey *ecdsa.PrivateKey) (*types.Transaction, error) { 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(nonce)), 0, big.NewInt(0), nil, chainId, privateKey) return buildTx(nonce, to, big.NewInt(int64(amount)), 0, big.NewInt(0), nil, chainId, privateKey)
} }
......
...@@ -144,10 +144,6 @@ func (web *WebServicer) GetTreeHandler(w http.ResponseWriter, r *http.Request) { ...@@ -144,10 +144,6 @@ func (web *WebServicer) GetTreeHandler(w http.ResponseWriter, r *http.Request) {
batchTxsAsHex := []string{} batchTxsAsHex := []string{}
// for _, hashAsBytes := range v1.BatchTxsHash {
// batchTxsAsHex = append(batchTxsAsHex, fmt.Sprintf("%x", hashAsBytes))
// }
for i := 0; ; i++ { for i := 0; ; i++ {
if len(v1.BatchTxsHash) < 32 { if len(v1.BatchTxsHash) < 32 {
...@@ -449,7 +445,7 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in ...@@ -449,7 +445,7 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in
txshash := make([]string, 0, batchTxSize) txshash := make([]string, 0, batchTxSize)
for i := 0; i < batchTxSize; i++ { for i := 0; i < batchTxSize; i++ {
tx, err := buildOriginalTx(originalTxParam.Nonce, common.HexToAddress(toAddrs[i%addrsL]), big.NewInt(256), nil) tx, err := buildOriginalTx(originalTxParam.Nonce, common.HexToAddress(toAddrs[i%addrsL]), amount, big.NewInt(256), nil)
if err != nil { if err != nil {
return err return err
} }
......
...@@ -77,7 +77,7 @@ func ProduceOriginalTx() error { ...@@ -77,7 +77,7 @@ func ProduceOriginalTx() error {
var txsBytes []byte var txsBytes []byte
var txs []TxWithFrom = make([]TxWithFrom, 0, batchTxSize) var txs []TxWithFrom = make([]TxWithFrom, 0, batchTxSize)
for i := 0; i < batchTxSize; i++ { for i := 0; i < batchTxSize; i++ {
tx, err := buildOriginalTx(originalTxParam.Nonce, toAddress, big.NewInt(256), nil) tx, err := buildOriginalTx(originalTxParam.Nonce, toAddress, 0, big.NewInt(256), nil)
if err != nil { if err != nil {
return err return err
} }
......
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