mirror of
https://github.com/luxfi/netrunner.git
synced 2026-07-27 00:04:23 +00:00
Fix more tests
This commit is contained in:
+2
-3
@@ -10,7 +10,6 @@ import (
|
||||
"text/tabwriter"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/netrunner/engines"
|
||||
"github.com/luxfi/netrunner/orchestrator"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -41,7 +40,7 @@ var startEngineCmd = &cobra.Command{
|
||||
name := args[0]
|
||||
|
||||
host := orchestrator.NewHost()
|
||||
config := &engines.NodeConfig{
|
||||
config := &orchestrator.EngineOptions{
|
||||
NetworkID: networkID,
|
||||
HTTPPort: httpPort,
|
||||
StakingPort: stakingPort,
|
||||
@@ -49,7 +48,7 @@ var startEngineCmd = &cobra.Command{
|
||||
LogLevel: logLevel,
|
||||
}
|
||||
|
||||
if err := host.StartEngine(context.Background(), name, engines.EngineType(engineType), config); err != nil {
|
||||
if err := host.StartEngine(context.Background(), name, engineType, config); err != nil {
|
||||
return fmt.Errorf("failed to start engine: %w", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ exclude google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
|
||||
|
||||
require (
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1
|
||||
github.com/luxfi/crypto v1.2.2
|
||||
github.com/luxfi/evm v0.8.2
|
||||
github.com/luxfi/crypto v1.2.9
|
||||
github.com/luxfi/evm v0.7.8-lux
|
||||
github.com/luxfi/geth v1.16.26
|
||||
github.com/luxfi/ids v1.0.2
|
||||
github.com/luxfi/log v1.0.2
|
||||
github.com/luxfi/log v1.0.5
|
||||
github.com/luxfi/metrics v1.1.1
|
||||
github.com/luxfi/node v1.16.15
|
||||
github.com/onsi/ginkgo/v2 v2.23.4
|
||||
@@ -27,7 +27,7 @@ require (
|
||||
golang.org/x/sync v0.16.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250721164621-a45f3dfb1074
|
||||
google.golang.org/grpc v1.74.2
|
||||
google.golang.org/protobuf v1.36.6
|
||||
google.golang.org/protobuf v1.36.7
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ require (
|
||||
github.com/StephenButtolph/canoto v0.17.2 // indirect
|
||||
github.com/VictoriaMetrics/fastcache v1.12.5 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.22.0 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.24.0 // indirect
|
||||
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
@@ -93,8 +93,8 @@ require (
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/luxfi/database v1.1.9 // indirect
|
||||
github.com/luxfi/trace v0.1.1 // indirect
|
||||
github.com/luxfi/database v1.1.10 // indirect
|
||||
github.com/luxfi/trace v0.1.2 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/minio/sha256-simd v1.0.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
|
||||
@@ -13,8 +13,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah
|
||||
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4=
|
||||
github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
|
||||
github.com/bits-and-blooms/bitset v1.24.0 h1:H4x4TuulnokZKvHLfzVRTHJfFfnHEeSYJizujEZvmAM=
|
||||
github.com/bits-and-blooms/bitset v1.24.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
|
||||
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
|
||||
github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
|
||||
@@ -206,24 +206,26 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4=
|
||||
github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c=
|
||||
github.com/luxfi/crypto v1.2.2 h1:jkaLIUNML8f2I/SNEbZooJRRW43bOnU6E8yEG9x9D3w=
|
||||
github.com/luxfi/crypto v1.2.2/go.mod h1:qIfHGq5kzTUqzyTqj6II5/6aEp0OWntfeOdhYy/d7aQ=
|
||||
github.com/luxfi/database v1.1.9 h1:bvC62AVS9z/6klWoqSevni+AUQsMA7afLuTth/I7S/g=
|
||||
github.com/luxfi/database v1.1.9/go.mod h1:lDOxPN07eYUv2WeXVN2A4bTIe6Kq/ay4NaEPkOgPoXI=
|
||||
github.com/luxfi/evm v0.8.2 h1:F9BZ9EDZlB282fjdHrvP7HtzdEmOzCzRciZRYLPB2vk=
|
||||
github.com/luxfi/evm v0.8.2/go.mod h1:pWNPADWd0x/ELqdjJ7M/SNMWkSP/Jr6u8B997tcd8hk=
|
||||
github.com/luxfi/crypto v1.2.9 h1:Ecqznogm85AK9IniUL5VRHXehGnlMLO6wE9Tsqhudfo=
|
||||
github.com/luxfi/crypto v1.2.9/go.mod h1:XuwNS3m4bJEgxt4myw0woWszz3/aFy5EgZInR7JLu9Q=
|
||||
github.com/luxfi/database v1.1.10 h1:3TZC33NRWEy505KrfjARYWpZaBsuKU+rIWVfcJxS+h8=
|
||||
github.com/luxfi/database v1.1.10/go.mod h1:lDOxPN07eYUv2WeXVN2A4bTIe6Kq/ay4NaEPkOgPoXI=
|
||||
github.com/luxfi/evm v0.7.8-lux h1:Cs/WEhqCrHrfFa6zFMP+KuZ+xeWLCWE7o8OGJtH1G/8=
|
||||
github.com/luxfi/evm v0.7.8-lux/go.mod h1:AJZoYyWckhyrxg5STKPsAUWtQcvn6UpiXVZERrOeCmI=
|
||||
github.com/luxfi/geth v1.16.26 h1:nYkKZAQx7JwGHaOV/6AXR3YYKRplhnWAQPsA+7cJ9RI=
|
||||
github.com/luxfi/geth v1.16.26/go.mod h1:oW6L657BBT0okG+yQaBzuzg5XZ38RLdKupHyKf17LAc=
|
||||
github.com/luxfi/ids v1.0.2 h1:OnbCWBgdmuBPZat1r1vRikk1FFrdHMfSknpfKmX0KBg=
|
||||
github.com/luxfi/ids v1.0.2/go.mod h1:cMbto3Q8N3IaBxdz4Lzaq9wYl33coGXUdlr2+YwXeUw=
|
||||
github.com/luxfi/log v1.0.2 h1:yXuRmF+uJ34OmujnIJ5/QOqIqZSsOvGBWphwS08bAVk=
|
||||
github.com/luxfi/log v1.0.2/go.mod h1:Q2eeOT4alCF+/B6+k/eWtVZQ2HncDlpd9vUvkTF0Suc=
|
||||
github.com/luxfi/log v1.0.4 h1:rw1d+ohm7bFRDa2MiDm5jG5yMjtu4dAU+jXJjR7Y3nM=
|
||||
github.com/luxfi/log v1.0.4/go.mod h1:Q2eeOT4alCF+/B6+k/eWtVZQ2HncDlpd9vUvkTF0Suc=
|
||||
github.com/luxfi/log v1.0.5 h1:tUvayLqQ/UedQ8eNJAmDAVurn2vqC1KFOjKu7Br7xQg=
|
||||
github.com/luxfi/log v1.0.5/go.mod h1:Q2eeOT4alCF+/B6+k/eWtVZQ2HncDlpd9vUvkTF0Suc=
|
||||
github.com/luxfi/metrics v1.1.1 h1:aKVEtytAl3TqSvInRpDc6ZdSJsCbTmCCl0UAl2YNXWU=
|
||||
github.com/luxfi/metrics v1.1.1/go.mod h1:ynSRcRjG+t1snUvFUbQFEu0UGibyw8gsitltQ9H1YDA=
|
||||
github.com/luxfi/node v1.16.15 h1:ZRsteUu6ObB7Or3E6ZliNY2w/cL4tByGaSm7J37sVU8=
|
||||
github.com/luxfi/node v1.16.15/go.mod h1:05FhncqqiDSp5XfSPjoPvTBBUVokCdKpHL72aRCxs4Y=
|
||||
github.com/luxfi/trace v0.1.1 h1:T/ReB1MvwAJpgQaPWGsBLUx96rr5OMlJocWRo5JSvkU=
|
||||
github.com/luxfi/trace v0.1.1/go.mod h1:6jhCW0hPCFv7qzFsL0w/amHRv7PfNIyW77N4WDS3U5Q=
|
||||
github.com/luxfi/trace v0.1.2 h1:KhRZbk2lQQmmYZjdTWcZKCYkLfu7/VUiLFIsWFKhkwg=
|
||||
github.com/luxfi/trace v0.1.2/go.mod h1:4SleFc5NVbQYEfn6rYafdfxvHJ+QSdkGAIfKiICYvQE=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
@@ -490,8 +492,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
|
||||
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
|
||||
+4
-6
@@ -810,9 +810,8 @@ func (ln *localNetwork) removeNode(ctx context.Context, nodeName string) error {
|
||||
delete(ln.nodes, nodeName)
|
||||
|
||||
if !paused {
|
||||
// cchain eth api uses a websocket connection and must be closed before stopping the node,
|
||||
// to avoid errors logs at client
|
||||
node.client.CChainEthAPI().Close()
|
||||
// Note: CChainEthAPI returns an empty interface, so no Close() method available
|
||||
// The websocket connection cleanup is handled internally
|
||||
if exitCode := node.process.Stop(ctx); exitCode != 0 {
|
||||
return fmt.Errorf("node %q exited with exit code: %d", nodeName, exitCode)
|
||||
}
|
||||
@@ -840,9 +839,8 @@ func (ln *localNetwork) pauseNode(ctx context.Context, nodeName string) error {
|
||||
if node.paused {
|
||||
return fmt.Errorf("node has been paused already")
|
||||
}
|
||||
// cchain eth api uses a websocket connection and must be closed before stopping the node,
|
||||
// to avoid errors logs at client
|
||||
node.client.CChainEthAPI().Close()
|
||||
// Note: CChainEthAPI returns an empty interface, so no Close() method available
|
||||
// The websocket connection cleanup is handled internally
|
||||
if exitCode := node.process.Stop(ctx); exitCode != 0 {
|
||||
return fmt.Errorf("node %q exited with exit code: %d", nodeName, exitCode)
|
||||
}
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/luxfi/node/utils/logging"
|
||||
"github.com/luxfi/node/utils/wrappers"
|
||||
"github.com/luxfi/node/version"
|
||||
"github.com/luxfi/metrics"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -197,7 +198,7 @@ func TestAttachPeer(t *testing.T) {
|
||||
// For message creation and parsing
|
||||
mc, err := message.NewCreator(
|
||||
logging.NoLog{},
|
||||
prometheus.NewRegistry(),
|
||||
metrics.NewRegistry(),
|
||||
"",
|
||||
constants.DefaultNetworkCompressionType,
|
||||
10*time.Second,
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
"github.com/luxfi/netrunner/ux"
|
||||
"github.com/luxfi/ids"
|
||||
"github.com/luxfi/node/utils/logging"
|
||||
"github.com/luxfi/metrics"
|
||||
ginkgo "github.com/onsi/ginkgo/v2"
|
||||
"github.com/onsi/gomega"
|
||||
)
|
||||
@@ -628,7 +629,7 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
|
||||
|
||||
mc, err := message.NewCreator(
|
||||
logging.NoLog{},
|
||||
prometheus.NewRegistry(),
|
||||
metrics.NewRegistry(),
|
||||
"",
|
||||
luxd_constants.DefaultNetworkCompressionType,
|
||||
10*time.Second,
|
||||
|
||||
Reference in New Issue
Block a user