copy from smartcontract/service/neovm/config.go to avoid cycle dependences NewDeployTransaction returns a deploy Transaction
(code []byte, name, version, author, email, desp string, vmType payload.VmType)
| 40 | |
| 41 | // NewDeployTransaction returns a deploy Transaction |
| 42 | func NewDeployTransaction(code []byte, name, version, author, email, desp string, vmType payload.VmType) (*types.MutableTransaction, error) { |
| 43 | //TODO: check arguments |
| 44 | depCode, err := payload.NewDeployCode(code, vmType, name, version, author, email, desp) |
| 45 | if err != nil { |
| 46 | return nil, err |
| 47 | } |
| 48 | return &types.MutableTransaction{ |
| 49 | TxType: types.Deploy, |
| 50 | Payload: depCode, |
| 51 | }, nil |
| 52 | } |
| 53 | |
| 54 | // NewInvokeTransaction returns an invoke Transaction |
| 55 | func NewInvokeTransaction(code []byte) *types.MutableTransaction { |