MCPcopy Create free account
hub / github.com/DNAProject/DNA / NewDeployTransaction

Function NewDeployTransaction

core/utils/transaction_builder.go:42–52  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

40
41// NewDeployTransaction returns a deploy Transaction
42func 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
55func NewInvokeTransaction(code []byte) *types.MutableTransaction {

Callers 1

TestStatelessValidatorFunction · 0.92

Calls 1

NewDeployCodeFunction · 0.92

Tested by 1

TestStatelessValidatorFunction · 0.74