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

Function CreateDeployCode

core/payload/deploy_code.go:229–255  ·  view source on GitHub ↗
(code []byte,
	vmType uint32,
	name []byte,
	version []byte,
	author []byte,
	email []byte,
	desc []byte)

Source from the content-addressed store, hash-verified

227}
228
229func CreateDeployCode(code []byte,
230 vmType uint32,
231 name []byte,
232 version []byte,
233 author []byte,
234 email []byte,
235 desc []byte) (*DeployCode, error) {
236 if vmType > 255 {
237 return nil, fmt.Errorf("wrong vm flags: %d", vmType)
238 }
239
240 contract := &DeployCode{
241 code: code,
242 vmFlags: byte(vmType),
243 Name: string(name),
244 Version: string(version),
245 Author: string(author),
246 Email: string(email),
247 Description: string(desc),
248 }
249
250 err := validateDeployCode(contract)
251 if err != nil {
252 return nil, err
253 }
254 return contract, nil
255}

Callers 3

isContractParamValidFunction · 0.92
ContractCreateFunction · 0.92
ContractMigrateFunction · 0.92

Calls 2

validateDeployCodeFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected