mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
les: rebase fix
This commit is contained in:
parent
927b3dfb15
commit
b3f5a40502
2 changed files with 7 additions and 11 deletions
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/common/mclock"
|
||||||
"github.com/ethereum/go-ethereum/les/flowcontrol"
|
"github.com/ethereum/go-ethereum/les/flowcontrol"
|
||||||
"github.com/ethereum/go-ethereum/p2p"
|
"github.com/ethereum/go-ethereum/p2p"
|
||||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
|
|
@ -36,7 +37,7 @@ func TestPeerHandshakeSetAnnounceTypeToAnnounceTypeSignedForTrustedPeer(t *testi
|
||||||
rw: &rwStub{
|
rw: &rwStub{
|
||||||
WriteHook: func(recvList keyValueList) {
|
WriteHook: func(recvList keyValueList) {
|
||||||
//checking that ulc sends to peer allowedRequests=onlyAnnounceRequests and announceType = announceTypeSigned
|
//checking that ulc sends to peer allowedRequests=onlyAnnounceRequests and announceType = announceTypeSigned
|
||||||
recv := recvList.decode()
|
recv, _ := recvList.decode()
|
||||||
var reqType uint64
|
var reqType uint64
|
||||||
|
|
||||||
err := recv.get("announceType", &reqType)
|
err := recv.get("announceType", &reqType)
|
||||||
|
|
@ -81,7 +82,7 @@ func TestPeerHandshakeAnnounceTypeSignedForTrustedPeersPeerNotInTrusted(t *testi
|
||||||
rw: &rwStub{
|
rw: &rwStub{
|
||||||
WriteHook: func(recvList keyValueList) {
|
WriteHook: func(recvList keyValueList) {
|
||||||
//checking that ulc sends to peer allowedRequests=noRequests and announceType != announceTypeSigned
|
//checking that ulc sends to peer allowedRequests=noRequests and announceType != announceTypeSigned
|
||||||
recv := recvList.decode()
|
recv, _ := recvList.decode()
|
||||||
var reqType uint64
|
var reqType uint64
|
||||||
|
|
||||||
err := recv.get("announceType", &reqType)
|
err := recv.get("announceType", &reqType)
|
||||||
|
|
@ -239,17 +240,11 @@ func TestPeerHandshakeClientReturnErrorOnUselessPeer(t *testing.T) {
|
||||||
|
|
||||||
func generateLesServer() *LesServer {
|
func generateLesServer() *LesServer {
|
||||||
s := &LesServer{
|
s := &LesServer{
|
||||||
defParams: &flowcontrol.ServerParams{
|
defParams: flowcontrol.ServerParams{
|
||||||
BufLimit: uint64(300000000),
|
BufLimit: uint64(300000000),
|
||||||
MinRecharge: uint64(50000),
|
MinRecharge: uint64(50000),
|
||||||
},
|
},
|
||||||
fcManager: flowcontrol.NewClientManager(1, 2, 3),
|
fcManager: flowcontrol.NewClientManager(nil, &mclock.System{}),
|
||||||
fcCostStats: &requestCostStats{
|
|
||||||
stats: make(map[uint64]*linReg, len(reqList)),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
for _, code := range reqList {
|
|
||||||
s.fcCostStats.stats[code] = &linReg{cnt: 100}
|
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common/mclock"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/eth"
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
|
|
@ -217,7 +218,7 @@ func newFullPeerPair(t *testing.T, index int, numberOfblocks int, chainGen func(
|
||||||
// newLightPeer creates node with light sync mode
|
// newLightPeer creates node with light sync mode
|
||||||
func newLightPeer(t *testing.T, ulcConfig *eth.ULCConfig) pairPeer {
|
func newLightPeer(t *testing.T, ulcConfig *eth.ULCConfig) pairPeer {
|
||||||
peers := newPeerSet()
|
peers := newPeerSet()
|
||||||
dist := newRequestDistributor(peers, make(chan struct{}))
|
dist := newRequestDistributor(peers, make(chan struct{}), &mclock.System{})
|
||||||
rm := newRetrieveManager(peers, dist, nil)
|
rm := newRetrieveManager(peers, dist, nil)
|
||||||
ldb := ethdb.NewMemDatabase()
|
ldb := ethdb.NewMemDatabase()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue