smartcontract: add list of supported standards to manifest
Closes #1204
This commit is contained in:
parent
3e192b11b2
commit
66ceaa6b75
7 changed files with 59 additions and 35 deletions
|
@ -35,8 +35,11 @@ type Options struct {
|
|||
// The name of the output for contract manifest file.
|
||||
ManifestFile string
|
||||
|
||||
// Contract metadata.
|
||||
// Contract features.
|
||||
ContractFeatures smartcontract.PropertyState
|
||||
|
||||
// The list of standards supported by the contract.
|
||||
ContractSupportedStandards []string
|
||||
}
|
||||
|
||||
type buildInfo struct {
|
||||
|
@ -165,7 +168,7 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
|
|||
}
|
||||
|
||||
if o.ManifestFile != "" {
|
||||
m, err := di.ConvertToManifest(o.ContractFeatures)
|
||||
m, err := di.ConvertToManifest(o.ContractFeatures, o.ContractSupportedStandards...)
|
||||
if err != nil {
|
||||
return b, errors.Wrap(err, "failed to convert debug info to manifest")
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ func parsePairJSON(data []byte, sep string) (string, string, error) {
|
|||
|
||||
// ConvertToManifest converts contract to the manifest.Manifest struct for debugger.
|
||||
// Note: manifest is taken from the external source, however it can be generated ad-hoc. See #1038.
|
||||
func (di *DebugInfo) ConvertToManifest(fs smartcontract.PropertyState) (*manifest.Manifest, error) {
|
||||
func (di *DebugInfo) ConvertToManifest(fs smartcontract.PropertyState, supportedStandards ...string) (*manifest.Manifest, error) {
|
||||
var err error
|
||||
if di.MainPkg == "" {
|
||||
return nil, errors.New("no Main method was found")
|
||||
|
@ -384,6 +384,9 @@ func (di *DebugInfo) ConvertToManifest(fs smartcontract.PropertyState) (*manifes
|
|||
|
||||
result := manifest.NewManifest(di.Hash)
|
||||
result.Features = fs
|
||||
if supportedStandards != nil {
|
||||
result.SupportedStandards = supportedStandards
|
||||
}
|
||||
result.ABI = manifest.ABI{
|
||||
Hash: di.Hash,
|
||||
Methods: methods,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue