mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-03 22:43:09 +00:00
fix: adapt to the upstream go-ethereum
This commit is contained in:
parent
ad7384abf9
commit
70a1794a43
@ -13,12 +13,13 @@ import (
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/waku-org/go-discover/discover"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/waku-org/go-waku/logging"
|
||||
"github.com/waku-org/go-waku/waku/v2/peerstore"
|
||||
wenr "github.com/waku-org/go-waku/waku/v2/protocol/enr"
|
||||
"github.com/waku-org/go-waku/waku/v2/service"
|
||||
"github.com/waku-org/go-waku/waku/v2/utils"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
"github.com/ethereum/go-ethereum/p2p/nat"
|
||||
@ -142,11 +143,9 @@ func NewDiscoveryV5(priv *ecdsa.PrivateKey, localnode *enode.LocalNode, peerConn
|
||||
localnode: localnode,
|
||||
metrics: newMetrics(reg),
|
||||
config: discover.Config{
|
||||
PrivateKey: priv,
|
||||
Bootnodes: bootnodes,
|
||||
V5Config: discover.V5Config{
|
||||
ProtocolID: &protocolID,
|
||||
},
|
||||
PrivateKey: priv,
|
||||
Bootnodes: bootnodes,
|
||||
V5ProtocolID: &protocolID,
|
||||
},
|
||||
udpAddr: &net.UDPAddr{
|
||||
IP: net.IPv4zero,
|
||||
|
||||
@ -45,11 +45,6 @@ func WithMultiaddress(multiaddrs ...multiaddr.Multiaddr) ENROption {
|
||||
successIdx := -1
|
||||
for i := len(multiaddrs); i > 0; i-- {
|
||||
cpy := localnode.Node().Record() // Record() creates a copy for the current iteration
|
||||
// Copy all the entries that might not have been written in the ENR record due to the
|
||||
// async nature of localnode.Set
|
||||
for _, entry := range localnode.Entries() {
|
||||
cpy.Set(entry)
|
||||
}
|
||||
cpy.Set(enr.WithEntry(MultiaddrENRField, marshalMultiaddress(multiaddrs[0:i])))
|
||||
cpy.SetSeq(localnode.Seq() + 1)
|
||||
err = enode.SignV4(cpy, privk)
|
||||
|
||||
@ -34,7 +34,7 @@ func (c *MockClient) Close() {
|
||||
|
||||
}
|
||||
func (c *MockClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
|
||||
return types.NewBlock(&types.Header{Number: big.NewInt(c.latestBlockNum.Load())}, nil, nil, nil, nil), nil
|
||||
return types.NewBlock(&types.Header{Number: big.NewInt(c.latestBlockNum.Load())}, nil, nil, nil), nil
|
||||
}
|
||||
func NewMockClient(t *testing.T, blockFile string) *MockClient {
|
||||
blockChain := MockBlockChain{}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user