mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-05 09:35:49 +00:00
a164db92cc
Function doesn't make much sense here. The change is rather trivial and this is not expected to be used by external code, so no deprecation. Signed-off-by: Roman Khimov <roman@nspcc.ru>
25 lines
693 B
Go
25 lines
693 B
Go
package native
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/config"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// TestNativeGetMethod is needed to ensure that methods list has the same sorting
|
|
// rule as we expect inside the `ContractMD.GetMethod`.
|
|
func TestNativeGetMethod(t *testing.T) {
|
|
cfg := config.ProtocolConfiguration{P2PSigExtensions: true}
|
|
cs := NewContracts(cfg)
|
|
latestHF := config.HFLatestKnown
|
|
for _, c := range cs.Contracts {
|
|
hfMD := c.Metadata().HFSpecificContractMD(&latestHF)
|
|
t.Run(c.Metadata().Name, func(t *testing.T) {
|
|
for _, m := range hfMD.Methods {
|
|
_, ok := hfMD.GetMethod(m.MD.Name, len(m.MD.Parameters))
|
|
require.True(t, ok)
|
|
}
|
|
})
|
|
}
|
|
}
|