From 16366bb52fdedbaa31fa8efb6f77321f8139a723 Mon Sep 17 00:00:00 2001 From: Ryan Tinianov Date: Thu, 16 Nov 2023 11:49:38 -0500 Subject: [PATCH] Pull out my changes in one commit so you can merge to dev branch (#245) --- pkg/codec/utils.go | 133 --- pkg/codec/utils_test.go | 139 --- pkg/loop/internal/chain_reader.go | 122 +-- pkg/loop/internal/chain_reader_test.go | 140 +-- pkg/loop/internal/pb/relayer.pb.go | 898 +++++------------- pkg/loop/internal/pb/relayer.proto | 31 - pkg/loop/internal/pb/relayer_grpc.pb.go | 111 --- pkg/types/chain_reader.go | 19 - pkg/types/interfacetests/README.md | 3 - .../chain_reader_interface_tests.go | 289 +----- pkg/types/map_decoder.go | 13 - 11 files changed, 239 insertions(+), 1659 deletions(-) delete mode 100644 pkg/codec/utils.go delete mode 100644 pkg/codec/utils_test.go delete mode 100644 pkg/types/interfacetests/README.md delete mode 100644 pkg/types/map_decoder.go diff --git a/pkg/codec/utils.go b/pkg/codec/utils.go deleted file mode 100644 index a2126a83d..000000000 --- a/pkg/codec/utils.go +++ /dev/null @@ -1,133 +0,0 @@ -package codec - -import ( - "math/big" - "reflect" - "strconv" - - "github.com/smartcontractkit/chainlink-relay/pkg/types" -) - -func FitsInNBitsSigned(n int, bi *big.Int) bool { - if bi.Sign() < 0 { - bi = new(big.Int).Neg(bi) - bi.Sub(bi, big.NewInt(1)) - } - return bi.BitLen() <= n-1 -} - -func BigIntHook(_, to reflect.Type, data any) (any, error) { - if to == reflect.TypeOf(&big.Int{}) { - bigInt := big.NewInt(0) - - switch v := data.(type) { - case float64: - bigInt.SetInt64(int64(v)) - case float32: - bigInt.SetInt64(int64(v)) - case int: - bigInt.SetInt64(int64(v)) - case int8: - bigInt.SetInt64(int64(v)) - case int16: - bigInt.SetInt64(int64(v)) - case int32: - bigInt.SetInt64(int64(v)) - case int64: - bigInt.SetInt64(v) - case uint: - bigInt.SetUint64(uint64(v)) - case uint8: - bigInt.SetUint64(uint64(v)) - case uint16: - bigInt.SetUint64(uint64(v)) - case uint32: - bigInt.SetUint64(uint64(v)) - case uint64: - bigInt.SetUint64(v) - case string: - _, ok := bigInt.SetString(v, 10) - if !ok { - return nil, types.InvalidTypeError{} - } - default: - return data, nil - } - - return bigInt, nil - } - - if bi, ok := data.(*big.Int); ok { - switch to { - case reflect.TypeOf(0): - if FitsInNBitsSigned(strconv.IntSize, bi) { - return int(bi.Int64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(int8(0)): - if FitsInNBitsSigned(8, bi) { - return int8(bi.Int64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(int16(0)): - if FitsInNBitsSigned(16, bi) { - return int16(bi.Int64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(int32(0)): - if FitsInNBitsSigned(32, bi) { - return int32(bi.Int64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(int64(0)): - if FitsInNBitsSigned(64, bi) { - return bi.Int64(), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(uint(0)): - if bi.Sign() >= 0 && bi.BitLen() <= strconv.IntSize { - return uint(bi.Uint64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(uint8(0)): - if bi.Sign() >= 0 && bi.BitLen() <= 8 { - return uint8(bi.Uint64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(uint16(0)): - if bi.Sign() >= 0 && bi.BitLen() <= 16 { - return uint16(bi.Uint64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(uint32(0)): - if bi.Sign() >= 0 && bi.BitLen() <= 32 { - return uint32(bi.Uint64()), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(uint64(0)): - if bi.Sign() >= 0 && bi.BitLen() <= 64 { - return bi.Uint64(), nil - } - return nil, types.InvalidTypeError{} - case reflect.TypeOf(""): - return bi.String(), nil - default: - return data, nil - } - } - - return data, nil -} - -func SliceToArrayVerifySizeHook(from reflect.Type, to reflect.Type, data any) (any, error) { - // By default, if the array is bigger it'll still work. (ie []int{1, 2, 3} => [4]int{} works with 0 at the end - // [2]int{} would not work. This seems to lenient, but can be discussed. - if from.Kind() == reflect.Slice && to.Kind() == reflect.Array { - slice := reflect.ValueOf(data) - if slice.Len() != to.Len() { - return nil, types.WrongNumberOfElements{} - } - } - - return data, nil -} diff --git a/pkg/codec/utils_test.go b/pkg/codec/utils_test.go deleted file mode 100644 index 2ce2fc743..000000000 --- a/pkg/codec/utils_test.go +++ /dev/null @@ -1,139 +0,0 @@ -package codec_test - -import ( - "fmt" - "math" - "math/big" - "reflect" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-relay/pkg/codec" - "github.com/smartcontractkit/chainlink-relay/pkg/types" -) - -func TestFitsInNBitsSigned(t *testing.T) { - t.Parallel() - t.Run("Fits", func(t *testing.T) { - bi := big.NewInt(math.MaxInt16) - assert.True(t, codec.FitsInNBitsSigned(16, bi)) - }) - - t.Run("Too large", func(t *testing.T) { - bi := big.NewInt(math.MaxInt16 + 1) - assert.False(t, codec.FitsInNBitsSigned(16, bi)) - }) - - t.Run("Too small", func(t *testing.T) { - bi := big.NewInt(math.MinInt16 - 1) - assert.False(t, codec.FitsInNBitsSigned(16, bi)) - }) -} - -func TestBigIntHook(t *testing.T) { - intTypes := []struct { - Type reflect.Type - Max *big.Int - Min *big.Int - }{ - {Type: reflect.TypeOf(0), Min: big.NewInt(math.MinInt), Max: big.NewInt(math.MaxInt)}, - {Type: reflect.TypeOf(uint(0)), Min: big.NewInt(0), Max: new(big.Int).SetUint64(math.MaxUint)}, - {Type: reflect.TypeOf(int8(0)), Min: big.NewInt(math.MinInt8), Max: big.NewInt(math.MaxInt8)}, - {Type: reflect.TypeOf(uint8(0)), Min: big.NewInt(0), Max: new(big.Int).SetUint64(math.MaxUint8)}, - {Type: reflect.TypeOf(int16(0)), Min: big.NewInt(math.MinInt16), Max: big.NewInt(math.MaxInt16)}, - {Type: reflect.TypeOf(uint16(0)), Min: big.NewInt(0), Max: new(big.Int).SetUint64(math.MaxUint16)}, - {Type: reflect.TypeOf(int32(0)), Min: big.NewInt(math.MinInt32), Max: big.NewInt(math.MaxInt32)}, - {Type: reflect.TypeOf(uint32(0)), Min: big.NewInt(0), Max: new(big.Int).SetUint64(math.MaxUint32)}, - {Type: reflect.TypeOf(int64(0)), Min: big.NewInt(math.MinInt64), Max: big.NewInt(math.MaxInt64)}, - {Type: reflect.TypeOf(uint64(0)), Min: big.NewInt(0), Max: new(big.Int).SetUint64(math.MaxUint64)}, - } - for _, intType := range intTypes { - t.Run(fmt.Sprintf("Fits conversion %v", intType.Type), func(t *testing.T) { - anyValidNumber := big.NewInt(5) - result, err := codec.BigIntHook(reflect.TypeOf((*big.Int)(nil)), intType.Type, anyValidNumber) - require.NoError(t, err) - require.IsType(t, reflect.New(intType.Type).Elem().Interface(), result) - if intType.Min.Cmp(big.NewInt(0)) == 0 { - u64 := reflect.ValueOf(result).Convert(reflect.TypeOf(uint64(0))).Interface().(uint64) - actual := new(big.Int).SetUint64(u64) - require.Equal(t, anyValidNumber, actual) - } else { - i64 := reflect.ValueOf(result).Convert(reflect.TypeOf(int64(0))).Interface().(int64) - actual := big.NewInt(i64) - require.Equal(t, 0, anyValidNumber.Cmp(actual)) - } - }) - - t.Run("Overflow return an error "+intType.Type.String(), func(t *testing.T) { - bigger := new(big.Int).Add(intType.Max, big.NewInt(1)) - _, err := codec.BigIntHook(reflect.TypeOf((*big.Int)(nil)), intType.Type, bigger) - assert.IsType(t, types.InvalidTypeError{}, err) - }) - - t.Run("Underflow return an error "+intType.Type.String(), func(t *testing.T) { - smaller := new(big.Int).Sub(intType.Min, big.NewInt(1)) - _, err := codec.BigIntHook(reflect.TypeOf((*big.Int)(nil)), intType.Type, smaller) - assert.IsType(t, types.InvalidTypeError{}, err) - }) - - t.Run("Converts from "+intType.Type.String(), func(t *testing.T) { - anyValidNumber := int64(5) - asType := reflect.ValueOf(anyValidNumber).Convert(intType.Type).Interface() - result, err := codec.BigIntHook(intType.Type, reflect.TypeOf((*big.Int)(nil)), asType) - require.NoError(t, err) - bi, ok := result.(*big.Int) - require.True(t, ok) - assert.Equal(t, anyValidNumber, bi.Int64()) - }) - } - - t.Run("Converts from string", func(t *testing.T) { - anyNumber := int64(5) - result, err := codec.BigIntHook(reflect.TypeOf(""), reflect.TypeOf((*big.Int)(nil)), strconv.FormatInt(anyNumber, 10)) - require.NoError(t, err) - bi, ok := result.(*big.Int) - require.True(t, ok) - assert.Equal(t, anyNumber, bi.Int64()) - }) - - t.Run("Converts to string", func(t *testing.T) { - anyNumber := int64(5) - result, err := codec.BigIntHook(reflect.TypeOf((*big.Int)(nil)), reflect.TypeOf(""), big.NewInt(anyNumber)) - require.NoError(t, err) - assert.Equal(t, strconv.FormatInt(anyNumber, 10), result) - }) - - t.Run("Errors for invalid string", func(t *testing.T) { - _, err := codec.BigIntHook(reflect.TypeOf(""), reflect.TypeOf((*big.Int)(nil)), "Not a number :(") - require.IsType(t, types.InvalidTypeError{}, err) - }) -} - -func TestSliceToArrayVerifySizeHook(t *testing.T) { - t.Run("correct size slice converts", func(t *testing.T) { - to := reflect.TypeOf([2]int64{}) - data := []int64{1, 2} - res, err := codec.SliceToArrayVerifySizeHook(reflect.TypeOf(data), to, data) - assert.NoError(t, err) - - // Mapstructure will convert slices to arrays, all we need in this hook is to pass it along - assert.Equal(t, data, res) - }) - - t.Run("Too large slice returns error", func(t *testing.T) { - to := reflect.TypeOf([2]int64{}) - data := []int64{1, 2, 3} - _, err := codec.SliceToArrayVerifySizeHook(reflect.TypeOf(data), to, data) - assert.IsType(t, types.WrongNumberOfElements{}, err) - }) - - t.Run("Too small slice returns error", func(t *testing.T) { - to := reflect.TypeOf([2]int64{}) - data := []int64{1} - _, err := codec.SliceToArrayVerifySizeHook(reflect.TypeOf(data), to, data) - assert.IsType(t, types.WrongNumberOfElements{}, err) - }) -} diff --git a/pkg/loop/internal/chain_reader.go b/pkg/loop/internal/chain_reader.go index 70e4cdb89..37e2c21ae 100644 --- a/pkg/loop/internal/chain_reader.go +++ b/pkg/loop/internal/chain_reader.go @@ -8,7 +8,6 @@ import ( jsonv2 "github.com/go-json-experiment/json" "github.com/fxamacker/cbor/v2" - libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "google.golang.org/grpc/status" "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" @@ -103,55 +102,6 @@ func (c *chainReaderClient) GetLatestValue(ctx context.Context, bc types.BoundCo return decodeVersionedBytes(retVal, reply.RetVal) } -func (c *chainReaderClient) Encode(ctx context.Context, item any, itemType string) (libocr.Report, error) { - versionedParams, err := encodeVersionedBytes(item, ParamsCurrentEncodingVersion) - if err != nil { - return nil, err - } - - reply, err := c.grpc.GetEncoding(ctx, &pb.GetEncodingRequest{ - Params: versionedParams, - ItemType: itemType, - }) - - if err != nil { - return nil, unwrapClientError(err) - } - - return reply.RetVal, nil -} - -func (c *chainReaderClient) Decode(ctx context.Context, raw []byte, into any, itemType string) error { - request := &pb.GetDecodingRequest{ - Encoded: raw, - ItemType: itemType, - } - resp, err := c.grpc.GetDecoding(ctx, request) - if err != nil { - return unwrapClientError(err) - } - - return decodeVersionedBytes(into, resp.RetVal) -} - -func (c *chainReaderClient) GetMaxEncodingSize(ctx context.Context, n int, itemType string) (int, error) { - res, err := c.grpc.GetMaxSize(ctx, &pb.GetMaxSizeRequest{N: int32(n), ItemType: itemType, ForEncoding: true}) - if err != nil { - return 0, unwrapClientError(err) - } - - return int(res.SizeInBytes), nil -} - -func (c *chainReaderClient) GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error) { - res, err := c.grpc.GetMaxSize(ctx, &pb.GetMaxSizeRequest{N: int32(n), ItemType: itemType, ForEncoding: false}) - if err != nil { - return 0, unwrapClientError(err) - } - - return int(res.SizeInBytes), nil -} - var _ pb.ChainReaderServer = (*chainReaderServer)(nil) type chainReaderServer struct { @@ -165,20 +115,14 @@ func (c *chainReaderServer) GetLatestValue(ctx context.Context, request *pb.GetL bc.Address = request.Bc.Address[:] bc.Pending = request.Bc.Pending - params, err := c.getEncodedType(request.Method, true) - if err != nil { - return nil, err - } + params := &map[string]any{} - if err = decodeVersionedBytes(params, request.Params); err != nil { + if err := decodeVersionedBytes(params, request.Params); err != nil { return nil, err } - retVal, err := c.getEncodedType(request.Method, false) - if err != nil { - return nil, err - } - err = c.impl.GetLatestValue(ctx, bc, request.Method, params, retVal) + retVal := &map[string]any{} + err := c.impl.GetLatestValue(ctx, bc, request.Method, params, retVal) if err != nil { return nil, err } @@ -191,71 +135,13 @@ func (c *chainReaderServer) GetLatestValue(ctx context.Context, request *pb.GetL return &pb.GetLatestValueReply{RetVal: encodedRetVal}, nil } -func (c *chainReaderServer) GetEncoding(ctx context.Context, req *pb.GetEncodingRequest) (*pb.GetEncodingResponse, error) { - encodedType, err := c.getEncodedType(req.ItemType, true) - if err != nil { - return nil, err - } - - if err = decodeVersionedBytes(encodedType, req.Params); err != nil { - return nil, err - } - - encoded, err := c.impl.Encode(ctx, encodedType, req.ItemType) - return &pb.GetEncodingResponse{RetVal: encoded}, err -} - -func (c *chainReaderServer) GetDecoding(ctx context.Context, req *pb.GetDecodingRequest) (*pb.GetDecodingResponse, error) { - encodedType, err := c.getEncodedType(req.ItemType, false) - if err != nil { - return nil, err - } - - err = c.impl.Decode(ctx, req.Encoded, encodedType, req.ItemType) - if err != nil { - return nil, err - } - - versionBytes, err := encodeVersionedBytes(encodedType, RetvalCurrentEncodingVersion) - return &pb.GetDecodingResponse{RetVal: versionBytes}, err -} - -func (c *chainReaderServer) GetMaxSize(ctx context.Context, req *pb.GetMaxSizeRequest) (*pb.GetMaxSizeResponse, error) { - var sizeFn func(context.Context, int, string) (int, error) - if req.ForEncoding { - sizeFn = c.impl.GetMaxEncodingSize - } else { - sizeFn = c.impl.GetMaxDecodingSize - } - - maxSize, err := sizeFn(ctx, int(req.N), req.ItemType) - if err != nil { - return nil, err - } - return &pb.GetMaxSizeResponse{SizeInBytes: int32(maxSize)}, nil -} - -func (c *chainReaderServer) getEncodedType(itemType string, forEncoding bool) (any, error) { - if rc, ok := c.impl.(types.RemoteCodec); ok { - return rc.CreateType(itemType, forEncoding) - } - - return &map[string]any{}, nil -} - func unwrapClientError(err error) error { if s, ok := status.FromError(err); ok { switch s.Message() { - case types.InvalidEncodingError{}.Error(): - return types.InvalidEncodingError{} case types.InvalidTypeError{}.Error(): return types.InvalidTypeError{} case types.FieldNotFoundError{}.Error(): return types.FieldNotFoundError{} - case types.WrongNumberOfElements{}.Error(): - return types.WrongNumberOfElements{} - case types.NotASliceError{}.Error(): - return types.NotASliceError{} } } return err diff --git a/pkg/loop/internal/chain_reader_test.go b/pkg/loop/internal/chain_reader_test.go index 3bde8b550..52ae8fac1 100644 --- a/pkg/loop/internal/chain_reader_test.go +++ b/pkg/loop/internal/chain_reader_test.go @@ -8,6 +8,7 @@ import ( "sync" "testing" + "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/assert" "google.golang.org/grpc/test/bufconn" @@ -16,8 +17,6 @@ import ( "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" "github.com/fxamacker/cbor/v2" - "github.com/mitchellh/mapstructure" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -82,56 +81,21 @@ func TestChainReaderClient(t *testing.T) { ctx := context.Background() errorTypes := []error{ - types.InvalidEncodingError{}, types.InvalidTypeError{}, types.FieldNotFoundError{}, - types.WrongNumberOfElements{}, - types.NotASliceError{}, } for _, errorType := range errorTypes { es.err = errorType - t.Run("Encode unwraps errors from server "+errorType.Error(), func(t *testing.T) { - _, err := client.Encode(ctx, "any", "doesnotmatter") - assert.IsType(t, errorType, err) - }) - - t.Run("Decode unwraps errors from server "+errorType.Error(), func(t *testing.T) { - _, err := client.Encode(ctx, "any", "doesnotmatter") - assert.IsType(t, errorType, err) - }) - t.Run("GetLatestValue unwraps errors from server "+errorType.Error(), func(t *testing.T) { err := client.GetLatestValue(ctx, types.BoundContract{}, "method", "anything", "anything") assert.IsType(t, errorType, err) }) - - t.Run("GetMaxEncodingSize unwraps errors from server "+errorType.Error(), func(t *testing.T) { - _, err := client.GetMaxEncodingSize(ctx, 1, "anything") - assert.IsType(t, errorType, err) - }) - - t.Run("GetMaxEncodingSize unwraps errors from server "+errorType.Error(), func(t *testing.T) { - _, err := client.GetMaxDecodingSize(ctx, 1, "anything") - assert.IsType(t, errorType, err) - }) } // make sure that errors come from client directly es.err = nil var invalidTypeErr types.InvalidTypeError - - t.Run("Encode returns error if type cannot be encoded in the wire format", func(t *testing.T) { - _, err := client.Encode(ctx, &cannotEncode{}, "doesnotmatter") - - assert.NotNil(t, errors.As(err, &invalidTypeErr)) - }) - - t.Run("Decode returns error if type cannot be decoded in the wire format", func(t *testing.T) { - _, err := client.Encode(ctx, &cannotEncode{}, "doesnotmatter") - assert.NotNil(t, errors.As(err, &invalidTypeErr)) - }) - t.Run("GetLatestValue returns error if type cannot be encoded in the wire format", func(t *testing.T) { err := client.GetLatestValue(ctx, types.BoundContract{}, "method", &cannotEncode{}, &TestStruct{}) assert.NotNil(t, errors.As(err, &invalidTypeErr)) @@ -167,26 +131,10 @@ func (it *interfaceTester) GetSliceContract(ctx context.Context, t *testing.T) t return types.BoundContract{} } -func (it *interfaceTester) EncodeFields(t *testing.T, request *EncodeRequest) ocrtypes.Report { - if request.TestOn == TestItemType { - bytes, err := encoder.Marshal(request.TestStructs[0]) - require.NoError(t, err) - return bytes - } - - bytes, err := encoder.Marshal(request.TestStructs) - require.NoError(t, err) - return bytes -} - func (it *interfaceTester) GetAccountBytes(_ int) []byte { return []byte{1, 2, 3} } -func (it *interfaceTester) IncludeArrayEncodingSizeEnforcement() bool { - return false -} - func (it *interfaceTester) Setup(t *testing.T) { lis := bufconn.Listen(1024 * 1024) it.lis = lis @@ -232,18 +180,6 @@ type fakeCodecServer struct { lock *sync.Mutex } -func (f *fakeCodecServer) GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error) { - return f.GetMaxEncodingSize(ctx, n, itemType) -} - -func (f *fakeCodecServer) GetMaxEncodingSize(ctx context.Context, n int, itemType string) (int, error) { - switch itemType { - case TestItemType, TestItemSliceType, TestItemArray2Type, TestItemArray1Type: - return 1, nil - } - return 0, types.InvalidTypeError{} -} - func (f *fakeCodecServer) SetLatestValue(ts *TestStruct) { f.lock.Lock() defer f.lock.Unlock() @@ -251,71 +187,17 @@ func (f *fakeCodecServer) SetLatestValue(ts *TestStruct) { } func (f *fakeCodecServer) GetLatestValue(ctx context.Context, _ types.BoundContract, method string, params, returnVal any) error { - if method == MethodReturningUint64 { - r := returnVal.(*uint64) - *r = AnyValueToReadWithoutAnArgument - return nil - } else if method == MethodReturningUint64Slice { - r := returnVal.(*[]uint64) - *r = AnySliceToReadWithoutAnArgument - return nil - } else if method != MethodTakingLatestParamsReturningTestStruct { + if method != MethodTakingLatestParamsReturningTestStruct { return errors.New("unknown method " + method) } f.lock.Lock() defer f.lock.Unlock() - lp := params.(*LatestParams) - rv := returnVal.(*TestStruct) - *rv = f.latest[lp.I-1] - return nil -} - -func (f *fakeCodecServer) Encode(_ context.Context, item any, itemType string) (ocrtypes.Report, error) { - f.lastItem = item - switch itemType { - case TestItemType, TestItemSliceType, TestItemArray2Type, TestItemArray1Type: - return encoder.Marshal(item) - } - return nil, types.InvalidTypeError{} + lp := params.(*map[string]interface{}) + i := (*lp)["I"].(uint64) + return mapstructure.Decode(f.latest[i-1], returnVal) } -func (f *fakeCodecServer) Decode(_ context.Context, raw []byte, into any, itemType string) error { - switch itemType { - case TestItemType, TestItemSliceType, TestItemArray2Type, TestItemArray1Type: - return mapstructure.Decode(f.lastItem, into) - } - return types.InvalidTypeError{} -} - -func (f *fakeCodecServer) CreateType(itemType string, isEncode bool) (any, error) { - switch itemType { - case TestItemType: - return &TestStruct{}, nil - case TestItemSliceType: - return &[]TestStruct{}, nil - case TestItemArray2Type: - return &[2]TestStruct{}, nil - case TestItemArray1Type: - return &[1]TestStruct{}, nil - case MethodTakingLatestParamsReturningTestStruct: - if isEncode { - return &LatestParams{}, nil - } - return &TestStruct{}, nil - case MethodReturningUint64: - tmp := uint64(0) - return &tmp, nil - case MethodReturningUint64Slice: - var tmp []uint64 - return &tmp, nil - } - - return nil, types.InvalidTypeError{} -} - -var _ types.RemoteCodec = &fakeCodecServer{} - type errorServer struct { err error pb.UnimplementedChainReaderServer @@ -325,18 +207,6 @@ func (e *errorServer) GetLatestValue(context.Context, *pb.GetLatestValueRequest) return nil, e.err } -func (e *errorServer) GetEncoding(context.Context, *pb.GetEncodingRequest) (*pb.GetEncodingResponse, error) { - return nil, e.err -} - -func (e *errorServer) GetDecoding(context.Context, *pb.GetDecodingRequest) (*pb.GetDecodingResponse, error) { - return nil, e.err -} - -func (e *errorServer) GetMaxSize(context.Context, *pb.GetMaxSizeRequest) (*pb.GetMaxSizeResponse, error) { - return nil, e.err -} - func connFromLis(t *testing.T, lis *bufconn.Listener) *grpc.ClientConn { conn, err := grpc.Dial("bufnet", grpc.WithContextDialer(func(context.Context, string) (net.Conn, error) { return lis.Dial() }), diff --git a/pkg/loop/internal/pb/relayer.pb.go b/pkg/loop/internal/pb/relayer.pb.go index 7ac18001a..addb6135b 100644 --- a/pkg/loop/internal/pb/relayer.pb.go +++ b/pkg/loop/internal/pb/relayer.pb.go @@ -2313,320 +2313,6 @@ func (x *GetLatestValueReply) GetRetVal() *VersionedBytes { return nil } -type GetEncodingRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Params *VersionedBytes `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - ItemType string `protobuf:"bytes,2,opt,name=itemType,proto3" json:"itemType,omitempty"` -} - -func (x *GetEncodingRequest) Reset() { - *x = GetEncodingRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetEncodingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEncodingRequest) ProtoMessage() {} - -func (x *GetEncodingRequest) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetEncodingRequest.ProtoReflect.Descriptor instead. -func (*GetEncodingRequest) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{43} -} - -func (x *GetEncodingRequest) GetParams() *VersionedBytes { - if x != nil { - return x.Params - } - return nil -} - -func (x *GetEncodingRequest) GetItemType() string { - if x != nil { - return x.ItemType - } - return "" -} - -type GetEncodingResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RetVal []byte `protobuf:"bytes,1,opt,name=retVal,proto3" json:"retVal,omitempty"` -} - -func (x *GetEncodingResponse) Reset() { - *x = GetEncodingResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetEncodingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEncodingResponse) ProtoMessage() {} - -func (x *GetEncodingResponse) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[44] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetEncodingResponse.ProtoReflect.Descriptor instead. -func (*GetEncodingResponse) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{44} -} - -func (x *GetEncodingResponse) GetRetVal() []byte { - if x != nil { - return x.RetVal - } - return nil -} - -type GetDecodingRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Encoded []byte `protobuf:"bytes,1,opt,name=encoded,proto3" json:"encoded,omitempty"` - ItemType string `protobuf:"bytes,2,opt,name=itemType,proto3" json:"itemType,omitempty"` -} - -func (x *GetDecodingRequest) Reset() { - *x = GetDecodingRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDecodingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDecodingRequest) ProtoMessage() {} - -func (x *GetDecodingRequest) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[45] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDecodingRequest.ProtoReflect.Descriptor instead. -func (*GetDecodingRequest) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{45} -} - -func (x *GetDecodingRequest) GetEncoded() []byte { - if x != nil { - return x.Encoded - } - return nil -} - -func (x *GetDecodingRequest) GetItemType() string { - if x != nil { - return x.ItemType - } - return "" -} - -type GetDecodingResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RetVal *VersionedBytes `protobuf:"bytes,1,opt,name=retVal,proto3" json:"retVal,omitempty"` -} - -func (x *GetDecodingResponse) Reset() { - *x = GetDecodingResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDecodingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDecodingResponse) ProtoMessage() {} - -func (x *GetDecodingResponse) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[46] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDecodingResponse.ProtoReflect.Descriptor instead. -func (*GetDecodingResponse) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{46} -} - -func (x *GetDecodingResponse) GetRetVal() *VersionedBytes { - if x != nil { - return x.RetVal - } - return nil -} - -type GetMaxSizeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - N int32 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"` - ItemType string `protobuf:"bytes,2,opt,name=itemType,proto3" json:"itemType,omitempty"` - ForEncoding bool `protobuf:"varint,3,opt,name=forEncoding,proto3" json:"forEncoding,omitempty"` -} - -func (x *GetMaxSizeRequest) Reset() { - *x = GetMaxSizeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetMaxSizeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMaxSizeRequest) ProtoMessage() {} - -func (x *GetMaxSizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[47] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetMaxSizeRequest.ProtoReflect.Descriptor instead. -func (*GetMaxSizeRequest) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{47} -} - -func (x *GetMaxSizeRequest) GetN() int32 { - if x != nil { - return x.N - } - return 0 -} - -func (x *GetMaxSizeRequest) GetItemType() string { - if x != nil { - return x.ItemType - } - return "" -} - -func (x *GetMaxSizeRequest) GetForEncoding() bool { - if x != nil { - return x.ForEncoding - } - return false -} - -type GetMaxSizeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SizeInBytes int32 `protobuf:"varint,1,opt,name=sizeInBytes,proto3" json:"sizeInBytes,omitempty"` -} - -func (x *GetMaxSizeResponse) Reset() { - *x = GetMaxSizeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetMaxSizeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMaxSizeResponse) ProtoMessage() {} - -func (x *GetMaxSizeResponse) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[48] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetMaxSizeResponse.ProtoReflect.Descriptor instead. -func (*GetMaxSizeResponse) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{48} -} - -func (x *GetMaxSizeResponse) GetSizeInBytes() int32 { - if x != nil { - return x.SizeInBytes - } - return 0 -} - // BoundContract represents a [github.com/smartcontractkit/chainlink-relay/pkg/types.BoundContract]. type BoundContract struct { state protoimpl.MessageState @@ -2641,7 +2327,7 @@ type BoundContract struct { func (x *BoundContract) Reset() { *x = BoundContract{} if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[49] + mi := &file_relayer_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2654,7 +2340,7 @@ func (x *BoundContract) String() string { func (*BoundContract) ProtoMessage() {} func (x *BoundContract) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[49] + mi := &file_relayer_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2667,7 +2353,7 @@ func (x *BoundContract) ProtoReflect() protoreflect.Message { // Deprecated: Use BoundContract.ProtoReflect.Descriptor instead. func (*BoundContract) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{49} + return file_relayer_proto_rawDescGZIP(), []int{43} } func (x *BoundContract) GetAddress() string { @@ -2703,7 +2389,7 @@ type NameReply struct { func (x *NameReply) Reset() { *x = NameReply{} if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[50] + mi := &file_relayer_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2716,7 +2402,7 @@ func (x *NameReply) String() string { func (*NameReply) ProtoMessage() {} func (x *NameReply) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[50] + mi := &file_relayer_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2729,7 +2415,7 @@ func (x *NameReply) ProtoReflect() protoreflect.Message { // Deprecated: Use NameReply.ProtoReflect.Descriptor instead. func (*NameReply) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{50} + return file_relayer_proto_rawDescGZIP(), []int{44} } func (x *NameReply) GetName() string { @@ -2751,7 +2437,7 @@ type HealthReportReply struct { func (x *HealthReportReply) Reset() { *x = HealthReportReply{} if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[51] + mi := &file_relayer_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2764,7 +2450,7 @@ func (x *HealthReportReply) String() string { func (*HealthReportReply) ProtoMessage() {} func (x *HealthReportReply) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[51] + mi := &file_relayer_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2777,7 +2463,7 @@ func (x *HealthReportReply) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthReportReply.ProtoReflect.Descriptor instead. func (*HealthReportReply) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{51} + return file_relayer_proto_rawDescGZIP(), []int{45} } func (x *HealthReportReply) GetHealthReport() map[string]string { @@ -2800,7 +2486,7 @@ type BigInt struct { func (x *BigInt) Reset() { *x = BigInt{} if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[52] + mi := &file_relayer_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2813,7 +2499,7 @@ func (x *BigInt) String() string { func (*BigInt) ProtoMessage() {} func (x *BigInt) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[52] + mi := &file_relayer_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2826,7 +2512,7 @@ func (x *BigInt) ProtoReflect() protoreflect.Message { // Deprecated: Use BigInt.ProtoReflect.Descriptor instead. func (*BigInt) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{52} + return file_relayer_proto_rawDescGZIP(), []int{46} } func (x *BigInt) GetNegative() bool { @@ -2855,7 +2541,7 @@ type StarknetSignature struct { func (x *StarknetSignature) Reset() { *x = StarknetSignature{} if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[53] + mi := &file_relayer_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2868,7 +2554,7 @@ func (x *StarknetSignature) String() string { func (*StarknetSignature) ProtoMessage() {} func (x *StarknetSignature) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[53] + mi := &file_relayer_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2881,7 +2567,7 @@ func (x *StarknetSignature) ProtoReflect() protoreflect.Message { // Deprecated: Use StarknetSignature.ProtoReflect.Descriptor instead. func (*StarknetSignature) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{53} + return file_relayer_proto_rawDescGZIP(), []int{47} } func (x *StarknetSignature) GetX() *BigInt { @@ -2909,7 +2595,7 @@ type StarknetMessageHash struct { func (x *StarknetMessageHash) Reset() { *x = StarknetMessageHash{} if protoimpl.UnsafeEnabled { - mi := &file_relayer_proto_msgTypes[54] + mi := &file_relayer_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2922,7 +2608,7 @@ func (x *StarknetMessageHash) String() string { func (*StarknetMessageHash) ProtoMessage() {} func (x *StarknetMessageHash) ProtoReflect() protoreflect.Message { - mi := &file_relayer_proto_msgTypes[54] + mi := &file_relayer_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2935,7 +2621,7 @@ func (x *StarknetMessageHash) ProtoReflect() protoreflect.Message { // Deprecated: Use StarknetMessageHash.ProtoReflect.Descriptor instead. func (*StarknetMessageHash) Descriptor() ([]byte, []int) { - return file_relayer_proto_rawDescGZIP(), []int{54} + return file_relayer_proto_rawDescGZIP(), []int{48} } func (x *StarknetMessageHash) GetHash() *BigInt { @@ -3172,190 +2858,150 @@ var file_relayer_proto_rawDesc = []byte{ 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x22, 0x5e, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2d, 0x0a, - 0x13, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x22, 0x4a, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x22, 0x43, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, - 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x22, 0x5f, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x6e, - 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x66, 0x6f, 0x72, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x66, 0x6f, 0x72, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x36, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x69, 0x7a, 0x65, 0x49, - 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x57, 0x0a, 0x0d, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x22, - 0x1f, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0xa3, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4d, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3f, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, 0x06, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, - 0x52, 0x01, 0x78, 0x12, 0x1a, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x01, 0x79, 0x22, - 0x37, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, - 0x6e, 0x74, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x32, 0x4f, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x0a, 0x4e, 0x65, 0x77, - 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, - 0x65, 0x77, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x73, 0x0a, 0x08, 0x4b, 0x65, 0x79, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x12, 0x2c, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x11, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x91, - 0x03, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x11, 0x4e, 0x65, - 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, - 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, - 0x53, 0x0a, 0x11, 0x4e, 0x65, 0x77, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x12, 0x50, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, - 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x12, 0x18, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x06, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x22, 0x57, 0x0a, + 0x0d, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x1f, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4d, 0x0a, + 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, + 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3f, 0x0a, 0x11, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, + 0x06, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x53, 0x74, 0x61, + 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1a, + 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x01, 0x78, 0x12, 0x1a, 0x0a, 0x01, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, + 0x49, 0x6e, 0x74, 0x52, 0x01, 0x79, 0x22, 0x37, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x6e, + 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x20, 0x0a, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x32, + 0x4f, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x12, 0x3e, 0x0a, 0x0a, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x17, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, + 0x65, 0x77, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, + 0x32, 0x73, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x39, 0x0a, 0x08, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x00, 0x32, 0x43, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x35, 0x0a, 0x07, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0xb6, 0x01, 0x0a, 0x16, 0x4f, 0x66, 0x66, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x56, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x32, 0x8d, 0x02, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x59, 0x0a, 0x13, 0x4c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x12, 0x20, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0c, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x11, 0x4c, + 0x1a, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, + 0x11, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x91, 0x03, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x12, 0x53, 0x0a, 0x11, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, + 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x65, + 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x11, 0x4e, 0x65, 0x77, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x08, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x32, 0x43, 0x0a, 0x0a, 0x44, 0x61, 0x74, + 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x4f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x12, 0x14, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0xb6, + 0x01, 0x0a, 0x16, 0x4f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x56, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x50, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x8d, 0x02, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, + 0x72, 0x12, 0x59, 0x0a, 0x13, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x20, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0c, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x12, 0x53, 0x0a, 0x11, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x32, 0x82, 0x02, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x1a, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x27, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x82, 0x02, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, + 0x38, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x1a, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x41, + 0x6e, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x27, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x41, 0x6e, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, - 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0b, 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0xa2, 0x02, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, - 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, - 0x00, 0x12, 0x42, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x44, - 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, - 0x4d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, - 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x69, - 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf5, 0x01, 0x0a, 0x07, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x43, 0x6c, 0x6f, - 0x73, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, - 0x41, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, + 0x63, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0b, 0x46, 0x72, 0x6f, + 0x6d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x59, 0x0a, 0x0b, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0xf5, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x48, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, - 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x00, 0x12, 0x39, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0c, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, + 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, + 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3370,7 +3016,7 @@ func file_relayer_proto_rawDescGZIP() []byte { return file_relayer_proto_rawDescData } -var file_relayer_proto_msgTypes = make([]protoimpl.MessageInfo, 56) +var file_relayer_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_relayer_proto_goTypes = []interface{}{ (*NewRelayerRequest)(nil), // 0: loop.NewRelayerRequest (*NewRelayerReply)(nil), // 1: loop.NewRelayerReply @@ -3415,20 +3061,14 @@ var file_relayer_proto_goTypes = []interface{}{ (*VersionedBytes)(nil), // 40: loop.VersionedBytes (*GetLatestValueRequest)(nil), // 41: loop.GetLatestValueRequest (*GetLatestValueReply)(nil), // 42: loop.GetLatestValueReply - (*GetEncodingRequest)(nil), // 43: loop.GetEncodingRequest - (*GetEncodingResponse)(nil), // 44: loop.GetEncodingResponse - (*GetDecodingRequest)(nil), // 45: loop.GetDecodingRequest - (*GetDecodingResponse)(nil), // 46: loop.GetDecodingResponse - (*GetMaxSizeRequest)(nil), // 47: loop.GetMaxSizeRequest - (*GetMaxSizeResponse)(nil), // 48: loop.GetMaxSizeResponse - (*BoundContract)(nil), // 49: loop.BoundContract - (*NameReply)(nil), // 50: loop.NameReply - (*HealthReportReply)(nil), // 51: loop.HealthReportReply - (*BigInt)(nil), // 52: loop.BigInt - (*StarknetSignature)(nil), // 53: loop.StarknetSignature - (*StarknetMessageHash)(nil), // 54: loop.StarknetMessageHash - nil, // 55: loop.HealthReportReply.HealthReportEntry - (*emptypb.Empty)(nil), // 56: google.protobuf.Empty + (*BoundContract)(nil), // 43: loop.BoundContract + (*NameReply)(nil), // 44: loop.NameReply + (*HealthReportReply)(nil), // 45: loop.HealthReportReply + (*BigInt)(nil), // 46: loop.BigInt + (*StarknetSignature)(nil), // 47: loop.StarknetSignature + (*StarknetMessageHash)(nil), // 48: loop.StarknetMessageHash + nil, // 49: loop.HealthReportReply.HealthReportEntry + (*emptypb.Empty)(nil), // 50: google.protobuf.Empty } var file_relayer_proto_depIdxs = []int32{ 5, // 0: loop.NewPluginProviderRequest.relayArgs:type_name -> loop.RelayArgs @@ -3436,78 +3076,70 @@ var file_relayer_proto_depIdxs = []int32{ 5, // 2: loop.NewConfigProviderRequest.relayArgs:type_name -> loop.RelayArgs 13, // 3: loop.GetChainStatusReply.chain:type_name -> loop.ChainStatus 16, // 4: loop.ListNodeStatusesReply.nodes:type_name -> loop.NodeStatus - 52, // 5: loop.TransactionRequest.amount:type_name -> loop.BigInt + 46, // 5: loop.TransactionRequest.amount:type_name -> loop.BigInt 31, // 6: loop.ObserveRequest.reportTimestamp:type_name -> loop.ReportTimestamp - 52, // 7: loop.ObserveReply.value:type_name -> loop.BigInt + 46, // 7: loop.ObserveReply.value:type_name -> loop.BigInt 20, // 8: loop.ConfigDigestRequest.contractConfig:type_name -> loop.ContractConfig 20, // 9: loop.LatestConfigReply.contractConfig:type_name -> loop.ContractConfig 31, // 10: loop.ReportContext.reportTimestamp:type_name -> loop.ReportTimestamp 32, // 11: loop.TransmitRequest.reportContext:type_name -> loop.ReportContext 33, // 12: loop.TransmitRequest.attributedOnchainSignatures:type_name -> loop.AttributedOnchainSignature - 49, // 13: loop.GetLatestValueRequest.bc:type_name -> loop.BoundContract + 43, // 13: loop.GetLatestValueRequest.bc:type_name -> loop.BoundContract 40, // 14: loop.GetLatestValueRequest.params:type_name -> loop.VersionedBytes 40, // 15: loop.GetLatestValueReply.retVal:type_name -> loop.VersionedBytes - 40, // 16: loop.GetEncodingRequest.params:type_name -> loop.VersionedBytes - 40, // 17: loop.GetDecodingResponse.retVal:type_name -> loop.VersionedBytes - 55, // 18: loop.HealthReportReply.healthReport:type_name -> loop.HealthReportReply.HealthReportEntry - 52, // 19: loop.StarknetSignature.x:type_name -> loop.BigInt - 52, // 20: loop.StarknetSignature.y:type_name -> loop.BigInt - 52, // 21: loop.StarknetMessageHash.hash:type_name -> loop.BigInt - 0, // 22: loop.PluginRelayer.NewRelayer:input_type -> loop.NewRelayerRequest - 56, // 23: loop.Keystore.Accounts:input_type -> google.protobuf.Empty - 3, // 24: loop.Keystore.Sign:input_type -> loop.SignRequest - 9, // 25: loop.Relayer.NewConfigProvider:input_type -> loop.NewConfigProviderRequest - 7, // 26: loop.Relayer.NewPluginProvider:input_type -> loop.NewPluginProviderRequest - 11, // 27: loop.Relayer.GetChainStatus:input_type -> loop.GetChainStatusRequest - 14, // 28: loop.Relayer.ListNodeStatuses:input_type -> loop.ListNodeStatusesRequest - 17, // 29: loop.Relayer.Transact:input_type -> loop.TransactionRequest - 18, // 30: loop.DataSource.Observe:input_type -> loop.ObserveRequest - 21, // 31: loop.OffchainConfigDigester.ConfigDigest:input_type -> loop.ConfigDigestRequest - 23, // 32: loop.OffchainConfigDigester.ConfigDigestPrefix:input_type -> loop.ConfigDigestPrefixRequest - 25, // 33: loop.ContractConfigTracker.LatestConfigDetails:input_type -> loop.LatestConfigDetailsRequest - 27, // 34: loop.ContractConfigTracker.LatestConfig:input_type -> loop.LatestConfigRequest - 29, // 35: loop.ContractConfigTracker.LatestBlockHeight:input_type -> loop.LatestBlockHeightRequest - 34, // 36: loop.ContractTransmitter.Transmit:input_type -> loop.TransmitRequest - 36, // 37: loop.ContractTransmitter.LatestConfigDigestAndEpoch:input_type -> loop.LatestConfigDigestAndEpochRequest - 38, // 38: loop.ContractTransmitter.FromAccount:input_type -> loop.FromAccountRequest - 41, // 39: loop.ChainReader.GetLatestValue:input_type -> loop.GetLatestValueRequest - 43, // 40: loop.ChainReader.GetEncoding:input_type -> loop.GetEncodingRequest - 45, // 41: loop.ChainReader.GetDecoding:input_type -> loop.GetDecodingRequest - 47, // 42: loop.ChainReader.GetMaxSize:input_type -> loop.GetMaxSizeRequest - 56, // 43: loop.Service.Name:input_type -> google.protobuf.Empty - 56, // 44: loop.Service.Close:input_type -> google.protobuf.Empty - 56, // 45: loop.Service.Ready:input_type -> google.protobuf.Empty - 56, // 46: loop.Service.HealthReport:input_type -> google.protobuf.Empty - 1, // 47: loop.PluginRelayer.NewRelayer:output_type -> loop.NewRelayerReply - 2, // 48: loop.Keystore.Accounts:output_type -> loop.AccountsReply - 4, // 49: loop.Keystore.Sign:output_type -> loop.SignReply - 10, // 50: loop.Relayer.NewConfigProvider:output_type -> loop.NewConfigProviderReply - 8, // 51: loop.Relayer.NewPluginProvider:output_type -> loop.NewPluginProviderReply - 12, // 52: loop.Relayer.GetChainStatus:output_type -> loop.GetChainStatusReply - 15, // 53: loop.Relayer.ListNodeStatuses:output_type -> loop.ListNodeStatusesReply - 56, // 54: loop.Relayer.Transact:output_type -> google.protobuf.Empty - 19, // 55: loop.DataSource.Observe:output_type -> loop.ObserveReply - 22, // 56: loop.OffchainConfigDigester.ConfigDigest:output_type -> loop.ConfigDigestReply - 24, // 57: loop.OffchainConfigDigester.ConfigDigestPrefix:output_type -> loop.ConfigDigestPrefixReply - 26, // 58: loop.ContractConfigTracker.LatestConfigDetails:output_type -> loop.LatestConfigDetailsReply - 28, // 59: loop.ContractConfigTracker.LatestConfig:output_type -> loop.LatestConfigReply - 30, // 60: loop.ContractConfigTracker.LatestBlockHeight:output_type -> loop.LatestBlockHeightReply - 35, // 61: loop.ContractTransmitter.Transmit:output_type -> loop.TransmitReply - 37, // 62: loop.ContractTransmitter.LatestConfigDigestAndEpoch:output_type -> loop.LatestConfigDigestAndEpochReply - 39, // 63: loop.ContractTransmitter.FromAccount:output_type -> loop.FromAccountReply - 42, // 64: loop.ChainReader.GetLatestValue:output_type -> loop.GetLatestValueReply - 44, // 65: loop.ChainReader.GetEncoding:output_type -> loop.GetEncodingResponse - 46, // 66: loop.ChainReader.GetDecoding:output_type -> loop.GetDecodingResponse - 48, // 67: loop.ChainReader.GetMaxSize:output_type -> loop.GetMaxSizeResponse - 50, // 68: loop.Service.Name:output_type -> loop.NameReply - 56, // 69: loop.Service.Close:output_type -> google.protobuf.Empty - 56, // 70: loop.Service.Ready:output_type -> google.protobuf.Empty - 51, // 71: loop.Service.HealthReport:output_type -> loop.HealthReportReply - 47, // [47:72] is the sub-list for method output_type - 22, // [22:47] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 49, // 16: loop.HealthReportReply.healthReport:type_name -> loop.HealthReportReply.HealthReportEntry + 46, // 17: loop.StarknetSignature.x:type_name -> loop.BigInt + 46, // 18: loop.StarknetSignature.y:type_name -> loop.BigInt + 46, // 19: loop.StarknetMessageHash.hash:type_name -> loop.BigInt + 0, // 20: loop.PluginRelayer.NewRelayer:input_type -> loop.NewRelayerRequest + 50, // 21: loop.Keystore.Accounts:input_type -> google.protobuf.Empty + 3, // 22: loop.Keystore.Sign:input_type -> loop.SignRequest + 9, // 23: loop.Relayer.NewConfigProvider:input_type -> loop.NewConfigProviderRequest + 7, // 24: loop.Relayer.NewPluginProvider:input_type -> loop.NewPluginProviderRequest + 11, // 25: loop.Relayer.GetChainStatus:input_type -> loop.GetChainStatusRequest + 14, // 26: loop.Relayer.ListNodeStatuses:input_type -> loop.ListNodeStatusesRequest + 17, // 27: loop.Relayer.Transact:input_type -> loop.TransactionRequest + 18, // 28: loop.DataSource.Observe:input_type -> loop.ObserveRequest + 21, // 29: loop.OffchainConfigDigester.ConfigDigest:input_type -> loop.ConfigDigestRequest + 23, // 30: loop.OffchainConfigDigester.ConfigDigestPrefix:input_type -> loop.ConfigDigestPrefixRequest + 25, // 31: loop.ContractConfigTracker.LatestConfigDetails:input_type -> loop.LatestConfigDetailsRequest + 27, // 32: loop.ContractConfigTracker.LatestConfig:input_type -> loop.LatestConfigRequest + 29, // 33: loop.ContractConfigTracker.LatestBlockHeight:input_type -> loop.LatestBlockHeightRequest + 34, // 34: loop.ContractTransmitter.Transmit:input_type -> loop.TransmitRequest + 36, // 35: loop.ContractTransmitter.LatestConfigDigestAndEpoch:input_type -> loop.LatestConfigDigestAndEpochRequest + 38, // 36: loop.ContractTransmitter.FromAccount:input_type -> loop.FromAccountRequest + 41, // 37: loop.ChainReader.GetLatestValue:input_type -> loop.GetLatestValueRequest + 50, // 38: loop.Service.Name:input_type -> google.protobuf.Empty + 50, // 39: loop.Service.Close:input_type -> google.protobuf.Empty + 50, // 40: loop.Service.Ready:input_type -> google.protobuf.Empty + 50, // 41: loop.Service.HealthReport:input_type -> google.protobuf.Empty + 1, // 42: loop.PluginRelayer.NewRelayer:output_type -> loop.NewRelayerReply + 2, // 43: loop.Keystore.Accounts:output_type -> loop.AccountsReply + 4, // 44: loop.Keystore.Sign:output_type -> loop.SignReply + 10, // 45: loop.Relayer.NewConfigProvider:output_type -> loop.NewConfigProviderReply + 8, // 46: loop.Relayer.NewPluginProvider:output_type -> loop.NewPluginProviderReply + 12, // 47: loop.Relayer.GetChainStatus:output_type -> loop.GetChainStatusReply + 15, // 48: loop.Relayer.ListNodeStatuses:output_type -> loop.ListNodeStatusesReply + 50, // 49: loop.Relayer.Transact:output_type -> google.protobuf.Empty + 19, // 50: loop.DataSource.Observe:output_type -> loop.ObserveReply + 22, // 51: loop.OffchainConfigDigester.ConfigDigest:output_type -> loop.ConfigDigestReply + 24, // 52: loop.OffchainConfigDigester.ConfigDigestPrefix:output_type -> loop.ConfigDigestPrefixReply + 26, // 53: loop.ContractConfigTracker.LatestConfigDetails:output_type -> loop.LatestConfigDetailsReply + 28, // 54: loop.ContractConfigTracker.LatestConfig:output_type -> loop.LatestConfigReply + 30, // 55: loop.ContractConfigTracker.LatestBlockHeight:output_type -> loop.LatestBlockHeightReply + 35, // 56: loop.ContractTransmitter.Transmit:output_type -> loop.TransmitReply + 37, // 57: loop.ContractTransmitter.LatestConfigDigestAndEpoch:output_type -> loop.LatestConfigDigestAndEpochReply + 39, // 58: loop.ContractTransmitter.FromAccount:output_type -> loop.FromAccountReply + 42, // 59: loop.ChainReader.GetLatestValue:output_type -> loop.GetLatestValueReply + 44, // 60: loop.Service.Name:output_type -> loop.NameReply + 50, // 61: loop.Service.Close:output_type -> google.protobuf.Empty + 50, // 62: loop.Service.Ready:output_type -> google.protobuf.Empty + 45, // 63: loop.Service.HealthReport:output_type -> loop.HealthReportReply + 42, // [42:64] is the sub-list for method output_type + 20, // [20:42] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_relayer_proto_init() } @@ -4033,78 +3665,6 @@ func file_relayer_proto_init() { } } file_relayer_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetEncodingRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relayer_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetEncodingResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relayer_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDecodingRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relayer_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDecodingResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relayer_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMaxSizeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relayer_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMaxSizeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relayer_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BoundContract); i { case 0: return &v.state @@ -4116,7 +3676,7 @@ func file_relayer_proto_init() { return nil } } - file_relayer_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + file_relayer_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NameReply); i { case 0: return &v.state @@ -4128,7 +3688,7 @@ func file_relayer_proto_init() { return nil } } - file_relayer_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + file_relayer_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HealthReportReply); i { case 0: return &v.state @@ -4140,7 +3700,7 @@ func file_relayer_proto_init() { return nil } } - file_relayer_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + file_relayer_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BigInt); i { case 0: return &v.state @@ -4152,7 +3712,7 @@ func file_relayer_proto_init() { return nil } } - file_relayer_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + file_relayer_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StarknetSignature); i { case 0: return &v.state @@ -4164,7 +3724,7 @@ func file_relayer_proto_init() { return nil } } - file_relayer_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + file_relayer_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StarknetMessageHash); i { case 0: return &v.state @@ -4183,7 +3743,7 @@ func file_relayer_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_relayer_proto_rawDesc, NumEnums: 0, - NumMessages: 56, + NumMessages: 50, NumExtensions: 0, NumServices: 9, }, diff --git a/pkg/loop/internal/pb/relayer.proto b/pkg/loop/internal/pb/relayer.proto index 9bcd0105a..fd431ccf5 100644 --- a/pkg/loop/internal/pb/relayer.proto +++ b/pkg/loop/internal/pb/relayer.proto @@ -258,9 +258,6 @@ message FromAccountReply { service ChainReader { rpc GetLatestValue (GetLatestValueRequest) returns (GetLatestValueReply) {} - rpc GetEncoding(GetEncodingRequest) returns (GetEncodingResponse); - rpc GetDecoding(GetDecodingRequest) returns (GetDecodingResponse); - rpc GetMaxSize(GetMaxSizeRequest) returns (GetMaxSizeResponse); } message VersionedBytes { @@ -280,34 +277,6 @@ message GetLatestValueReply { VersionedBytes retVal = 1; } -message GetEncodingRequest { - VersionedBytes params = 1; - string itemType = 2; -} - -message GetEncodingResponse { - bytes retVal = 1; -} - -message GetDecodingRequest { - bytes encoded = 1; - string itemType = 2; -} - -message GetDecodingResponse { - VersionedBytes retVal = 1; -} - -message GetMaxSizeRequest { - int32 n = 1; - string itemType = 2; - bool forEncoding = 3; -} - -message GetMaxSizeResponse { - int32 sizeInBytes = 1; -} - // BoundContract represents a [github.com/smartcontractkit/chainlink-relay/pkg/types.BoundContract]. message BoundContract { string address = 1; diff --git a/pkg/loop/internal/pb/relayer_grpc.pb.go b/pkg/loop/internal/pb/relayer_grpc.pb.go index a0a4ffce1..5c56cf085 100644 --- a/pkg/loop/internal/pb/relayer_grpc.pb.go +++ b/pkg/loop/internal/pb/relayer_grpc.pb.go @@ -1022,9 +1022,6 @@ var ContractTransmitter_ServiceDesc = grpc.ServiceDesc{ const ( ChainReader_GetLatestValue_FullMethodName = "/loop.ChainReader/GetLatestValue" - ChainReader_GetEncoding_FullMethodName = "/loop.ChainReader/GetEncoding" - ChainReader_GetDecoding_FullMethodName = "/loop.ChainReader/GetDecoding" - ChainReader_GetMaxSize_FullMethodName = "/loop.ChainReader/GetMaxSize" ) // ChainReaderClient is the client API for ChainReader service. @@ -1032,9 +1029,6 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ChainReaderClient interface { GetLatestValue(ctx context.Context, in *GetLatestValueRequest, opts ...grpc.CallOption) (*GetLatestValueReply, error) - GetEncoding(ctx context.Context, in *GetEncodingRequest, opts ...grpc.CallOption) (*GetEncodingResponse, error) - GetDecoding(ctx context.Context, in *GetDecodingRequest, opts ...grpc.CallOption) (*GetDecodingResponse, error) - GetMaxSize(ctx context.Context, in *GetMaxSizeRequest, opts ...grpc.CallOption) (*GetMaxSizeResponse, error) } type chainReaderClient struct { @@ -1054,41 +1048,11 @@ func (c *chainReaderClient) GetLatestValue(ctx context.Context, in *GetLatestVal return out, nil } -func (c *chainReaderClient) GetEncoding(ctx context.Context, in *GetEncodingRequest, opts ...grpc.CallOption) (*GetEncodingResponse, error) { - out := new(GetEncodingResponse) - err := c.cc.Invoke(ctx, ChainReader_GetEncoding_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chainReaderClient) GetDecoding(ctx context.Context, in *GetDecodingRequest, opts ...grpc.CallOption) (*GetDecodingResponse, error) { - out := new(GetDecodingResponse) - err := c.cc.Invoke(ctx, ChainReader_GetDecoding_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chainReaderClient) GetMaxSize(ctx context.Context, in *GetMaxSizeRequest, opts ...grpc.CallOption) (*GetMaxSizeResponse, error) { - out := new(GetMaxSizeResponse) - err := c.cc.Invoke(ctx, ChainReader_GetMaxSize_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // ChainReaderServer is the server API for ChainReader service. // All implementations must embed UnimplementedChainReaderServer // for forward compatibility type ChainReaderServer interface { GetLatestValue(context.Context, *GetLatestValueRequest) (*GetLatestValueReply, error) - GetEncoding(context.Context, *GetEncodingRequest) (*GetEncodingResponse, error) - GetDecoding(context.Context, *GetDecodingRequest) (*GetDecodingResponse, error) - GetMaxSize(context.Context, *GetMaxSizeRequest) (*GetMaxSizeResponse, error) mustEmbedUnimplementedChainReaderServer() } @@ -1099,15 +1063,6 @@ type UnimplementedChainReaderServer struct { func (UnimplementedChainReaderServer) GetLatestValue(context.Context, *GetLatestValueRequest) (*GetLatestValueReply, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestValue not implemented") } -func (UnimplementedChainReaderServer) GetEncoding(context.Context, *GetEncodingRequest) (*GetEncodingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetEncoding not implemented") -} -func (UnimplementedChainReaderServer) GetDecoding(context.Context, *GetDecodingRequest) (*GetDecodingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDecoding not implemented") -} -func (UnimplementedChainReaderServer) GetMaxSize(context.Context, *GetMaxSizeRequest) (*GetMaxSizeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMaxSize not implemented") -} func (UnimplementedChainReaderServer) mustEmbedUnimplementedChainReaderServer() {} // UnsafeChainReaderServer may be embedded to opt out of forward compatibility for this service. @@ -1139,60 +1094,6 @@ func _ChainReader_GetLatestValue_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _ChainReader_GetEncoding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetEncodingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChainReaderServer).GetEncoding(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ChainReader_GetEncoding_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChainReaderServer).GetEncoding(ctx, req.(*GetEncodingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ChainReader_GetDecoding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDecodingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChainReaderServer).GetDecoding(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ChainReader_GetDecoding_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChainReaderServer).GetDecoding(ctx, req.(*GetDecodingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ChainReader_GetMaxSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMaxSizeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChainReaderServer).GetMaxSize(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ChainReader_GetMaxSize_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChainReaderServer).GetMaxSize(ctx, req.(*GetMaxSizeRequest)) - } - return interceptor(ctx, in, info, handler) -} - // ChainReader_ServiceDesc is the grpc.ServiceDesc for ChainReader service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1204,18 +1105,6 @@ var ChainReader_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetLatestValue", Handler: _ChainReader_GetLatestValue_Handler, }, - { - MethodName: "GetEncoding", - Handler: _ChainReader_GetEncoding_Handler, - }, - { - MethodName: "GetDecoding", - Handler: _ChainReader_GetDecoding_Handler, - }, - { - MethodName: "GetMaxSize", - Handler: _ChainReader_GetMaxSize_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "relayer.proto", diff --git a/pkg/types/chain_reader.go b/pkg/types/chain_reader.go index 1012be977..750e10283 100644 --- a/pkg/types/chain_reader.go +++ b/pkg/types/chain_reader.go @@ -7,12 +7,6 @@ import ( // Errors exposed to product plugins -type InvalidEncodingError struct{} - -func (InvalidEncodingError) Error() string { - return "cannot decode bytes" -} - type InvalidTypeError struct{} func (InvalidTypeError) Error() string { @@ -25,18 +19,6 @@ func (FieldNotFoundError) Error() string { return "field not found" } -type WrongNumberOfElements struct{} - -func (WrongNumberOfElements) Error() string { - return "wrong number of elements decoded" -} - -type NotASliceError struct{} - -func (NotASliceError) Error() string { - return "input is not a slice or array" -} - // Errors used only by relay plugins type ErrorChainReaderUnsupported struct{} @@ -60,7 +42,6 @@ func (e ErrorChainReaderInvalidConfig) Error() string { type ChainReader interface { // returnVal should satisfy Marshaller interface GetLatestValue(ctx context.Context, bc BoundContract, method string, params, returnVal any) error - Codec } type BoundContract struct { diff --git a/pkg/types/interfacetests/README.md b/pkg/types/interfacetests/README.md deleted file mode 100644 index 677c8eb8d..000000000 --- a/pkg/types/interfacetests/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This folder contains tests for interfaces that should be run by all implementations. - -Note that this kind of testing is normally called *contract testing*, but that term is overloaded in the smartcontractkit repositories to refer to tests for smart contracts. As such, we will be calling it *interface testing*, although that term sometimes refers to a slightly different kind of test, we feel that it accurately represents what we are testing and will cause less confusion overall. \ No newline at end of file diff --git a/pkg/types/interfacetests/chain_reader_interface_tests.go b/pkg/types/interfacetests/chain_reader_interface_tests.go index 7b3acdbd3..1968ec009 100644 --- a/pkg/types/interfacetests/chain_reader_interface_tests.go +++ b/pkg/types/interfacetests/chain_reader_interface_tests.go @@ -11,29 +11,17 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/libocr/commontypes" - ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2/types" "github.com/smartcontractkit/chainlink-relay/pkg/types" ) -type EncodeRequest struct { - TestStructs []TestStruct - ExtraField bool - MissingField bool - TestOn string -} - type ChainReaderInterfaceTester interface { Setup(t *testing.T) Teardown(t *testing.T) Name() string - EncodeFields(t *testing.T, request *EncodeRequest) ocrTypes.Report GetAccountBytes(i int) []byte GetChainReader(t *testing.T) types.ChainReader - // IncludeArrayEncodingSizeEnforcement is here in case there's no way to have fixed arrays in the encoded values - IncludeArrayEncodingSizeEnforcement() bool - // SetLatestValue is expected to return the same bound contract and method in the same test // Any setup required for this should be done in Setup. // The contract should take a LatestParams as the params and return the nth TestStruct set @@ -43,14 +31,7 @@ type ChainReaderInterfaceTester interface { } const ( - TestItemType = "TestItem" - TestItemSliceType = "TestItemSliceType" - TestItemArray1Type = "TestItemArray1Type" - TestItemArray2Type = "TestItemArray2Type" - AnyValueToReadWithoutAnArgument = uint64(3) MethodTakingLatestParamsReturningTestStruct = "GetLatestValues" - MethodReturningUint64 = "GetPrimitiveValue" - MethodReturningUint64Slice = "GetSliceValue" ) var AnySliceToReadWithoutAnArgument = []uint64{3, 4} @@ -59,175 +40,6 @@ var AnySliceToReadWithoutAnArgument = []uint64{3, 4} func RunChainReaderInterfaceTests(t *testing.T, tester ChainReaderInterfaceTester) { ctx := context.Background() tests := map[string]func(t *testing.T){ - "Encodes and decodes a single item": func(t *testing.T) { - item := CreateTestStruct(0, tester.GetAccountBytes) - req := &EncodeRequest{TestStructs: []TestStruct{item}, TestOn: TestItemType} - resp := tester.EncodeFields(t, req) - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, item, TestItemType) - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - into := TestStruct{} - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemType)) - assert.Equal(t, item, into) - }, - "Encodes compatible types": func(t *testing.T) { - item := CreateTestStruct(0, tester.GetAccountBytes) - req := &EncodeRequest{TestStructs: []TestStruct{item}, TestOn: TestItemType} - resp := tester.EncodeFields(t, req) - compatibleItem := compatibleTestStruct{ - Account: item.Account, - Accounts: item.Accounts, - BigField: item.BigField, - DifferentField: item.DifferentField, - Field: item.Field, - NestedStruct: item.NestedStruct, - OracleId: item.OracleId, - OracleIds: item.OracleIds, - } - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, compatibleItem, TestItemType) - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - into := TestStruct{} - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemType)) - assert.Equal(t, item, into) - }, - "Encodes compatible maps": func(t *testing.T) { - item := CreateTestStruct(0, tester.GetAccountBytes) - req := &EncodeRequest{TestStructs: []TestStruct{item}, TestOn: TestItemType} - resp := tester.EncodeFields(t, req) - compatibleMap := map[string]any{ - "Account": item.Account, - "Accounts": item.Accounts, - "BigField": item.BigField, - "DifferentField": item.DifferentField, - "Field": item.Field, - "NestedStruct": map[string]any{ - // since we're testing compatibility, also use slice instead of array - "FixedBytes": item.NestedStruct.FixedBytes[:], - "Inner": map[string]any{ - "I": item.NestedStruct.Inner.I, - "S": item.NestedStruct.Inner.S, - }, - }, - "OracleId": item.OracleId, - "OracleIds": item.OracleIds, - } - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, compatibleMap, TestItemType) - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - into := TestStruct{} - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemType)) - assert.Equal(t, item, into) - }, - "Encodes and decodes a slice": func(t *testing.T) { - item1 := CreateTestStruct(0, tester.GetAccountBytes) - item2 := CreateTestStruct(1, tester.GetAccountBytes) - items := []TestStruct{item1, item2} - req := &EncodeRequest{TestStructs: items, TestOn: TestItemSliceType} - resp := tester.EncodeFields(t, req) - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, items, TestItemSliceType) - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - var into []TestStruct - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemSliceType)) - assert.Equal(t, items, into) - }, - "Encodes and decodes a slices with one element": func(t *testing.T) { - item1 := CreateTestStruct(0, tester.GetAccountBytes) - items := []TestStruct{item1} - req := &EncodeRequest{TestStructs: items, TestOn: TestItemSliceType} - resp := tester.EncodeFields(t, req) - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, items, TestItemSliceType) - - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - var into []TestStruct - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemSliceType)) - assert.Equal(t, items, into) - }, - "Encodes and decodes an array": func(t *testing.T) { - item1 := CreateTestStruct(0, tester.GetAccountBytes) - item2 := CreateTestStruct(1, tester.GetAccountBytes) - items := [2]TestStruct{item1, item2} - req := &EncodeRequest{TestStructs: items[:], TestOn: TestItemArray2Type} - resp := tester.EncodeFields(t, req) - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, items, TestItemArray2Type) - - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - var into [2]TestStruct - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemArray2Type)) - assert.Equal(t, items, into) - }, - "Encodes and decodes an arrays with one element": func(t *testing.T) { - item1 := CreateTestStruct(0, tester.GetAccountBytes) - items := [1]TestStruct{item1} - req := &EncodeRequest{TestStructs: items[:], TestOn: TestItemArray1Type} - resp := tester.EncodeFields(t, req) - - codec := tester.GetChainReader(t) - actualEncoding, err := codec.Encode(ctx, items, TestItemArray1Type) - - require.NoError(t, err) - assert.Equal(t, resp, actualEncoding) - - var into [1]TestStruct - require.NoError(t, codec.Decode(ctx, actualEncoding, &into, TestItemArray1Type)) - assert.Equal(t, items, into) - }, - "Returns an error if type is undefined": func(t *testing.T) { - item := CreateTestStruct(0, tester.GetAccountBytes) - codec := tester.GetChainReader(t) - - _, err := codec.Encode(ctx, item, "NOT"+TestItemType) - assert.IsType(t, types.InvalidTypeError{}, err) - - err = codec.Decode(ctx, []byte(""), item, "NOT"+TestItemType) - assert.IsType(t, types.InvalidTypeError{}, err) - }, - "Returns an error encoding if arrays are the too small to encode": func(t *testing.T) { - if !tester.IncludeArrayEncodingSizeEnforcement() { - return - } - - item1 := CreateTestStruct(0, tester.GetAccountBytes) - items := [1]TestStruct{item1} - codec := tester.GetChainReader(t) - - _, err := codec.Encode(ctx, items, TestItemArray2Type) - assert.IsType(t, types.WrongNumberOfElements{}, err) - }, - "Returns an error encoding if arrays are the too large to encode": func(t *testing.T) { - if !tester.IncludeArrayEncodingSizeEnforcement() { - return - } - - item1 := CreateTestStruct(0, tester.GetAccountBytes) - item2 := CreateTestStruct(1, tester.GetAccountBytes) - items := [2]TestStruct{item1, item2} - codec := tester.GetChainReader(t) - - _, err := codec.Encode(ctx, items, TestItemArray1Type) - assert.IsType(t, types.WrongNumberOfElements{}, err) - }, "Gets the latest value": func(t *testing.T) { firstItem := CreateTestStruct(0, tester.GetAccountBytes) bc := tester.SetLatestValue(ctx, t, &firstItem) @@ -246,100 +58,13 @@ func RunChainReaderInterfaceTests(t *testing.T, tester ChainReaderInterfaceTeste require.NoError(t, cr.GetLatestValue(ctx, bc, MethodTakingLatestParamsReturningTestStruct, params, actual)) assert.Equal(t, &secondItem, actual) }, - "Get latest value without arguments and with primitive return": func(t *testing.T) { - bc := tester.GetPrimitiveContract(ctx, t) - - cr := tester.GetChainReader(t) - - var prim uint64 - require.NoError(t, cr.GetLatestValue(ctx, bc, MethodReturningUint64, nil, &prim)) - - assert.Equal(t, AnyValueToReadWithoutAnArgument, prim) - }, - "Get latest value without arguments and with slice return": func(t *testing.T) { - bc := tester.GetSliceContract(ctx, t) - - cr := tester.GetChainReader(t) - - var slice []uint64 - require.NoError(t, cr.GetLatestValue(ctx, bc, MethodReturningUint64Slice, nil, &slice)) - - assert.Equal(t, AnySliceToReadWithoutAnArgument, slice) - }, - "GetMaxEncodingSize returns errors for unknown types": func(t *testing.T) { - cr := tester.GetChainReader(t) - _, err := cr.GetMaxEncodingSize(ctx, 10, "not"+TestItemType) - assert.IsType(t, types.InvalidTypeError{}, err) - }, - } - - runTests(t, tester, tests) -} - -// RunChainReaderWithStrictArgsInterfaceTest is meant to be used by codecs that don't pad -// They can assure that the right argument size is verified. -// Padding makes that harder/impossible to verify for come codecs. -// However, the extra verification is nice to have when possible. -func RunChainReaderWithStrictArgsInterfaceTest(t *testing.T, tester ChainReaderInterfaceTester) { - ctx := context.Background() - RunChainReaderInterfaceTests(t, tester) - - tests := map[string]func(t *testing.T){ - "Gives an error decoding extra fields on an item": func(t *testing.T) { - item := CreateTestStruct(0, tester.GetAccountBytes) - req := &EncodeRequest{ - TestStructs: []TestStruct{item}, - ExtraField: true, - TestOn: TestItemType, - } - resp := tester.EncodeFields(t, req) - codec := tester.GetChainReader(t) - err := codec.Decode(ctx, resp, &item, TestItemType) - assert.IsType(t, types.InvalidEncodingError{}, err) - }, - "Gives an error decoding missing fields on an item": func(t *testing.T) { - item := CreateTestStruct(0, tester.GetAccountBytes) - req := &EncodeRequest{ - TestStructs: []TestStruct{item}, - MissingField: true, - TestOn: TestItemType, - } - resp := tester.EncodeFields(t, req) - codec := tester.GetChainReader(t) - err := codec.Decode(ctx, resp, &item, TestItemType) - assert.IsType(t, types.InvalidEncodingError{}, err) - }, - "Gives an error decoding extra fields on a slice": func(t *testing.T) { - items := []TestStruct{CreateTestStruct(0, tester.GetAccountBytes)} - req := &EncodeRequest{ - TestStructs: items, - ExtraField: true, - TestOn: TestItemSliceType, - } - resp := tester.EncodeFields(t, req) - codec := tester.GetChainReader(t) - err := codec.Decode(ctx, resp, &items, TestItemSliceType) - assert.IsType(t, types.InvalidEncodingError{}, err) - }, - "Gives an error decoding missing fields on an slice": func(t *testing.T) { - items := []TestStruct{CreateTestStruct(0, tester.GetAccountBytes)} - req := &EncodeRequest{ - TestStructs: items, - MissingField: true, - TestOn: TestItemSliceType, - } - resp := tester.EncodeFields(t, req) - codec := tester.GetChainReader(t) - err := codec.Decode(ctx, resp, &items, TestItemSliceType) - assert.IsType(t, types.InvalidEncodingError{}, err) - }, } runTests(t, tester, tests) } func runTests(t *testing.T, tester ChainReaderInterfaceTester, tests map[string]func(t *testing.T)) { - // Order the tests for consistancy + // Order the tests for consistency testNames := make([]string, 0, len(tests)) for name := range tests { testNames = append(testNames, name) @@ -377,18 +102,6 @@ type TestStruct struct { NestedStruct MidLevelTestStruct } -// compatibleTestStruct has fields in a different order -type compatibleTestStruct struct { - Account []byte - Accounts [][]byte - BigField *big.Int - DifferentField string - Field int32 - NestedStruct MidLevelTestStruct - OracleId commontypes.OracleID - OracleIds [32]commontypes.OracleID -} - type LatestParams struct { I int } diff --git a/pkg/types/map_decoder.go b/pkg/types/map_decoder.go deleted file mode 100644 index f872b200c..000000000 --- a/pkg/types/map_decoder.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -import "context" - -type MapDecoder interface { - DecodeSingle(ctx context.Context, raw []byte, itemType string) (map[string]any, error) - DecodeMany(ctx context.Context, raw []byte, itemType string) ([]map[string]any, error) - // GetMaxDecodingSize returns the max size in bytes if n elements are supplied for all top level dynamically sized elements. - // If no elements are dynamically sized, the returned value will be the same for all n. - // If there are multiple levels of dynamically sized elements, or itemType cannot be found, - // InvalidTypeError will be returned. - GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error) -}