-
Notifications
You must be signed in to change notification settings - Fork 5
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
support for decoding destexecdata #472
base: main
Are you sure you want to change the base?
Changes from 6 commits
b881118
29f0e9c
b7e1875
fe93c83
c3c0e89
2a3f472
4e7531b
e2aca57
97b4623
e57098e
918008a
89267c6
7bccab7
2ff6c11
3a9779a
8ccc619
9929168
588905c
1651910
8e616e7
d8d484b
ec30b09
491f9ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -367,11 +367,19 @@ func (r *ccipChainReader) MsgsBetweenSeqNums( | |||||
return nil, fmt.Errorf("failed to cast %v to Message", item.Data) | ||||||
} | ||||||
|
||||||
msg.Message.ExtraArgsDecoded, err = r.extraDataCodec.DecodeExtraData(msg.Message.ExtraArgs, sourceChainSelector) | ||||||
msg.Message.ExtraArgsDecoded, err = r.extraDataCodec.DecodeExtraArgs(msg.Message.ExtraArgs, sourceChainSelector) | ||||||
if err != nil { | ||||||
return nil, fmt.Errorf("failed to decode ExtraArgs: %w", err) | ||||||
} | ||||||
msg.Message.Header.OnRamp = onRampAddress | ||||||
|
||||||
for i, token := range msg.Message.TokenAmounts { | ||||||
token.DestExecData, err = r.extraDataCodec.DecodeTokenAmountDestExecData(token.DestExecData, sourceChainSelector) | ||||||
if err != nil { | ||||||
return nil, fmt.Errorf("failed to decode DestExecData: %w", err) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
msg.Message.TokenAmounts[i] = token | ||||||
} | ||||||
msgs = append(msgs, msg.Message) | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ type MessageHasher interface { | |
} | ||
|
||
type ExtraDataCodec interface { | ||
DecodeExtraData(ExtraArgs Bytes, sourceChainSelector ChainSelector) (map[string]any, error) | ||
DecodeExtraArgs(extraArgs Bytes, sourceChainSelector ChainSelector) (map[string]any, error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: add comment on which exact field on the Message struct does this work on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need comments on this entire struct, please add doc comments so this is understandable to people who maintain this codebase |
||
DecodeTokenAmountDestExecData(destExecData Bytes, sourceChainSelector ChainSelector) (Bytes, error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a comment here on what this is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see, I believe this is referring to : https://github.com/smartcontractkit/chainlink/blob/99860e4df73602187a926df4cc65c3919232d8f6/contracts/src/v0.8/ccip/libraries/Internal.sol#L230-L232 Lets make that very clear here that this is what this interface is doing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
} | ||
|
||
// RMNCrypto provides a chain-agnostic interface for verifying RMN signatures. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.