NewInvokeTransaction return smart contract invoke transaction
(gasPrice, gasLimit uint64, invokeCode []byte)
| 275 | |
| 276 | //NewInvokeTransaction return smart contract invoke transaction |
| 277 | func NewInvokeTransaction(gasPrice, gasLimit uint64, invokeCode []byte) *types.MutableTransaction { |
| 278 | invokePayload := &payload.InvokeCode{ |
| 279 | Code: invokeCode, |
| 280 | } |
| 281 | tx := &types.MutableTransaction{ |
| 282 | GasPrice: gasPrice, |
| 283 | GasLimit: gasLimit, |
| 284 | TxType: types.InvokeNeo, |
| 285 | Nonce: rand.Uint32(), |
| 286 | Payload: invokePayload, |
| 287 | Sigs: make([]types.Sig, 0, 0), |
| 288 | } |
| 289 | return tx |
| 290 | } |
| 291 | |
| 292 | func SignTransaction(signer *account.Account, tx *types.MutableTransaction) error { |
| 293 | if tx.Payer == common.ADDRESS_EMPTY { |
no outgoing calls
no test coverage detected