mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-22 19:19:09 +00:00
manifest: add Required
field to Standard
`Required` contains standards that are required for this standard. Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
57eec71101
commit
54e3708566
2 changed files with 7 additions and 0 deletions
|
@ -12,4 +12,6 @@ type Standard struct {
|
|||
// If contract contains method with the same name and parameter count,
|
||||
// it must have signature declared by this contract.
|
||||
Optional []manifest.Method
|
||||
// Required contains standards that are required for this standard.
|
||||
Required []string
|
||||
}
|
||||
|
|
|
@ -66,6 +66,11 @@ func ComplyABI(m *manifest.Manifest, st *Standard) error {
|
|||
}
|
||||
|
||||
func comply(m *manifest.Manifest, checkNames bool, st *Standard) error {
|
||||
if len(st.Required) > 0 {
|
||||
if err := check(m, checkNames, st.Required...); err != nil {
|
||||
return fmt.Errorf("required standard '%s' is not supported: %w", st.Name, err)
|
||||
}
|
||||
}
|
||||
if st.Base != nil {
|
||||
if err := comply(m, checkNames, st.Base); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue