|
| 1 | +package chainaccessor |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + "time" |
| 6 | + |
| 7 | + "github.com/smartcontractkit/chainlink-common/pkg/logger" |
| 8 | + "github.com/smartcontractkit/chainlink-common/pkg/types" |
| 9 | + |
| 10 | + "github.com/smartcontractkit/chainlink-ccip/pkg/contractreader" |
| 11 | + cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" |
| 12 | +) |
| 13 | + |
| 14 | +// LegacyAccessor is an implementation of cciptypes.ChainAccessor that allows the CCIPReader |
| 15 | +// to cutover and migrate away from depending directly on contract reader and contract writer. |
| 16 | +type LegacyAccessor struct { |
| 17 | + lggr logger.Logger |
| 18 | + chainSelector cciptypes.ChainSelector |
| 19 | + contractReader contractreader.Extended |
| 20 | + contractWriter types.ContractWriter |
| 21 | + addrCodec cciptypes.AddressCodec |
| 22 | +} |
| 23 | + |
| 24 | +var _ cciptypes.ChainAccessor = (*LegacyAccessor)(nil) |
| 25 | + |
| 26 | +func NewLegacyAccessor( |
| 27 | + lggr logger.Logger, |
| 28 | + chainSelector cciptypes.ChainSelector, |
| 29 | + contractReader contractreader.Extended, |
| 30 | + contractWriter types.ContractWriter, |
| 31 | + addrCodec cciptypes.AddressCodec, |
| 32 | +) cciptypes.ChainAccessor { |
| 33 | + return &LegacyAccessor{ |
| 34 | + lggr: lggr, |
| 35 | + chainSelector: chainSelector, |
| 36 | + contractReader: contractReader, |
| 37 | + contractWriter: contractWriter, |
| 38 | + addrCodec: addrCodec, |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +func (l *LegacyAccessor) Metadata() cciptypes.AccessorMetadata { |
| 43 | + // TODO(NONEVM-1865): implement |
| 44 | + panic("implement me") |
| 45 | +} |
| 46 | + |
| 47 | +func (l *LegacyAccessor) GetContractAddress(contractName string) ([]byte, error) { |
| 48 | + // TODO(NONEVM-1865): implement |
| 49 | + panic("implement me") |
| 50 | +} |
| 51 | + |
| 52 | +func (l *LegacyAccessor) GetChainFeeComponents( |
| 53 | + ctx context.Context, |
| 54 | +) map[cciptypes.ChainSelector]cciptypes.ChainFeeComponents { |
| 55 | + // TODO(NONEVM-1865): implement |
| 56 | + panic("implement me") |
| 57 | +} |
| 58 | + |
| 59 | +func (l *LegacyAccessor) GetDestChainFeeComponents(ctx context.Context) (types.ChainFeeComponents, error) { |
| 60 | + // TODO(NONEVM-1865): implement |
| 61 | + panic("implement me") |
| 62 | +} |
| 63 | + |
| 64 | +func (l *LegacyAccessor) Sync(ctx context.Context, contracts cciptypes.ContractAddresses) error { |
| 65 | + // TODO(NONEVM-1865): implement |
| 66 | + panic("implement me") |
| 67 | +} |
| 68 | + |
| 69 | +func (l *LegacyAccessor) MsgsBetweenSeqNums( |
| 70 | + ctx context.Context, |
| 71 | + dest cciptypes.ChainSelector, |
| 72 | + seqNumRange cciptypes.SeqNumRange, |
| 73 | +) ([]cciptypes.Message, error) { |
| 74 | + // TODO(NONEVM-1865): implement |
| 75 | + panic("implement me") |
| 76 | +} |
| 77 | + |
| 78 | +func (l *LegacyAccessor) LatestMsgSeqNum(ctx context.Context, dest cciptypes.ChainSelector) (cciptypes.SeqNum, error) { |
| 79 | + // TODO(NONEVM-1865): implement |
| 80 | + panic("implement me") |
| 81 | +} |
| 82 | + |
| 83 | +func (l *LegacyAccessor) GetExpectedNextSequenceNumber( |
| 84 | + ctx context.Context, |
| 85 | + dest cciptypes.ChainSelector, |
| 86 | +) (cciptypes.SeqNum, error) { |
| 87 | + // TODO(NONEVM-1865): implement |
| 88 | + panic("implement me") |
| 89 | +} |
| 90 | + |
| 91 | +func (l *LegacyAccessor) GetTokenPriceUSD( |
| 92 | + ctx context.Context, |
| 93 | + address cciptypes.UnknownAddress, |
| 94 | +) (cciptypes.BigInt, error) { |
| 95 | + // TODO(NONEVM-1865): implement |
| 96 | + panic("implement me") |
| 97 | +} |
| 98 | + |
| 99 | +func (l *LegacyAccessor) GetFeeQuoterDestChainConfig( |
| 100 | + ctx context.Context, |
| 101 | + dest cciptypes.ChainSelector, |
| 102 | +) (cciptypes.FeeQuoterDestChainConfig, error) { |
| 103 | + // TODO(NONEVM-1865): implement |
| 104 | + panic("implement me") |
| 105 | +} |
| 106 | + |
| 107 | +func (l *LegacyAccessor) CommitReportsGTETimestamp( |
| 108 | + ctx context.Context, |
| 109 | + ts time.Time, |
| 110 | + limit int, |
| 111 | +) ([]cciptypes.CommitPluginReportWithMeta, error) { |
| 112 | + // TODO(NONEVM-1865): implement |
| 113 | + panic("implement me") |
| 114 | +} |
| 115 | + |
| 116 | +func (l *LegacyAccessor) ExecutedMessages( |
| 117 | + ctx context.Context, |
| 118 | + ranges map[cciptypes.ChainSelector]cciptypes.SeqNumRange, |
| 119 | + confidence cciptypes.ConfidenceLevel, |
| 120 | +) (map[cciptypes.ChainSelector][]cciptypes.SeqNum, error) { |
| 121 | + // TODO(NONEVM-1865): implement |
| 122 | + panic("implement me") |
| 123 | +} |
| 124 | + |
| 125 | +func (l *LegacyAccessor) NextSeqNum( |
| 126 | + ctx context.Context, |
| 127 | + sources []cciptypes.ChainSelector, |
| 128 | +) (seqNum map[cciptypes.ChainSelector]cciptypes.SeqNum, err error) { |
| 129 | + // TODO(NONEVM-1865): implement |
| 130 | + panic("implement me") |
| 131 | +} |
| 132 | + |
| 133 | +func (l *LegacyAccessor) Nonces( |
| 134 | + ctx context.Context, |
| 135 | + addresses map[cciptypes.ChainSelector][]cciptypes.UnknownEncodedAddress, |
| 136 | +) (map[cciptypes.ChainSelector]map[string]uint64, error) { |
| 137 | + // TODO(NONEVM-1865): implement |
| 138 | + panic("implement me") |
| 139 | +} |
| 140 | + |
| 141 | +func (l *LegacyAccessor) GetChainFeePriceUpdate( |
| 142 | + ctx context.Context, |
| 143 | + selectors []cciptypes.ChainSelector, |
| 144 | +) map[cciptypes.ChainSelector]cciptypes.TimestampedBig { |
| 145 | + // TODO(NONEVM-1865): implement |
| 146 | + panic("implement me") |
| 147 | +} |
| 148 | + |
| 149 | +func (l *LegacyAccessor) GetLatestPriceSeqNr(ctx context.Context) (uint64, error) { |
| 150 | + // TODO(NONEVM-1865): implement |
| 151 | + panic("implement me") |
| 152 | +} |
| 153 | + |
| 154 | +func (l *LegacyAccessor) GetOffRampConfigDigest(ctx context.Context, pluginType uint8) ([32]byte, error) { |
| 155 | + // TODO(NONEVM-1865): implement |
| 156 | + panic("implement me") |
| 157 | +} |
| 158 | + |
| 159 | +func (l *LegacyAccessor) GetOffRampSourceChainsConfig( |
| 160 | + ctx context.Context, |
| 161 | + sourceChains []cciptypes.ChainSelector, |
| 162 | +) (map[cciptypes.ChainSelector]cciptypes.SourceChainConfig, error) { |
| 163 | + // TODO(NONEVM-1865): implement |
| 164 | + panic("implement me") |
| 165 | +} |
| 166 | + |
| 167 | +func (l *LegacyAccessor) GetRMNRemoteConfig(ctx context.Context) (cciptypes.RemoteConfig, error) { |
| 168 | + // TODO(NONEVM-1865): implement |
| 169 | + panic("implement me") |
| 170 | +} |
| 171 | + |
| 172 | +func (l *LegacyAccessor) GetRmnCurseInfo(ctx context.Context) (cciptypes.CurseInfo, error) { |
| 173 | + // TODO(NONEVM-1865): implement |
| 174 | + panic("implement me") |
| 175 | +} |
0 commit comments