Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions contracts/capabilities/fakes/solana_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import (

"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
"go.opentelemetry.io/otel/attribute"

commonCap "github.com/smartcontractkit/chainlink-common/pkg/capabilities"
ocr3types "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types"
caperrors "github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors"
solcap "github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/solana"
solanaserver "github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/solana/server"
capmon "github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/monitoring"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/types/core"
Expand Down Expand Up @@ -58,6 +60,7 @@ type FakeSolanaChain struct {
forwarderStateAccount solana.PublicKey
chainSelector uint64
dryRunWrites bool
lggr logger.Logger

// log trigger callback channels and their registered filters
mu sync.RWMutex
Expand Down Expand Up @@ -106,6 +109,7 @@ func NewFakeSolanaChain(
forwarderStateAccount: forwarderStateAccount,
chainSelector: chainSelector,
dryRunWrites: dryRunWrites,
lggr: lggr,
callbackCh: make(map[string]chan commonCap.TriggerAndId[*solcap.Log]),
logTriggerFilters: make(map[string]*solcap.FilterLogTriggerRequest),
}
Expand All @@ -122,6 +126,16 @@ func (fc *FakeSolanaChain) start(_ context.Context) error {
return nil
}

// MonitoringContext satisfies the generated solanaserver.ClientCapability
// interface. Simulation does not emit OTel metrics, so MetricsAttributes is a
// no-op; the logger is wired through for capability lifecycle logging.
func (fc *FakeSolanaChain) MonitoringContext() capmon.MonitoringContext {
return capmon.MonitoringContext{
Logger: fc.lggr,
MetricsAttributes: func() []attribute.KeyValue { return nil },
}
}

func (fc *FakeSolanaChain) close() error {
fc.eng.Debugw("Solana Chain closed")
return nil
Expand Down
2 changes: 1 addition & 1 deletion contracts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260622152157-c8e129347b8b
github.com/smartcontractkit/chainlink-solana v0.0.0-00010101000000-000000000000
github.com/stretchr/testify v1.11.1
go.opentelemetry.io/otel v1.43.0
)

require (
Expand Down Expand Up @@ -170,7 +171,6 @@ require (
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0 // indirect
Expand Down
Loading