Skip to content

Commit

Permalink
change function name for RMNHome
Browse files Browse the repository at this point in the history
  • Loading branch information
asoliman92 committed Dec 18, 2024
1 parent be53eab commit 1daa2d2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions commit/merkleroot/rmn/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (c *controller) ComputeReportSignatures(
return nil, fmt.Errorf("process update requests: %w", err)
}

homeFMap, err := c.rmnHomeReader.GetF(rmnRemoteCfg.ConfigDigest)
homeFMap, err := c.rmnHomeReader.GetFObserve(rmnRemoteCfg.ConfigDigest)
if err != nil {
return nil, fmt.Errorf("get home F: %w", err)
}
Expand Down Expand Up @@ -624,7 +624,7 @@ func (c *controller) getRmnReportSignatures(
// At this point it is also possible that the signed observations contain
// different roots for the same source chain and interval.

homeChainF, err := c.rmnHomeReader.GetF(rmnRemoteCfg.ConfigDigest)
homeChainF, err := c.rmnHomeReader.GetFObserve(rmnRemoteCfg.ConfigDigest)
if err != nil {
return nil, fmt.Errorf("get home reader F: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions commit/merkleroot/rmn/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func TestClient_ComputeReportSignatures(t *testing.T) {
t.Run("empty lane update request", func(t *testing.T) {
ts := newTestSetup(t)

ts.rmnHomeMock.On("GetF", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(
ts.rmnHomeMock.On("GetFObserve", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(
map[cciptypes.ChainSelector]int{chainS1: 2, chainS2: 2}, nil)

ts.rmnHomeMock.On("GetRMNNodesInfo", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(ts.rmnNodes, nil)
Expand All @@ -515,7 +515,7 @@ func TestClient_ComputeReportSignatures(t *testing.T) {
ts := newTestSetup(t)

ts.rmnHomeMock.On("GetRMNNodesInfo", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(ts.rmnNodes, nil)
ts.rmnHomeMock.On("GetF", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(
ts.rmnHomeMock.On("GetFObserve", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(
map[cciptypes.ChainSelector]int{chainS1: 2, chainS2: 2, chainD1: 2}, nil)
go func() {
requestIDs, requestedChains := ts.waitForObservationRequestsToBeSent(
Expand Down Expand Up @@ -556,7 +556,7 @@ func TestClient_ComputeReportSignatures(t *testing.T) {
ts.rmnController.reportsInitialRequestTimerDuration = time.Nanosecond

ts.rmnHomeMock.On("GetRMNNodesInfo", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(ts.rmnNodes, nil)
ts.rmnHomeMock.On("GetF", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(
ts.rmnHomeMock.On("GetFObserve", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(
map[cciptypes.ChainSelector]int{chainS1: 2, chainS2: 2}, nil)

go func() {
Expand Down
22 changes: 11 additions & 11 deletions mocks/pkg/reader/rmn_home.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/reader/rmn_home.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ type RMNHome interface {
GetRMNNodesInfo(configDigest cciptypes.Bytes32) ([]rmntypes.HomeNodeInfo, error)
// IsRMNHomeConfigDigestSet checks if the configDigest is set in the RMNHome contract
IsRMNHomeConfigDigestSet(configDigest cciptypes.Bytes32) bool
// GetF gets the F value for each source chain in the given configDigest.
// GetFObserve gets the F value for each source chain in the given configDigest.
// Maximum number of faulty observers; F+1 observers required to agree on an observation for a source chain.
GetF(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error)
GetFObserve(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error)
// GetOffChainConfig gets the offchain config for the given configDigest
GetOffChainConfig(configDigest cciptypes.Bytes32) (cciptypes.Bytes, error)
// GetAllConfigDigests gets the active and candidate RMNHomeConfigs
Expand Down Expand Up @@ -195,7 +195,7 @@ func (r *rmnHomePoller) IsRMNHomeConfigDigestSet(configDigest cciptypes.Bytes32)
return ok
}

func (r *rmnHomePoller) GetF(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error) {
func (r *rmnHomePoller) GetFObserve(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error) {
r.mutex.RLock()
defer r.mutex.RUnlock()
_, ok := r.rmnHomeState.rmnHomeConfig[configDigest]
Expand Down
2 changes: 1 addition & 1 deletion pkg/reader/rmn_home_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func Test_RMNHomePollingWorking(t *testing.T) {
require.NotEmpty(t, offchainConfig)
}

minObsMap, err := configPoller.GetF(config.ConfigDigest)
minObsMap, err := configPoller.GetFObserve(config.ConfigDigest)
if isEmpty {
require.Error(t, err)
require.Empty(t, minObsMap)
Expand Down

0 comments on commit 1daa2d2

Please sign in to comment.