Skip to content

Commit

Permalink
Renaming LatestConfig -> ConfigFromEventAt
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrug committed Jun 20, 2022
1 parent e185312 commit 9e233c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/chainlink/ocr2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

type OCR2Reader interface {
LatestConfigDetails(context.Context, string) (ContractConfigDetails, error)
LatestConfig(context.Context, string, uint64) (ContractConfig, error)
ConfigFromEventAt(context.Context, string, uint64) (ContractConfig, error)
BillingDetails(context.Context, string) (BillingDetails, error)

BaseClient() *starknet.Client
Expand Down Expand Up @@ -89,7 +89,7 @@ func (c *Client) LatestConfigDetails(ctx context.Context, address string) (ccd C
return
}

func (c *Client) LatestConfig(ctx context.Context, address string, blockNum uint64) (cc ContractConfig, err error) {
func (c *Client) ConfigFromEventAt(ctx context.Context, address string, blockNum uint64) (cc ContractConfig, err error) {
block, err := c.starknetClient.BlockByNumber(ctx, blockNum)
if err != nil {
return cc, errors.Wrap(err, "couldn't fetch block by number")
Expand Down
2 changes: 1 addition & 1 deletion pkg/chainlink/ocr2/contract_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (c *contractReader) LatestConfigDetails(ctx context.Context) (changedInBloc
}

func (c *contractReader) LatestConfig(ctx context.Context, changedInBlock uint64) (config types.ContractConfig, err error) {
resp, err := c.reader.LatestConfig(ctx, c.address, changedInBlock)
resp, err := c.reader.ConfigFromEventAt(ctx, c.address, changedInBlock)
if err != nil {
return config, errors.Wrap(err, "couldn't get latest config")
}
Expand Down

0 comments on commit 9e233c5

Please sign in to comment.