mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-12 21:10:36 +00:00
28908aa3cf
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
21 lines
590 B
Go
21 lines
590 B
Go
package native
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/config"
|
|
"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 have been added to IsValid
|
|
cfg := config.ProtocolConfiguration{P2PSigExtensions: true}
|
|
contracts := NewContracts(cfg)
|
|
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("unknown"))
|
|
}
|