Skip to content

Commit

Permalink
relayer/pkg/chainlink/chain: update HealthReport (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Jan 17, 2025
1 parent b6481e9 commit afdcdd7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
8 changes: 4 additions & 4 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ require (
github.com/rs/zerolog v1.33.0
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51
github.com/smartcontractkit/chainlink-starknet/ops v0.0.0-20231205180940-ea2e3e916725
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250116220926-2bc922c6ae8c
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117154253-e07c2dde5472
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117154253-e07c2dde5472
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117154253-e07c2dde5472
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117185825-874daef670f3
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117185825-874daef670f3
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117185825-874daef670f3
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.34.0
go.uber.org/zap v1.27.0
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1230,12 +1230,12 @@ github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 h1:9PMwKNqF
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19/go.mod h1:ag7LEgejsVtPXaUNkcoFPpAoDkl1J8V2HSbqVUxfEtk=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 h1:yB1x5UXvpZNka+5h57yo1/GrKfXKCqMzChCISpldZx4=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9/go.mod h1:lJk0atEJ5Zyo3Tqrmf1Pl9jUEe79EgDb9bD3K5OTUBI=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117154253-e07c2dde5472 h1:GuApsiVlcpsOPJLIoItMy5uovIBHxDWDTUml/wMoaB8=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117154253-e07c2dde5472/go.mod h1:Lw9j3HneIfBviMDU+IwxRVyq0CEWHHV/cWYW1xGn4m8=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117154253-e07c2dde5472 h1:P14MHlEnRg3BSHkWNosLiTk8OCJKnfUq25MhKUvNv/4=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117154253-e07c2dde5472/go.mod h1:2Vp2SsRDWeM8oWqXb2mCBEmYzg+flLrLfELPOQtytvU=
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117154253-e07c2dde5472 h1:MqEAi+yZGcWJNYquXiqIqnZGVBxe7YeWvryTx76rdD4=
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117154253-e07c2dde5472/go.mod h1:0Ab+tfrirz9qo+UUzpFGyv4lYzuOnEznYJdmSWtlztQ=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117185825-874daef670f3 h1:IKQZexGZMzDZJKbLiXYE08QE2+D0F0pYYQmf6IcQq8c=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117185825-874daef670f3/go.mod h1:ajblD8urWe7x8zO2KXD6InnL0gPyF5ld5XopApRPw+w=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117185825-874daef670f3 h1:7VS+ihlcrbPT9UEgJf1aDc4gDa/1vM8SZ5p3YoXWbbc=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117185825-874daef670f3/go.mod h1:TbUgsGfMHh0OJS63xp7QwBMyBTC40PN+Cdpqe2EhYqY=
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117185825-874daef670f3 h1:YzOPX2Hkhxm7RTFF8WiyB4wpRkg29fCR39p19381CsM=
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117185825-874daef670f3/go.mod h1:vbQiTuRExBNxBvtm90pvIwe1cNim/29FaPNmfm5Ar0o=
github.com/smartcontractkit/gauntlet-plus-plus/sdks/go-gauntlet v1.1.3 h1:RIApVijvhHI6iW9pyT35Nk39rPGEC4TwVe/f+YA1G5k=
github.com/smartcontractkit/gauntlet-plus-plus/sdks/go-gauntlet v1.1.3/go.mod h1:oiUkQxoi0kZzbW125oIt4lr/pqaRSDol1rWHLCyqmNQ=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
Expand Down
24 changes: 6 additions & 18 deletions relayer/pkg/chainlink/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/loop"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/types"
"github.com/smartcontractkit/chainlink-common/pkg/utils"

"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/db"
Expand Down Expand Up @@ -59,7 +58,7 @@ func (o *ChainOpts) Validate() (err error) {
var _ Chain = (*chain)(nil)

type chain struct {
utils.StartStopOnce
services.StateMachine
id string
cfg *config.TOMLConfig
lggr logger.Logger
Expand All @@ -78,23 +77,16 @@ func NewChain(cfg *config.TOMLConfig, opts ChainOpts) (Chain, error) {
}

func newChain(id string, cfg *config.TOMLConfig, loopKs loop.Keystore, lggr logger.Logger) (*chain, error) {
lggr = logger.Named(lggr, "Chain")
lggr = logger.With(lggr, "starknetChainID", id)
ch := &chain{
id: id,
cfg: cfg,
lggr: logger.Named(lggr, "Chain"),
}

getClient := func() (*starknet.Client, error) {
return ch.getClient()
}

getFeederClient := func() (*starknet.FeederClient, error) {
return ch.getFeederClient(), nil
lggr: lggr,
}

var err error
ch.txm, err = txm.New(lggr, loopKs, cfg, getClient, getFeederClient)
ch.txm, err = txm.New(lggr, loopKs, cfg, ch.getClient, ch.getFeederClient)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -122,8 +114,8 @@ func (c *chain) ChainID() string {
return c.id
}

func (c *chain) getFeederClient() *starknet.FeederClient {
return starknet.NewFeederClient(c.cfg.FeederURL.String())
func (c *chain) getFeederClient() (*starknet.FeederClient, error) {
return starknet.NewFeederClient(c.cfg.FeederURL.String()), nil
}

// getClient returns a client, randomly selecting one from available and valid nodes
Expand Down Expand Up @@ -172,10 +164,6 @@ func (c *chain) Close() error {
})
}

func (c *chain) Ready() error {
return c.StartStopOnce.Ready()
}

func (c *chain) HealthReport() map[string]error {
report := map[string]error{c.Name(): c.Healthy()}
services.CopyHealth(report, c.txm.HealthReport())
Expand Down

0 comments on commit afdcdd7

Please sign in to comment.