Skip to content

Commit

Permalink
GetLatestValue with events functional
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Feb 25, 2025
1 parent 2b9da81 commit 6d5a081
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/gagliardetto/solana-go v1.12.0
github.com/go-resty/resty/v2 v2.15.3
github.com/google/uuid v1.6.0
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/pelletier/go-toml/v2 v2.2.3
github.com/rs/zerolog v1.33.0
Expand Down Expand Up @@ -240,7 +241,6 @@ require (
github.com/jackc/pgx/v4 v4.18.3 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand Down
27 changes: 22 additions & 5 deletions integration-tests/relayinterface/chain_components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,16 @@ func DisableTests(it *SolanaChainComponentsInterfaceTester[*testing.T]) {
ContractReaderBatchGetLatestValue,
ContractReaderBatchGetLatestValueDifferentParamsResultsRetainOrder,
ContractReaderBatchGetLatestValueDifferentParamsResultsRetainOrderMultipleContracts,
// events not yet supported
ContractReaderGetLatestValueGetsLatestForEvent,

// tests to enable
// ContractReaderQueryKeyNotFound,
// ContractReaderQueryKeyReturnsData,
// ContractReaderGetLatestValueGetsLatestForEvent,
ContractReaderGetLatestValueBasedOnConfidenceLevelForEvent,
ContractReaderGetLatestValueReturnsNotFoundWhenNotTriggeredForEvent,
ContractReaderGetLatestValueWithFilteringForEvent,
// query key not fully implemented yet
ContractReaderQueryKeyReturnsDataAsValuesDotValue,
ContractReaderQueryKeyCanLimitResultsWithCursor,

// QueryKeys not implemented
ContractReaderQueryKeysReturnsDataTwoEventTypes,
ContractReaderQueryKeysNotFound,
ContractReaderQueryKeysReturnsData,
Expand Down Expand Up @@ -1057,6 +1059,21 @@ func (it *SolanaChainComponentsInterfaceTester[T]) buildContractReaderConfig(t T
EventName: {
ChainSpecificName: "TestEvent",
ReadType: config.Event,
InputModifications: commoncodec.ModifiersConfig{
&commoncodec.PropertyExtractorConfig{
FieldName: "Data",
EnablePathTraverse: true,
},
&commoncodec.AddressBytesToStringModifierConfig{
Fields: []string{"AccountStruct.AccountStr"},
EnablePathTraverse: true,
},
&commoncodec.ConstrainedBytesToStringModifierConfig{
Fields: []string{"DifferentField", "NestedDynamicStruct.Inner.S"},
EnablePathTraverse: true,
MaxLen: 32,
},
},
OutputModifications: commoncodec.ModifiersConfig{
&commoncodec.PropertyExtractorConfig{FieldName: "Data"},
&commoncodec.AddressBytesToStringModifierConfig{
Expand Down

0 comments on commit 6d5a081

Please sign in to comment.