(code []byte, vmType uint32, name []byte, version []byte, author []byte, email []byte, desc []byte)
| 227 | } |
| 228 | |
| 229 | func 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 | } |
no test coverage detected