From 98e102c870844afa611b7a0b7e0fcc5edd9b9faf Mon Sep 17 00:00:00 2001 From: ilija Date: Fri, 7 Feb 2025 15:41:02 +0100 Subject: [PATCH] temp --- pkg/solana/chainreader/bindings.go | 11 +++++++++++ pkg/solana/chainreader/lookup.go | 3 +++ 2 files changed, 14 insertions(+) diff --git a/pkg/solana/chainreader/bindings.go b/pkg/solana/chainreader/bindings.go index 1b927df85..b26cae62e 100644 --- a/pkg/solana/chainreader/bindings.go +++ b/pkg/solana/chainreader/bindings.go @@ -9,12 +9,23 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types" ) +type ReadType int + +const ( + Log ReadType = iota + Account + AccountPDA + AccountMulti + AccountSplitParams +) + type readBinding interface { SetAddress(solana.PublicKey) GetAddress(context.Context, any) (solana.PublicKey, error) SetCodec(types.RemoteCodec) CreateType(bool) (any, error) Decode(context.Context, []byte, any) error + ReadType() ReadType } // key is namespace diff --git a/pkg/solana/chainreader/lookup.go b/pkg/solana/chainreader/lookup.go index e51c2a878..23df02f47 100644 --- a/pkg/solana/chainreader/lookup.go +++ b/pkg/solana/chainreader/lookup.go @@ -9,9 +9,11 @@ import ( type readValues struct { address string contract string + // First read in multi read has type info that other sequential reads are filling out. // this works by having hard coder codec modifier define fields that are filled out by subsequent reads. multiRead []string + ReadType string } // lookup provides basic utilities for mapping a complete readIdentifier to @@ -64,6 +66,7 @@ func (l *lookup) bindAddressForContract(contract, address string) { address: address, contract: contract, multiRead: multiRead, + ReadType: } } }