network: keep a copy of the config inside of Server

Avoid copying the configuration again and again, make things a bit more
efficient.
This commit is contained in:
Roman Khimov 2022-01-20 21:14:42 +03:00
parent 6e9d725a29
commit 60d6fa1125
3 changed files with 27 additions and 32 deletions

View file

@ -813,7 +813,7 @@ func TestHandleMPTData(t *testing.T) {
t.Run("good", func(t *testing.T) {
expected := [][]byte{{1, 2, 3}, {2, 3, 4}}
s := newTestServer(t, ServerConfig{Port: 0, UserAgent: "/test/"})
s.chain.(*fakechain.FakeChain).P2PStateExchangeExtensions = true
s.config.P2PStateExchangeExtensions = true
s.stateSync = &fakechain.FakeStateSync{
AddMPTNodesFunc: func(nodes [][]byte) error {
require.Equal(t, expected, nodes)