Skip to content

Commit

Permalink
update plugin with new report structure
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanRHall committed Aug 27, 2024
1 parent ab74ad2 commit 250f707
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
1 change: 0 additions & 1 deletion contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity 0.8.24;
import {IFeeQuoter} from "../../interfaces/IFeeQuoter.sol";
import {IMessageInterceptor} from "../../interfaces/IMessageInterceptor.sol";
import {IPriceRegistry} from "../../interfaces/IPriceRegistry.sol";
import {IRMN} from "../../interfaces/IRMN.sol"; // TODO - remove
import {IRMNRemote, MerkleRoot} from "../../interfaces/IRMNRemote.sol";
import {IRouter} from "../../interfaces/IRouter.sol";
import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@ func TestCCIPReader_CommitReportsGTETimestamp(t *testing.T) {
},
},
},
MerkleRoots: []ccip_reader_tester.OffRampMerkleRoot{
MerkleRoots: []ccip_reader_tester.MerkleRoot{
{
SourceChainSelector: uint64(chainS1),
Interval: ccip_reader_tester.OffRampInterval{
Min: 10,
Max: 20,
},
MerkleRoot: [32]byte{i + 1},
MinSeqNr: 10,
MaxSeqNr: 20,
MerkleRoot: [32]byte{i + 1},
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccip_integration_tests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func createUniverses(
backend,
offramp.OffRampStaticConfig{
ChainSelector: getSelector(chainID),
RmnProxy: rmnProxy.Address(),
RmnRemote: rmnProxy.Address(), // TODO - Ryan
TokenAdminRegistry: tokenAdminRegistry.Address(),
NonceManager: nonceManager.Address(),
},
Expand Down
16 changes: 7 additions & 9 deletions core/capabilities/ccip/ccipevm/commitcodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ func NewCommitPluginCodecV1() *CommitPluginCodecV1 {
}

func (c *CommitPluginCodecV1) Encode(ctx context.Context, report cciptypes.CommitPluginReport) ([]byte, error) {
merkleRoots := make([]offramp.OffRampMerkleRoot, 0, len(report.MerkleRoots))
merkleRoots := make([]offramp.MerkleRoot, 0, len(report.MerkleRoots))
for _, root := range report.MerkleRoots {
merkleRoots = append(merkleRoots, offramp.OffRampMerkleRoot{
merkleRoots = append(merkleRoots, offramp.MerkleRoot{
SourceChainSelector: uint64(root.ChainSel),
Interval: offramp.OffRampInterval{
Min: uint64(root.SeqNumsRange.Start()),
Max: uint64(root.SeqNumsRange.End()),
},
MerkleRoot: root.MerkleRoot,
MinSeqNr: uint64(root.SeqNumsRange.Start()),
MaxSeqNr: uint64(root.SeqNumsRange.End()),
MerkleRoot: root.MerkleRoot,
})
}

Expand Down Expand Up @@ -102,8 +100,8 @@ func (c *CommitPluginCodecV1) Decode(ctx context.Context, bytes []byte) (cciptyp
merkleRoots = append(merkleRoots, cciptypes.MerkleRootChain{
ChainSel: cciptypes.ChainSelector(root.SourceChainSelector),
SeqNumsRange: cciptypes.NewSeqNumRange(
cciptypes.SeqNum(root.Interval.Min),
cciptypes.SeqNum(root.Interval.Max),
cciptypes.SeqNum(root.MinSeqNr),
cciptypes.SeqNum(root.MaxSeqNr),
),
MerkleRoot: root.MerkleRoot,
})
Expand Down
4 changes: 0 additions & 4 deletions core/capabilities/ccip/configs/evm/contract_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ var DestReaderConfig = evmrelaytypes.ChainReaderConfig{
ChainSpecificName: mustGetMethodName("getMerkleRoot", offrampABI),
ReadType: evmrelaytypes.Method,
},
consts.MethodNameIsBlessed: {
ChainSpecificName: mustGetMethodName("isBlessed", offrampABI),
ReadType: evmrelaytypes.Method,
},
consts.MethodNameGetLatestPriceSequenceNumber: {
ChainSpecificName: mustGetMethodName("getLatestPriceSequenceNumber", offrampABI),
ReadType: evmrelaytypes.Method,
Expand Down

0 comments on commit 250f707

Please sign in to comment.