Skip to content

Commit f0d8ce8

Browse files
committed
fix existing tests and remove go-eth
1 parent 1beed88 commit f0d8ce8

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

go.mod

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/bytecodealliance/wasmtime-go/v23 v23.0.0
1111
github.com/confluentinc/confluent-kafka-go/v2 v2.3.0
1212
github.com/dominikbraun/graph v0.23.0
13-
github.com/ethereum/go-ethereum v1.13.8
1413
github.com/fxamacker/cbor/v2 v2.5.0
1514
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0
1615
github.com/go-playground/validator/v10 v10.4.1
@@ -61,8 +60,6 @@ require (
6160
sigs.k8s.io/yaml v1.4.0
6261
)
6362

64-
require github.com/holiman/uint256 v1.2.4 // indirect
65-
6663
require (
6764
github.com/bahlo/generic-list-go v0.2.0 // indirect
6865
github.com/beorn7/perks v1.0.1 // indirect

go.sum

-4
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
5454
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
5555
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
5656
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
57-
github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg=
58-
github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA=
5957
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
6058
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
6159
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
@@ -131,8 +129,6 @@ github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 h1:OSQYEsRT3
131129
github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q=
132130
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
133131
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
134-
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
135-
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
136132
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
137133
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
138134
github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI=

pkg/codec/encodings/type_codec_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ func (*interfaceTesterBase) GetAccountBytes(i int) []byte {
133133
return []byte{ib, ib + 1, ib + 2, ib + 3, ib + 4, ib + 5, ib + 6, ib + 7}
134134
}
135135

136+
func (t *interfaceTesterBase) GetAccountString(i int) string {
137+
return string(t.GetAccountBytes(i))
138+
}
139+
136140
type bigEndianInterfaceTester struct {
137141
interfaceTesterBase
138142
lenient bool
@@ -170,6 +174,8 @@ func (b *bigEndianInterfaceTester) encode(t *testing.T, bytes []byte, ts TestStr
170174
}
171175
bytes = append(bytes, byte(len(ts.Account)))
172176
bytes = append(bytes, ts.Account...)
177+
bytes = rawbin.BigEndian.AppendUint32(bytes, uint32(len(ts.AccountStr)))
178+
bytes = append(bytes, []byte(ts.AccountStr)...)
173179
bytes = append(bytes, byte(len(ts.Accounts)))
174180
for _, account := range ts.Accounts {
175181
bytes = append(bytes, byte(len(account)))
@@ -230,6 +236,7 @@ func newTestStructCodec(t *testing.T, builder encodings.Builder) encodings.TypeC
230236
{Name: "OracleID", Codec: builder.OracleID()},
231237
{Name: "OracleIDs", Codec: oIDs},
232238
{Name: "Account", Codec: acc},
239+
{Name: "AccountStr", Codec: sCodec},
233240
{Name: "Accounts", Codec: accs},
234241
{Name: "BigField", Codec: bi},
235242
{Name: "NestedStruct", Codec: midCodec},

pkg/loop/internal/relayer/pluginprovider/contractreader/helper_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ func (*cannotEncode) UnmarshalText() error {
4444
type interfaceTesterBase struct{}
4545

4646
var anyAccountBytes = []byte{1, 2, 3}
47+
var anyAccountString = string(anyAccountBytes)
4748

4849
func (it *interfaceTesterBase) GetAccountBytes(_ int) []byte {
4950
return anyAccountBytes
5051
}
5152

53+
func (it *interfaceTesterBase) GetAccountString(_ int) string {
54+
return anyAccountString
55+
}
56+
5257
func (it *interfaceTesterBase) Name() string {
5358
return "relay client"
5459
}

pkg/types/interfacetests/codec_interface_tests.go

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func RunCodecInterfaceTests(t *testing.T, tester CodecInterfaceTester) {
6666
resp := tester.EncodeFields(t, req)
6767
compatibleItem := compatibleTestStruct{
6868
Account: item.Account,
69+
AccountStr: item.AccountStr,
6970
Accounts: item.Accounts,
7071
BigField: item.BigField,
7172
DifferentField: item.DifferentField,
@@ -94,6 +95,7 @@ func RunCodecInterfaceTests(t *testing.T, tester CodecInterfaceTester) {
9495
resp := tester.EncodeFields(t, req)
9596
compatibleMap := map[string]any{
9697
"Account": item.Account,
98+
"AccountStr": item.AccountStr,
9799
"Accounts": item.Accounts,
98100
"BigField": item.BigField,
99101
"DifferentField": item.DifferentField,
@@ -130,6 +132,7 @@ func RunCodecInterfaceTests(t *testing.T, tester CodecInterfaceTester) {
130132
OracleID: ts.OracleID,
131133
OracleIDs: ts.OracleIDs,
132134
Account: ts.Account,
135+
AccountStr: ts.AccountStr,
133136
Accounts: ts.Accounts,
134137
BigField: ts.BigField,
135138
NestedStruct: ts.NestedStruct,

0 commit comments

Comments
 (0)