Skip to content

Commit

Permalink
Update common for a rename and fix tests that I broke a couple commit…
Browse files Browse the repository at this point in the history
…s ago
  • Loading branch information
nolag committed Jan 17, 2024
1 parent e0dea96 commit 2ee2a95
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/pelletier/go-toml/v2 v2.1.1
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/chainlink-automation v1.0.1
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20231130143053-c5102a9c0fb7
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5 h1:o36okzBAbWhlxKrIeb66Iw/U7Uy3j4FsPGQREb06SUo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e h1:dbFIpyD+w0sgxGfgVa24ZGZZdJyQ6el648K4Ih+YAUo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71 h1:Ju0cxdrzGFwHGDPp16IzkOyX87LZ/kKDFG1A+VSEJHY=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71/go.mod h1:Ppv5X8MTUkkpKdb270dLefjio724vMkCWmSSaWo7CzI=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (cr *chainReader) getEventInput(def types.ChainReaderDefinition, contractNa
}

// initialize the modification
if _, err = inMod.RetypeForOffChain(reflect.PointerTo(inputInfo.CheckedType()), ""); err != nil {
if _, err = inMod.RetypeToOffChain(reflect.PointerTo(inputInfo.CheckedType()), ""); err != nil {
return nil, nil, err
}

Expand Down
23 changes: 15 additions & 8 deletions core/services/relay/evm/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,22 @@ func (it *codecInterfaceTester) GetCodec(t *testing.T) commontypes.Codec {
require.NoError(t, err)
entry := codecConfig.Configs[k]
entry.TypeABI = string(defBytes)
if k == TestItemWithConfigExtra {

if k != sizeItemType {
entry.ModifierConfigs = codec.ModifiersConfig{
&codec.HardCodeModifierConfig{
OnChainValues: map[string]any{
"BigField": testStruct.BigField.String(),
"Account": hexutil.Encode(testStruct.Account),
},
OffChainValues: map[string]any{"ExtraField": anyExtraValue}},
&codec.RenameModifierConfig{Fields: map[string]string{"NestedStruct.Inner.IntVal": "I"}},
}
}

if k == TestItemWithConfigExtra {
hardCode := &codec.HardCodeModifierConfig{
OnChainValues: map[string]any{
"BigField": testStruct.BigField.String(),
"Account": hexutil.Encode(testStruct.Account),
},
OffChainValues: map[string]any{"ExtraField": anyExtraValue},
}
entry.ModifierConfigs = append(entry.ModifierConfigs, hardCode)
}
codecConfig.Configs[k] = entry
}
Expand Down Expand Up @@ -150,7 +157,7 @@ func packArgs(t *testing.T, allArgs []any, oargs abi.Arguments, request *EncodeR
}

var inner = []abi.ArgumentMarshaling{
{Name: "I", Type: "int64"},
{Name: "IntVal", Type: "int64"},
{Name: "S", Type: "string"},
}

Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/event_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (e *eventBinding) getLatestValueWithFilters(
return err
}

checkedParams, err := e.inputModifier.TransformForOnChain(offChain, "" /* unused */)
checkedParams, err := e.inputModifier.TransformToOnChain(offChain, "" /* unused */)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/parsed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (parsed *parsedTypes) toCodec() (commontypes.RemoteCodec, error) {
func addEntries(defs map[string]types.CodecEntry, modByTypeName map[string]codec.Modifier) error {
for k, def := range defs {
modByTypeName[k] = def.Modifier()
_, err := def.Modifier().RetypeForOffChain(reflect.PointerTo(def.CheckedType()), k)
_, err := def.Modifier().RetypeToOffChain(reflect.PointerTo(def.CheckedType()), k)
if err != nil {
return fmt.Errorf("%w: cannot retype %v: %w", commontypes.ErrInvalidConfig, k, err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ require (
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704
github.com/smartcontractkit/chainlink-automation v1.0.1
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240110170252-c27581c17dc1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5 h1:o36okzBAbWhlxKrIeb66Iw/U7Uy3j4FsPGQREb06SUo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e h1:dbFIpyD+w0sgxGfgVa24ZGZZdJyQ6el648K4Ih+YAUo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71 h1:Ju0cxdrzGFwHGDPp16IzkOyX87LZ/kKDFG1A+VSEJHY=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71/go.mod h1:Ppv5X8MTUkkpKdb270dLefjio724vMkCWmSSaWo7CzI=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/segmentio/ksuid v1.0.4
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-automation v1.0.1
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e
github.com/smartcontractkit/chainlink-testing-framework v1.22.1
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1481,8 +1481,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5 h1:o36okzBAbWhlxKrIeb66Iw/U7Uy3j4FsPGQREb06SUo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240116201354-23cd46ccbbe5/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e h1:dbFIpyD+w0sgxGfgVa24ZGZZdJyQ6el648K4Ih+YAUo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240117153340-99068ae17c7e/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71 h1:Ju0cxdrzGFwHGDPp16IzkOyX87LZ/kKDFG1A+VSEJHY=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231222201016-da3f0a763f71/go.mod h1:Ppv5X8MTUkkpKdb270dLefjio724vMkCWmSSaWo7CzI=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=
Expand Down

0 comments on commit 2ee2a95

Please sign in to comment.