@@ -40,6 +40,7 @@ import (
4040 "github.com/ethereum/go-ethereum/eth/filters"
4141 "github.com/ethereum/go-ethereum/node"
4242 "github.com/ethereum/go-ethereum/params"
43+ "github.com/ethereum/go-ethereum/rpc"
4344
4445 "github.com/stretchr/testify/assert"
4546)
@@ -159,7 +160,7 @@ func TestGraphQLBlockSerialization(t *testing.T) {
159160 t .Fatalf ("could not post: %v" , err )
160161 }
161162 bodyBytes , err := io .ReadAll (resp .Body )
162- resp .Body . Close ( )
163+ rpc . CleanlyCloseBody ( resp .Body )
163164 if err != nil {
164165 t .Fatalf ("could not read from response body: %v" , err )
165166 }
@@ -246,7 +247,7 @@ func TestGraphQLBlockSerializationEIP2718(t *testing.T) {
246247 t .Fatalf ("could not post: %v" , err )
247248 }
248249 bodyBytes , err := io .ReadAll (resp .Body )
249- resp .Body . Close ( )
250+ rpc . CleanlyCloseBody ( resp .Body )
250251 if err != nil {
251252 t .Fatalf ("could not read from response body: %v" , err )
252253 }
@@ -271,7 +272,7 @@ func TestGraphQLHTTPOnSamePort_GQLRequest_Unsuccessful(t *testing.T) {
271272 if err != nil {
272273 t .Fatalf ("could not post: %v" , err )
273274 }
274- resp .Body . Close ( )
275+ rpc . CleanlyCloseBody ( resp .Body )
275276 // make sure the request is not handled successfully
276277 assert .Equal (t , http .StatusNotFound , resp .StatusCode )
277278}
0 commit comments