neo-go/pkg/core/native/contract_test.go
Anna Shaleva d62fad1268 native: implement HF-based update
A part of #3213.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:16:42 +03:00

25 lines
696 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.LatestHardfork()
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)
}
})
}
}