Skip to content

Commit afdcdd7

Browse files
authored
relayer/pkg/chainlink/chain: update HealthReport (#583)
1 parent b6481e9 commit afdcdd7

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed

integration-tests/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ require (
1313
github.com/rs/zerolog v1.33.0
1414
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51
1515
github.com/smartcontractkit/chainlink-starknet/ops v0.0.0-20231205180940-ea2e3e916725
16-
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250116220926-2bc922c6ae8c
16+
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117171710-b6481e9fcb34
1717
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19
1818
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9
19-
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117154253-e07c2dde5472
20-
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117154253-e07c2dde5472
21-
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117154253-e07c2dde5472
19+
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117185825-874daef670f3
20+
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117185825-874daef670f3
21+
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117185825-874daef670f3
2222
github.com/stretchr/testify v1.10.0
2323
github.com/testcontainers/testcontainers-go v0.34.0
2424
go.uber.org/zap v1.27.0

integration-tests/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,12 +1230,12 @@ github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 h1:9PMwKNqF
12301230
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19/go.mod h1:ag7LEgejsVtPXaUNkcoFPpAoDkl1J8V2HSbqVUxfEtk=
12311231
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 h1:yB1x5UXvpZNka+5h57yo1/GrKfXKCqMzChCISpldZx4=
12321232
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9/go.mod h1:lJk0atEJ5Zyo3Tqrmf1Pl9jUEe79EgDb9bD3K5OTUBI=
1233-
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117154253-e07c2dde5472 h1:GuApsiVlcpsOPJLIoItMy5uovIBHxDWDTUml/wMoaB8=
1234-
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117154253-e07c2dde5472/go.mod h1:Lw9j3HneIfBviMDU+IwxRVyq0CEWHHV/cWYW1xGn4m8=
1235-
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117154253-e07c2dde5472 h1:P14MHlEnRg3BSHkWNosLiTk8OCJKnfUq25MhKUvNv/4=
1236-
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117154253-e07c2dde5472/go.mod h1:2Vp2SsRDWeM8oWqXb2mCBEmYzg+flLrLfELPOQtytvU=
1237-
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117154253-e07c2dde5472 h1:MqEAi+yZGcWJNYquXiqIqnZGVBxe7YeWvryTx76rdD4=
1238-
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117154253-e07c2dde5472/go.mod h1:0Ab+tfrirz9qo+UUzpFGyv4lYzuOnEznYJdmSWtlztQ=
1233+
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117185825-874daef670f3 h1:IKQZexGZMzDZJKbLiXYE08QE2+D0F0pYYQmf6IcQq8c=
1234+
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250117185825-874daef670f3/go.mod h1:ajblD8urWe7x8zO2KXD6InnL0gPyF5ld5XopApRPw+w=
1235+
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117185825-874daef670f3 h1:7VS+ihlcrbPT9UEgJf1aDc4gDa/1vM8SZ5p3YoXWbbc=
1236+
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250117185825-874daef670f3/go.mod h1:TbUgsGfMHh0OJS63xp7QwBMyBTC40PN+Cdpqe2EhYqY=
1237+
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117185825-874daef670f3 h1:YzOPX2Hkhxm7RTFF8WiyB4wpRkg29fCR39p19381CsM=
1238+
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20250117185825-874daef670f3/go.mod h1:vbQiTuRExBNxBvtm90pvIwe1cNim/29FaPNmfm5Ar0o=
12391239
github.com/smartcontractkit/gauntlet-plus-plus/sdks/go-gauntlet v1.1.3 h1:RIApVijvhHI6iW9pyT35Nk39rPGEC4TwVe/f+YA1G5k=
12401240
github.com/smartcontractkit/gauntlet-plus-plus/sdks/go-gauntlet v1.1.3/go.mod h1:oiUkQxoi0kZzbW125oIt4lr/pqaRSDol1rWHLCyqmNQ=
12411241
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=

relayer/pkg/chainlink/chain/chain.go

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/smartcontractkit/chainlink-common/pkg/loop"
1616
"github.com/smartcontractkit/chainlink-common/pkg/services"
1717
"github.com/smartcontractkit/chainlink-common/pkg/types"
18-
"github.com/smartcontractkit/chainlink-common/pkg/utils"
1918

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

6160
type chain struct {
62-
utils.StartStopOnce
61+
services.StateMachine
6362
id string
6463
cfg *config.TOMLConfig
6564
lggr logger.Logger
@@ -78,23 +77,16 @@ func NewChain(cfg *config.TOMLConfig, opts ChainOpts) (Chain, error) {
7877
}
7978

8079
func newChain(id string, cfg *config.TOMLConfig, loopKs loop.Keystore, lggr logger.Logger) (*chain, error) {
80+
lggr = logger.Named(lggr, "Chain")
8181
lggr = logger.With(lggr, "starknetChainID", id)
8282
ch := &chain{
8383
id: id,
8484
cfg: cfg,
85-
lggr: logger.Named(lggr, "Chain"),
86-
}
87-
88-
getClient := func() (*starknet.Client, error) {
89-
return ch.getClient()
90-
}
91-
92-
getFeederClient := func() (*starknet.FeederClient, error) {
93-
return ch.getFeederClient(), nil
85+
lggr: lggr,
9486
}
9587

9688
var err error
97-
ch.txm, err = txm.New(lggr, loopKs, cfg, getClient, getFeederClient)
89+
ch.txm, err = txm.New(lggr, loopKs, cfg, ch.getClient, ch.getFeederClient)
9890
if err != nil {
9991
return nil, err
10092
}
@@ -122,8 +114,8 @@ func (c *chain) ChainID() string {
122114
return c.id
123115
}
124116

125-
func (c *chain) getFeederClient() *starknet.FeederClient {
126-
return starknet.NewFeederClient(c.cfg.FeederURL.String())
117+
func (c *chain) getFeederClient() (*starknet.FeederClient, error) {
118+
return starknet.NewFeederClient(c.cfg.FeederURL.String()), nil
127119
}
128120

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

175-
func (c *chain) Ready() error {
176-
return c.StartStopOnce.Ready()
177-
}
178-
179167
func (c *chain) HealthReport() map[string]error {
180168
report := map[string]error{c.Name(): c.Healthy()}
181169
services.CopyHealth(report, c.txm.HealthReport())

0 commit comments

Comments
 (0)