Skip to content

Commit

Permalink
temp debug old ethrpc version
Browse files Browse the repository at this point in the history
  • Loading branch information
arilotter committed Feb 28, 2024
1 parent 404916b commit 396eb0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ethrpc/ethrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/0xsequence/ethkit/go-ethereum/accounts/abi/bind"
"github.com/0xsequence/ethkit/go-ethereum/common"
"github.com/0xsequence/ethkit/go-ethereum/core/types"
"github.com/davecgh/go-spew/spew"
"github.com/goware/breaker"
"github.com/goware/logger"
"github.com/goware/superr"
Expand Down Expand Up @@ -90,12 +91,17 @@ func (p *Provider) Do(ctx context.Context, calls ...Call) ([]byte, error) {
req = req.WithContext(ctx)
req.Header.Set("Content-Type", "application/json")

spew.Dump("ethrpc: sending request", p.nodeURL, req.Header, string(b))

res, err := p.httpClient.Do(req)
if err != nil {
return nil, superr.Wrap(ErrRequestFail, fmt.Errorf("failed to send request: %w", err))
}
defer res.Body.Close()

spew.Dump("ethrpc: got response", p.nodeURL, res.Header)


body, err := io.ReadAll(res.Body)
if err != nil {
return nil, superr.Wrap(ErrRequestFail, fmt.Errorf("failed to read resposne body: %w", err))
Expand Down

0 comments on commit 396eb0c

Please sign in to comment.