Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evm: Pass value param to the txm #13602

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-emus-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal fixed a bug where we weren't sending the value param to the txm
6 changes: 6 additions & 0 deletions core/services/relay/evm/chain_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func (w *chainWriter) SubmitTransaction(ctx context.Context, contract, method st
checker.CheckerType = txmgrtypes.TransmitCheckerType(methodConfig.Checker)
}

v := big.NewInt(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is txmgr accepting big.Int without a pointer 😫

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're busy discussing whether it's in scope to edit this too along with the other big.Int -> *big.Int changes we're making.

Copy link
Contributor Author

@nickcorin nickcorin Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is an argument that nil is not a valid tx value and using big.Int helps prevent accidental panics at the cost of being a little ugly.

if value != nil {
v = value
}

req := evmtxmgr.TxRequest{
FromAddress: methodConfig.FromAddress,
ToAddress: common.HexToAddress(toAddress),
Expand All @@ -119,6 +124,7 @@ func (w *chainWriter) SubmitTransaction(ctx context.Context, contract, method st
Meta: &txmgrtypes.TxMeta[common.Address, common.Hash]{WorkflowExecutionID: meta.WorkflowExecutionID},
Strategy: w.sendStrategy,
Checker: checker,
Value: *v,
}

_, err = w.txm.CreateTransaction(ctx, req)
Expand Down
Loading