Skip to content

Commit

Permalink
Add log for url
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Dec 19, 2024
1 parent d6f9598 commit da7dd4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core/chains/evm/txm/clientwrappers/dual_broadcast_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"

"github.com/smartcontractkit/chainlink-common/pkg/logger"

"github.com/smartcontractkit/chainlink/v2/core/chains/evm/client"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types"
)
Expand All @@ -27,13 +29,15 @@ type DualBroadcastClient struct {
c client.Client
keystore DualBroadcastClientKeystore
customURL *url.URL
lggr logger.Logger
}

func NewDualBroadcastClient(c client.Client, keystore DualBroadcastClientKeystore, customURL *url.URL) *DualBroadcastClient {
func NewDualBroadcastClient(c client.Client, keystore DualBroadcastClientKeystore, customURL *url.URL, lggr logger.Logger) *DualBroadcastClient {
return &DualBroadcastClient{
c: c,
keystore: keystore,
customURL: customURL,
lggr: lggr,
}
}

Expand Down Expand Up @@ -70,6 +74,7 @@ func (d *DualBroadcastClient) SendTransaction(ctx context.Context, tx *types.Tra
if meta.DualBroadcastParams != nil {
params = *meta.DualBroadcastParams
}
d.lggr.Debugw("Sending transaction to DualBroadcast API", "URL", d.customURL.String()+"?"+params)
body := []byte(fmt.Sprintf(`{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["%s"], "id":1}`, hexutil.Encode(data)))
if _, err = d.signAndPostMessage(ctx, tx.FromAddress, body, params); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func NewTxmV2(
}
var c txm.Client
if chainConfig.ChainType() == chaintype.ChainDualBroadcast {
c = clientwrappers.NewDualBroadcastClient(client, keyStore, txmV2Config.CustomURL())
c = clientwrappers.NewDualBroadcastClient(client, keyStore, txmV2Config.CustomURL(), lggr)
} else {
c = clientwrappers.NewChainClient(client)
}
Expand Down

0 comments on commit da7dd4d

Please sign in to comment.