diff --git a/core/services/relay/evm/chain_reader.go b/core/services/relay/evm/chain_reader.go index c6345b6a26f..e5aee6dbe45 100644 --- a/core/services/relay/evm/chain_reader.go +++ b/core/services/relay/evm/chain_reader.go @@ -35,14 +35,13 @@ type ChainReaderService interface { } type chainReader struct { - lggr logger.Logger - ht logpoller.HeadTracker - lp logpoller.LogPoller - client evmclient.Client - parsed *codec.ParsedTypes - bindings *read.BindingsRegistry - codec commontypes.RemoteCodec - contractToABI map[string]abi.ABI + lggr logger.Logger + ht logpoller.HeadTracker + lp logpoller.LogPoller + client evmclient.Client + parsed *codec.ParsedTypes + bindings *read.BindingsRegistry + codec commontypes.RemoteCodec commonservices.StateMachine } @@ -54,13 +53,12 @@ var _ commontypes.ContractTypeProvider = &chainReader{} // Note that the ChainReaderService returned does not support anonymous events. func NewChainReaderService(ctx context.Context, lggr logger.Logger, lp logpoller.LogPoller, ht logpoller.HeadTracker, client evmclient.Client, config types.ChainReaderConfig) (ChainReaderService, error) { cr := &chainReader{ - lggr: logger.Named(lggr, "ChainReader"), - ht: ht, - lp: lp, - client: client, - bindings: read.NewBindingsRegistry(), - parsed: &codec.ParsedTypes{EncoderDefs: map[string]types.CodecEntry{}, DecoderDefs: map[string]types.CodecEntry{}}, - contractToABI: map[string]abi.ABI{}, + lggr: logger.Named(lggr, "ChainReader"), + ht: ht, + lp: lp, + client: client, + bindings: read.NewBindingsRegistry(), + parsed: &codec.ParsedTypes{EncoderDefs: map[string]types.CodecEntry{}, DecoderDefs: map[string]types.CodecEntry{}}, } var err error @@ -172,8 +170,8 @@ func (cr *chainReader) GetLatestValue(ctx context.Context, readName string, conf return err } - ptrToVal, isValueType := returnVal.(*values.Value) - if !isValueType { + ptrToVal, isValue := returnVal.(*values.Value) + if !isValue { return binding.GetLatestValue(ctx, common.HexToAddress(address), confidenceLevel, params, returnVal) } @@ -244,8 +242,6 @@ func (cr *chainReader) addMethod( return fmt.Errorf("%w: method %s doesn't exist", commontypes.ErrInvalidConfig, chainReaderDefinition.ChainSpecificName) } - cr.contractToABI[contractName] = abi - confirmations, err := ConfirmationsFromConfig(chainReaderDefinition.ConfidenceConfirmations) if err != nil { return err diff --git a/core/services/relay/evm/read/event.go b/core/services/relay/evm/read/event.go index b6f1c77f4ee..1630265ea90 100644 --- a/core/services/relay/evm/read/event.go +++ b/core/services/relay/evm/read/event.go @@ -206,11 +206,6 @@ func (b *EventBinding) GetLatestValue(ctx context.Context, address common.Addres return b.getLatestValueWithFilters(ctx, address, confirmations, params, into) } -func (b *EventBinding) GetLatestValueWithDefaultType(ctx context.Context, address common.Address, confidenceLevel primitives.ConfidenceLevel, params any) (any, error) { - // TODO - return nil, fmt.Errorf("not implemented") -} - func (b *EventBinding) QueryKey( ctx context.Context, address common.Address, diff --git a/core/services/relay/evm/read/method.go b/core/services/relay/evm/read/method.go index 91a9bcb9bab..3f29b00ce95 100644 --- a/core/services/relay/evm/read/method.go +++ b/core/services/relay/evm/read/method.go @@ -52,7 +52,6 @@ func NewMethodBinding( confs map[primitives.ConfidenceLevel]evmtypes.Confirmations, lggr logger.Logger, ) *MethodBinding { - return &MethodBinding{ contractName: name, method: method,