(nonce uint64, to *common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, txtype uint64)
| 78 | } |
| 79 | |
| 80 | func newTransaction(nonce uint64, to *common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, txtype uint64) *Transaction { |
| 81 | if len(data) > 0 { |
| 82 | data = common.CopyBytes(data) |
| 83 | } |
| 84 | d := txdata{ |
| 85 | Type: txtype, |
| 86 | AccountNonce: nonce, |
| 87 | Recipient: to, |
| 88 | Payload: data, |
| 89 | Amount: new(big.Int), |
| 90 | GasLimit: gasLimit, |
| 91 | Price: new(big.Int), |
| 92 | V: new(big.Int), |
| 93 | R: new(big.Int), |
| 94 | S: new(big.Int), |
| 95 | } |
| 96 | if amount != nil { |
| 97 | d.Amount.Set(amount) |
| 98 | } |
| 99 | if gasPrice != nil { |
| 100 | d.Price.Set(gasPrice) |
| 101 | } |
| 102 | |
| 103 | return &Transaction{data: d} |
| 104 | } |
| 105 | |
| 106 | // ChainId returns which chain id this transaction was signed for (if at all) |
| 107 | func (tx *Transaction) ChainId() *big.Int { |
no test coverage detected