2021-03-12 10:04:41 +00:00
|
|
|
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
|
2021-03-11 11:39:51 +00:00
|
|
|
contracts := NewContracts(true, map[string][]uint32{})
|
2021-03-12 10:04:41 +00:00
|
|
|
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"))
|
|
|
|
}
|