-
Notifications
You must be signed in to change notification settings - Fork 21
[CAL][1] - Add initial CAL scaffolding to CCIPReader with legacy accessor #978
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| package chainaccessor | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "github.com/smartcontractkit/chainlink-common/pkg/logger" | ||
| "github.com/smartcontractkit/chainlink-common/pkg/types" | ||
|
|
||
| "github.com/smartcontractkit/chainlink-ccip/pkg/contractreader" | ||
| cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" | ||
| ) | ||
|
|
||
| // LegacyAccessor is an implementation of cciptypes.ChainAccessor that allows the CCIPReader | ||
| // to cutover and migrate away from depending directly on contract reader and contract writer. | ||
| type LegacyAccessor struct { | ||
ogtownsend marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| lggr logger.Logger | ||
| chainSelector cciptypes.ChainSelector | ||
| contractReader contractreader.Extended | ||
| contractWriter types.ContractWriter | ||
| addrCodec cciptypes.AddressCodec | ||
| } | ||
|
|
||
| var _ cciptypes.ChainAccessor = (*LegacyAccessor)(nil) | ||
|
|
||
| func NewLegacyAccessor( | ||
| lggr logger.Logger, | ||
| chainSelector cciptypes.ChainSelector, | ||
| contractReader contractreader.Extended, | ||
| contractWriter types.ContractWriter, | ||
| addrCodec cciptypes.AddressCodec, | ||
| ) cciptypes.ChainAccessor { | ||
| return &LegacyAccessor{ | ||
| lggr: lggr, | ||
| chainSelector: chainSelector, | ||
| contractReader: contractReader, | ||
| contractWriter: contractWriter, | ||
| addrCodec: addrCodec, | ||
| } | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) Metadata() cciptypes.AccessorMetadata { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetContractAddress(contractName string) ([]byte, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetChainFeeComponents( | ||
| ctx context.Context, | ||
| ) map[cciptypes.ChainSelector]cciptypes.ChainFeeComponents { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetDestChainFeeComponents(ctx context.Context) (types.ChainFeeComponents, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) Sync(ctx context.Context, contracts cciptypes.ContractAddresses) error { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) MsgsBetweenSeqNums( | ||
| ctx context.Context, | ||
| dest cciptypes.ChainSelector, | ||
| seqNumRange cciptypes.SeqNumRange, | ||
| ) ([]cciptypes.Message, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) LatestMsgSeqNum(ctx context.Context, dest cciptypes.ChainSelector) (cciptypes.SeqNum, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetExpectedNextSequenceNumber( | ||
| ctx context.Context, | ||
| dest cciptypes.ChainSelector, | ||
| ) (cciptypes.SeqNum, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetTokenPriceUSD( | ||
| ctx context.Context, | ||
| address cciptypes.UnknownAddress, | ||
| ) (cciptypes.BigInt, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetFeeQuoterDestChainConfig( | ||
| ctx context.Context, | ||
| dest cciptypes.ChainSelector, | ||
| ) (cciptypes.FeeQuoterDestChainConfig, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) CommitReportsGTETimestamp( | ||
| ctx context.Context, | ||
| ts time.Time, | ||
| limit int, | ||
| ) ([]cciptypes.CommitPluginReportWithMeta, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) ExecutedMessages( | ||
| ctx context.Context, | ||
| ranges map[cciptypes.ChainSelector]cciptypes.SeqNumRange, | ||
| confidence cciptypes.ConfidenceLevel, | ||
| ) (map[cciptypes.ChainSelector][]cciptypes.SeqNum, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) NextSeqNum( | ||
| ctx context.Context, | ||
| sources []cciptypes.ChainSelector, | ||
| ) (seqNum map[cciptypes.ChainSelector]cciptypes.SeqNum, err error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) Nonces( | ||
| ctx context.Context, | ||
| addresses map[cciptypes.ChainSelector][]cciptypes.UnknownEncodedAddress, | ||
| ) (map[cciptypes.ChainSelector]map[string]uint64, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetChainFeePriceUpdate( | ||
| ctx context.Context, | ||
| selectors []cciptypes.ChainSelector, | ||
| ) map[cciptypes.ChainSelector]cciptypes.TimestampedBig { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetLatestPriceSeqNr(ctx context.Context) (uint64, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetOffRampConfigDigest(ctx context.Context, pluginType uint8) ([32]byte, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetOffRampSourceChainsConfig( | ||
| ctx context.Context, | ||
| sourceChains []cciptypes.ChainSelector, | ||
| ) (map[cciptypes.ChainSelector]cciptypes.SourceChainConfig, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetRMNRemoteConfig(ctx context.Context) (cciptypes.RemoteConfig, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
|
|
||
| func (l *LegacyAccessor) GetRmnCurseInfo(ctx context.Context) (cciptypes.CurseInfo, error) { | ||
| // TODO(NONEVM-1865): implement | ||
| panic("implement me") | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.