neoneo-go/pkg/core/native/compatibility_test.go
Roman Khimov 36d486a664 config: add InitialGASSupply, fix
We now have 52M by default.
2021-07-20 16:59:54 +03:00

32 lines
696 B
Go

package native
import (
"testing"
"unicode"
"github.com/nspcc-dev/neo-go/pkg/config"
"github.com/stretchr/testify/require"
)
// "C" and "O" can easily be typed by accident.
func TestNamesASCII(t *testing.T) {
cfg := config.ProtocolConfiguration{P2PSigExtensions: true}
cs := NewContracts(cfg)
for _, c := range cs.Contracts {
require.True(t, isASCII(c.Metadata().Name))
for _, m := range c.Metadata().Methods {
require.True(t, isASCII(m.MD.Name))
}
for _, e := range c.Metadata().Manifest.ABI.Events {
require.True(t, isASCII(e.Name))
}
}
}
func isASCII(s string) bool {
ok := true
for i := 0; i < len(s); i++ {
ok = ok && s[i] <= unicode.MaxASCII
}
return ok
}