core: add nativenames.IsValid
This commit is contained in:
parent
9cb38a4b1b
commit
85a8644517
2 changed files with 34 additions and 0 deletions
19
pkg/core/native/nativenames_test.go
Normal file
19
pkg/core/native/nativenames_test.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package native
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNativenamesIsValid(t *testing.T) {
|
||||
// test that all native names has been added to IsValid
|
||||
contracts := NewContracts(true)
|
||||
for _, c := range contracts.Contracts {
|
||||
require.True(t, nativenames.IsValid(c.Metadata().Name), fmt.Errorf("add %s to nativenames.IsValid(...)", c))
|
||||
}
|
||||
|
||||
require.False(t, nativenames.IsValid("unkonwn"))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue