mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
SSZ-QL: Add endpoints (BeaconState/BeaconBlock) (#15888)
* Move ssz_query objects into testing folder (ensuring test objects only used in test environment) * Add containers for response * Export sszInfo * Add QueryBeaconState/Block * Add comments and few refactor * Fix merge conflict issues * Return 500 when calculate offset fails * Add test for QueryBeaconState * Add test for QueryBeaconBlock * Changelog :) * Rename `QuerySSZRequest` to `SSZQueryRequest` * Fix middleware hooks for RPC to accept JSON from client and return SSZ * Convert to `SSZObject` directly from proto * Move marshalling/calculating hash tree root part after `CalculateOffsetAndLength` * Make nogo happy * Add informing comment for using proto unsafe conversion --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -296,3 +296,8 @@ type GetBlobsResponse struct {
|
||||
Finalized bool `json:"finalized"`
|
||||
Data []string `json:"data"` //blobs
|
||||
}
|
||||
|
||||
type SSZQueryRequest struct {
|
||||
Query string `json:"query"`
|
||||
IncludeProof bool `json:"include_proof,omitempty"`
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ func (s *Service) endpoints(
|
||||
endpoints = append(endpoints, s.beaconEndpoints(ch, stater, blocker, validatorServer, coreService)...)
|
||||
endpoints = append(endpoints, s.configEndpoints()...)
|
||||
endpoints = append(endpoints, s.eventsEndpoints()...)
|
||||
endpoints = append(endpoints, s.prysmBeaconEndpoints(ch, stater, coreService)...)
|
||||
endpoints = append(endpoints, s.prysmBeaconEndpoints(ch, stater, blocker, coreService)...)
|
||||
endpoints = append(endpoints, s.prysmNodeEndpoints()...)
|
||||
endpoints = append(endpoints, s.prysmValidatorEndpoints(stater, coreService)...)
|
||||
|
||||
@@ -1184,6 +1184,7 @@ func (s *Service) eventsEndpoints() []endpoint {
|
||||
func (s *Service) prysmBeaconEndpoints(
|
||||
ch *stategen.CanonicalHistory,
|
||||
stater lookup.Stater,
|
||||
blocker lookup.Blocker,
|
||||
coreService *core.Service,
|
||||
) []endpoint {
|
||||
server := &beaconprysm.Server{
|
||||
@@ -1194,6 +1195,7 @@ func (s *Service) prysmBeaconEndpoints(
|
||||
CanonicalHistory: ch,
|
||||
BeaconDB: s.cfg.BeaconDB,
|
||||
Stater: stater,
|
||||
Blocker: blocker,
|
||||
ChainInfoFetcher: s.cfg.ChainInfoFetcher,
|
||||
FinalizationFetcher: s.cfg.FinalizationFetcher,
|
||||
CoreService: coreService,
|
||||
@@ -1266,6 +1268,28 @@ func (s *Service) prysmBeaconEndpoints(
|
||||
handler: server.PublishBlobs,
|
||||
methods: []string{http.MethodPost},
|
||||
},
|
||||
{
|
||||
template: "/prysm/v1/beacon/states/{state_id}/query",
|
||||
name: namespace + ".QueryBeaconState",
|
||||
middleware: []middleware.Middleware{
|
||||
middleware.ContentTypeHandler([]string{api.JsonMediaType}),
|
||||
middleware.AcceptHeaderHandler([]string{api.OctetStreamMediaType}),
|
||||
middleware.AcceptEncodingHeaderHandler(),
|
||||
},
|
||||
handler: server.QueryBeaconState,
|
||||
methods: []string{http.MethodPost},
|
||||
},
|
||||
{
|
||||
template: "/prysm/v1/beacon/blocks/{block_id}/query",
|
||||
name: namespace + ".QueryBeaconBlock",
|
||||
middleware: []middleware.Middleware{
|
||||
middleware.ContentTypeHandler([]string{api.JsonMediaType}),
|
||||
middleware.AcceptHeaderHandler([]string{api.OctetStreamMediaType}),
|
||||
middleware.AcceptEncodingHeaderHandler(),
|
||||
},
|
||||
handler: server.QueryBeaconBlock,
|
||||
methods: []string{http.MethodPost},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,8 @@ func Test_endpoints(t *testing.T) {
|
||||
"/prysm/v1/beacon/states/{state_id}/validator_count": {http.MethodGet},
|
||||
"/prysm/v1/beacon/chain_head": {http.MethodGet},
|
||||
"/prysm/v1/beacon/blobs": {http.MethodPost},
|
||||
"/prysm/v1/beacon/states/{state_id}/query": {http.MethodPost},
|
||||
"/prysm/v1/beacon/blocks/{block_id}/query": {http.MethodPost},
|
||||
}
|
||||
|
||||
prysmNodeRoutes := map[string][]string{
|
||||
|
||||
@@ -5,11 +5,13 @@ go_library(
|
||||
srcs = [
|
||||
"handlers.go",
|
||||
"server.go",
|
||||
"ssz_query.go",
|
||||
"validator_count.go",
|
||||
],
|
||||
importpath = "github.com/OffchainLabs/prysm/v6/beacon-chain/rpc/prysm/beacon",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//api:go_default_library",
|
||||
"//api/server/structs:go_default_library",
|
||||
"//beacon-chain/blockchain:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
@@ -27,10 +29,13 @@ go_library(
|
||||
"//consensus-types/primitives:go_default_library",
|
||||
"//consensus-types/validator:go_default_library",
|
||||
"//encoding/bytesutil:go_default_library",
|
||||
"//encoding/ssz/query:go_default_library",
|
||||
"//monitoring/tracing/trace:go_default_library",
|
||||
"//network/httputil:go_default_library",
|
||||
"//proto/eth/v1:go_default_library",
|
||||
"//proto/prysm/v1alpha1:go_default_library",
|
||||
"//proto/ssz_query:go_default_library",
|
||||
"//runtime/version:go_default_library",
|
||||
"//time/slots:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
@@ -41,10 +46,12 @@ go_test(
|
||||
name = "go_default_test",
|
||||
srcs = [
|
||||
"handlers_test.go",
|
||||
"ssz_query_test.go",
|
||||
"validator_count_test.go",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//api:go_default_library",
|
||||
"//api/server/structs:go_default_library",
|
||||
"//beacon-chain/blockchain/testing:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
@@ -63,10 +70,13 @@ go_test(
|
||||
"//config/fieldparams:go_default_library",
|
||||
"//config/params:go_default_library",
|
||||
"//consensus-types/blocks:go_default_library",
|
||||
"//consensus-types/interfaces:go_default_library",
|
||||
"//consensus-types/primitives:go_default_library",
|
||||
"//encoding/bytesutil:go_default_library",
|
||||
"//network/httputil:go_default_library",
|
||||
"//proto/prysm/v1alpha1:go_default_library",
|
||||
"//proto/ssz_query:go_default_library",
|
||||
"//runtime/version:go_default_library",
|
||||
"//testing/assert:go_default_library",
|
||||
"//testing/require:go_default_library",
|
||||
"//testing/util:go_default_library",
|
||||
|
||||
@@ -18,6 +18,7 @@ type Server struct {
|
||||
CanonicalHistory *stategen.CanonicalHistory
|
||||
BeaconDB beacondb.ReadOnlyDatabase
|
||||
Stater lookup.Stater
|
||||
Blocker lookup.Blocker
|
||||
ChainInfoFetcher blockchain.ChainInfoFetcher
|
||||
FinalizationFetcher blockchain.FinalizationFetcher
|
||||
CoreService *core.Service
|
||||
|
||||
202
beacon-chain/rpc/prysm/beacon/ssz_query.go
Normal file
202
beacon-chain/rpc/prysm/beacon/ssz_query.go
Normal file
@@ -0,0 +1,202 @@
|
||||
package beacon
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/OffchainLabs/prysm/v6/api"
|
||||
"github.com/OffchainLabs/prysm/v6/api/server/structs"
|
||||
"github.com/OffchainLabs/prysm/v6/beacon-chain/rpc/eth/shared"
|
||||
"github.com/OffchainLabs/prysm/v6/beacon-chain/rpc/lookup"
|
||||
"github.com/OffchainLabs/prysm/v6/encoding/ssz/query"
|
||||
"github.com/OffchainLabs/prysm/v6/monitoring/tracing/trace"
|
||||
"github.com/OffchainLabs/prysm/v6/network/httputil"
|
||||
sszquerypb "github.com/OffchainLabs/prysm/v6/proto/ssz_query"
|
||||
"github.com/OffchainLabs/prysm/v6/runtime/version"
|
||||
)
|
||||
|
||||
// QueryBeaconState handles SSZ Query request for BeaconState.
|
||||
// Returns as bytes serialized SSZQueryResponse.
|
||||
func (s *Server) QueryBeaconState(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, span := trace.StartSpan(r.Context(), "beacon.QueryBeaconState")
|
||||
defer span.End()
|
||||
|
||||
stateID := r.PathValue("state_id")
|
||||
if stateID == "" {
|
||||
httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// Validate path before lookup: it might be expensive.
|
||||
var req structs.SSZQueryRequest
|
||||
err := json.NewDecoder(r.Body).Decode(&req)
|
||||
switch {
|
||||
case errors.Is(err, io.EOF):
|
||||
httputil.HandleError(w, "No data submitted", http.StatusBadRequest)
|
||||
return
|
||||
case err != nil:
|
||||
httputil.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
if len(req.Query) == 0 {
|
||||
httputil.HandleError(w, "Empty query submitted", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
path, err := query.ParsePath(req.Query)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not parse path '"+req.Query+"': "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
stateRoot, err := s.Stater.StateRoot(ctx, []byte(stateID))
|
||||
if err != nil {
|
||||
var rootNotFoundErr *lookup.StateRootNotFoundError
|
||||
if errors.As(err, &rootNotFoundErr) {
|
||||
httputil.HandleError(w, "State root not found: "+rootNotFoundErr.Error(), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
httputil.HandleError(w, "Could not get state root: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
st, err := s.Stater.State(ctx, []byte(stateID))
|
||||
if err != nil {
|
||||
shared.WriteStateFetchError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
// NOTE: Using unsafe conversion to proto is acceptable here,
|
||||
// as we play with a copy of the state returned by Stater.
|
||||
sszObject, ok := st.ToProtoUnsafe().(query.SSZObject)
|
||||
if !ok {
|
||||
httputil.HandleError(w, "Unsupported state version for querying: "+version.String(st.Version()), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
info, err := query.AnalyzeObject(sszObject)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not analyze state object: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
_, offset, length, err := query.CalculateOffsetAndLength(info, path)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not calculate offset and length for path '"+req.Query+"': "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
encodedState, err := st.MarshalSSZ()
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not marshal state to SSZ: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
response := &sszquerypb.SSZQueryResponse{
|
||||
Root: stateRoot,
|
||||
Result: encodedState[offset : offset+length],
|
||||
}
|
||||
|
||||
responseSsz, err := response.MarshalSSZ()
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not marshal response to SSZ: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set(api.VersionHeader, version.String(st.Version()))
|
||||
httputil.WriteSsz(w, responseSsz)
|
||||
}
|
||||
|
||||
// QueryBeaconState handles SSZ Query request for BeaconState.
|
||||
// Returns as bytes serialized SSZQueryResponse.
|
||||
func (s *Server) QueryBeaconBlock(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, span := trace.StartSpan(r.Context(), "beacon.QueryBeaconBlock")
|
||||
defer span.End()
|
||||
|
||||
blockId := r.PathValue("block_id")
|
||||
if blockId == "" {
|
||||
httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// Validate path before lookup: it might be expensive.
|
||||
var req structs.SSZQueryRequest
|
||||
err := json.NewDecoder(r.Body).Decode(&req)
|
||||
switch {
|
||||
case errors.Is(err, io.EOF):
|
||||
httputil.HandleError(w, "No data submitted", http.StatusBadRequest)
|
||||
return
|
||||
case err != nil:
|
||||
httputil.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
if len(req.Query) == 0 {
|
||||
httputil.HandleError(w, "Empty query submitted", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
path, err := query.ParsePath(req.Query)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not parse path '"+req.Query+"': "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
signedBlock, err := s.Blocker.Block(ctx, []byte(blockId))
|
||||
if !shared.WriteBlockFetchError(w, signedBlock, err) {
|
||||
return
|
||||
}
|
||||
|
||||
protoBlock, err := signedBlock.Block().Proto()
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not convert block to proto: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
block, ok := protoBlock.(query.SSZObject)
|
||||
if !ok {
|
||||
httputil.HandleError(w, "Unsupported block version for querying: "+version.String(signedBlock.Version()), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
info, err := query.AnalyzeObject(block)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not analyze block object: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
_, offset, length, err := query.CalculateOffsetAndLength(info, path)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not calculate offset and length for path '"+req.Query+"': "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
encodedBlock, err := signedBlock.Block().MarshalSSZ()
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not marshal block to SSZ: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
blockRoot, err := block.HashTreeRoot()
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not compute block root: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
response := &sszquerypb.SSZQueryResponse{
|
||||
Root: blockRoot[:],
|
||||
Result: encodedBlock[offset : offset+length],
|
||||
}
|
||||
|
||||
responseSsz, err := response.MarshalSSZ()
|
||||
if err != nil {
|
||||
httputil.HandleError(w, "Could not marshal response to SSZ: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set(api.VersionHeader, version.String(signedBlock.Version()))
|
||||
httputil.WriteSsz(w, responseSsz)
|
||||
}
|
||||
335
beacon-chain/rpc/prysm/beacon/ssz_query_test.go
Normal file
335
beacon-chain/rpc/prysm/beacon/ssz_query_test.go
Normal file
@@ -0,0 +1,335 @@
|
||||
package beacon
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/OffchainLabs/prysm/v6/api"
|
||||
"github.com/OffchainLabs/prysm/v6/api/server/structs"
|
||||
chainMock "github.com/OffchainLabs/prysm/v6/beacon-chain/blockchain/testing"
|
||||
"github.com/OffchainLabs/prysm/v6/beacon-chain/rpc/testutil"
|
||||
"github.com/OffchainLabs/prysm/v6/consensus-types/blocks"
|
||||
"github.com/OffchainLabs/prysm/v6/consensus-types/interfaces"
|
||||
"github.com/OffchainLabs/prysm/v6/consensus-types/primitives"
|
||||
eth "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
|
||||
sszquerypb "github.com/OffchainLabs/prysm/v6/proto/ssz_query"
|
||||
"github.com/OffchainLabs/prysm/v6/runtime/version"
|
||||
"github.com/OffchainLabs/prysm/v6/testing/assert"
|
||||
"github.com/OffchainLabs/prysm/v6/testing/require"
|
||||
"github.com/OffchainLabs/prysm/v6/testing/util"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/prysmaticlabs/go-bitfield"
|
||||
)
|
||||
|
||||
func TestQueryBeaconState(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
st, _ := util.DeterministicGenesisState(t, 16)
|
||||
require.NoError(t, st.SetSlot(primitives.Slot(42)))
|
||||
stateRoot, err := st.HashTreeRoot(ctx)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, st.UpdateBalancesAtIndex(0, 42000000000))
|
||||
|
||||
tests := []struct {
|
||||
path string
|
||||
expectedValue []byte
|
||||
}{
|
||||
{
|
||||
path: ".slot",
|
||||
expectedValue: func() []byte {
|
||||
slot := st.Slot()
|
||||
result, _ := slot.MarshalSSZ()
|
||||
return result
|
||||
}(),
|
||||
},
|
||||
{
|
||||
path: ".latest_block_header",
|
||||
expectedValue: func() []byte {
|
||||
header := st.LatestBlockHeader()
|
||||
result, _ := header.MarshalSSZ()
|
||||
return result
|
||||
}(),
|
||||
},
|
||||
{
|
||||
path: ".validators",
|
||||
expectedValue: func() []byte {
|
||||
b := make([]byte, 0)
|
||||
validators := st.Validators()
|
||||
for _, v := range validators {
|
||||
vBytes, _ := v.MarshalSSZ()
|
||||
b = append(b, vBytes...)
|
||||
}
|
||||
return b
|
||||
|
||||
}(),
|
||||
},
|
||||
{
|
||||
path: ".validators[0]",
|
||||
expectedValue: func() []byte {
|
||||
v, _ := st.ValidatorAtIndex(0)
|
||||
result, _ := v.MarshalSSZ()
|
||||
return result
|
||||
}(),
|
||||
},
|
||||
{
|
||||
path: ".validators[0].withdrawal_credentials",
|
||||
expectedValue: func() []byte {
|
||||
v, _ := st.ValidatorAtIndex(0)
|
||||
return v.WithdrawalCredentials
|
||||
}(),
|
||||
},
|
||||
{
|
||||
path: ".validators[0].effective_balance",
|
||||
expectedValue: func() []byte {
|
||||
v, _ := st.ValidatorAtIndex(0)
|
||||
b := make([]byte, 8)
|
||||
binary.LittleEndian.PutUint64(b, uint64(v.EffectiveBalance))
|
||||
return b
|
||||
}(),
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.path, func(t *testing.T) {
|
||||
chainService := &chainMock.ChainService{Optimistic: false, FinalizedRoots: make(map[[32]byte]bool)}
|
||||
s := &Server{
|
||||
OptimisticModeFetcher: chainService,
|
||||
FinalizationFetcher: chainService,
|
||||
Stater: &testutil.MockStater{
|
||||
BeaconStateRoot: stateRoot[:],
|
||||
BeaconState: st,
|
||||
},
|
||||
}
|
||||
|
||||
requestBody := &structs.SSZQueryRequest{
|
||||
Query: tt.path,
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
require.NoError(t, json.NewEncoder(&buf).Encode(requestBody))
|
||||
|
||||
request := httptest.NewRequest(http.MethodPost, "http://example.com/prysm/v1/beacon/states/{state_id}/query", &buf)
|
||||
request.SetPathValue("state_id", "head")
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.QueryBeaconState(writer, request)
|
||||
require.Equal(t, http.StatusOK, writer.Code)
|
||||
assert.Equal(t, version.String(version.Phase0), writer.Header().Get(api.VersionHeader))
|
||||
|
||||
expectedResponse := &sszquerypb.SSZQueryResponse{
|
||||
Root: stateRoot[:],
|
||||
Result: tt.expectedValue,
|
||||
}
|
||||
sszExpectedResponse, err := expectedResponse.MarshalSSZ()
|
||||
require.NoError(t, err)
|
||||
assert.DeepEqual(t, sszExpectedResponse, writer.Body.Bytes())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryBeaconStateInvalidRequest(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
st, _ := util.DeterministicGenesisState(t, 16)
|
||||
require.NoError(t, st.SetSlot(primitives.Slot(42)))
|
||||
stateRoot, err := st.HashTreeRoot(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
stateId string
|
||||
path string
|
||||
code int
|
||||
errorString string
|
||||
}{
|
||||
{
|
||||
name: "empty query submitted",
|
||||
stateId: "head",
|
||||
path: "",
|
||||
errorString: "Empty query submitted",
|
||||
},
|
||||
{
|
||||
name: "invalid path",
|
||||
stateId: "head",
|
||||
path: ".invalid[]]",
|
||||
errorString: "Could not parse path",
|
||||
},
|
||||
{
|
||||
name: "non-existent field",
|
||||
stateId: "head",
|
||||
path: ".non_existent_field",
|
||||
code: http.StatusInternalServerError,
|
||||
errorString: "Could not calculate offset and length for path",
|
||||
},
|
||||
{
|
||||
name: "empty state ID",
|
||||
stateId: "",
|
||||
path: "",
|
||||
},
|
||||
{
|
||||
name: "far future slot",
|
||||
stateId: "1000000000000",
|
||||
path: "",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.path, func(t *testing.T) {
|
||||
chainService := &chainMock.ChainService{Optimistic: false, FinalizedRoots: make(map[[32]byte]bool)}
|
||||
s := &Server{
|
||||
OptimisticModeFetcher: chainService,
|
||||
FinalizationFetcher: chainService,
|
||||
Stater: &testutil.MockStater{
|
||||
BeaconStateRoot: stateRoot[:],
|
||||
BeaconState: st,
|
||||
},
|
||||
}
|
||||
|
||||
requestBody := &structs.SSZQueryRequest{
|
||||
Query: tt.path,
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
require.NoError(t, json.NewEncoder(&buf).Encode(requestBody))
|
||||
|
||||
request := httptest.NewRequest(http.MethodPost, "http://example.com/prysm/v1/beacon/states/{state_id}/query", &buf)
|
||||
request.SetPathValue("state_id", tt.stateId)
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.QueryBeaconState(writer, request)
|
||||
|
||||
if tt.code == 0 {
|
||||
tt.code = http.StatusBadRequest
|
||||
}
|
||||
require.Equal(t, tt.code, writer.Code)
|
||||
if tt.errorString != "" {
|
||||
errorString := writer.Body.String()
|
||||
require.Equal(t, true, strings.Contains(errorString, tt.errorString))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryBeaconBlock(t *testing.T) {
|
||||
randaoReveal, err := hexutil.Decode("0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505")
|
||||
require.NoError(t, err)
|
||||
root, err := hexutil.Decode("0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2")
|
||||
require.NoError(t, err)
|
||||
signature, err := hexutil.Decode("0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505")
|
||||
require.NoError(t, err)
|
||||
att := ð.Attestation{
|
||||
AggregationBits: bitfield.Bitlist{0x01},
|
||||
Data: ð.AttestationData{
|
||||
Slot: 1,
|
||||
CommitteeIndex: 1,
|
||||
BeaconBlockRoot: root,
|
||||
Source: ð.Checkpoint{
|
||||
Epoch: 1,
|
||||
Root: root,
|
||||
},
|
||||
Target: ð.Checkpoint{
|
||||
Epoch: 1,
|
||||
Root: root,
|
||||
},
|
||||
},
|
||||
Signature: signature,
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
path string
|
||||
block interfaces.ReadOnlySignedBeaconBlock
|
||||
expectedValue []byte
|
||||
}{
|
||||
{
|
||||
name: "slot",
|
||||
path: ".slot",
|
||||
block: func() interfaces.ReadOnlySignedBeaconBlock {
|
||||
b := util.NewBeaconBlock()
|
||||
b.Block.Slot = 123
|
||||
sb, err := blocks.NewSignedBeaconBlock(b)
|
||||
require.NoError(t, err)
|
||||
return sb
|
||||
}(),
|
||||
expectedValue: func() []byte {
|
||||
b := make([]byte, 8)
|
||||
binary.LittleEndian.PutUint64(b, 123)
|
||||
return b
|
||||
}(),
|
||||
},
|
||||
{
|
||||
name: "randao_reveal",
|
||||
path: ".body.randao_reveal",
|
||||
block: func() interfaces.ReadOnlySignedBeaconBlock {
|
||||
b := util.NewBeaconBlock()
|
||||
b.Block.Body.RandaoReveal = randaoReveal
|
||||
sb, err := blocks.NewSignedBeaconBlock(b)
|
||||
require.NoError(t, err)
|
||||
return sb
|
||||
}(),
|
||||
expectedValue: randaoReveal,
|
||||
},
|
||||
{
|
||||
name: "attestations",
|
||||
path: ".body.attestations",
|
||||
block: func() interfaces.ReadOnlySignedBeaconBlock {
|
||||
b := util.NewBeaconBlock()
|
||||
b.Block.Body.Attestations = []*eth.Attestation{
|
||||
att,
|
||||
}
|
||||
sb, err := blocks.NewSignedBeaconBlock(b)
|
||||
require.NoError(t, err)
|
||||
return sb
|
||||
}(),
|
||||
expectedValue: func() []byte {
|
||||
b, err := att.MarshalSSZ()
|
||||
require.NoError(t, err)
|
||||
return b
|
||||
}(),
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockBlockFetcher := &testutil.MockBlocker{BlockToReturn: tt.block}
|
||||
mockChainService := &chainMock.ChainService{
|
||||
FinalizedRoots: map[[32]byte]bool{},
|
||||
}
|
||||
s := &Server{
|
||||
FinalizationFetcher: mockChainService,
|
||||
Blocker: mockBlockFetcher,
|
||||
}
|
||||
requestBody := &structs.SSZQueryRequest{
|
||||
Query: tt.path,
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
require.NoError(t, json.NewEncoder(&buf).Encode(requestBody))
|
||||
|
||||
request := httptest.NewRequest(http.MethodPost, "http://example.com/prysm/v1/beacon/blocks/{block_id}/query", &buf)
|
||||
request.SetPathValue("block_id", "head")
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.QueryBeaconBlock(writer, request)
|
||||
require.Equal(t, http.StatusOK, writer.Code)
|
||||
assert.Equal(t, version.String(version.Phase0), writer.Header().Get(api.VersionHeader))
|
||||
|
||||
blockRoot, err := tt.block.Block().HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
|
||||
expectedResponse := &sszquerypb.SSZQueryResponse{
|
||||
Root: blockRoot[:],
|
||||
Result: tt.expectedValue,
|
||||
}
|
||||
sszExpectedResponse, err := expectedResponse.MarshalSSZ()
|
||||
require.NoError(t, err)
|
||||
assert.DeepEqual(t, sszExpectedResponse, writer.Body.Bytes())
|
||||
})
|
||||
}
|
||||
}
|
||||
3
changelog/syjn99_ssz-ql-endpoints.md
Normal file
3
changelog/syjn99_ssz-ql-endpoints.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Added
|
||||
|
||||
- SSZ-QL: Add endpoints for `BeaconState`/`BeaconBlock`.
|
||||
@@ -31,7 +31,7 @@ go_test(
|
||||
deps = [
|
||||
":go_default_library",
|
||||
"//encoding/ssz/query/testutil:go_default_library",
|
||||
"//proto/ssz_query:go_default_library",
|
||||
"//proto/ssz_query/testing:go_default_library",
|
||||
"//testing/require:go_default_library",
|
||||
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
||||
],
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
const offsetBytes = 4
|
||||
|
||||
// AnalyzeObject analyzes given object and returns its SSZ information.
|
||||
func AnalyzeObject(obj SSZObject) (*sszInfo, error) {
|
||||
func AnalyzeObject(obj SSZObject) (*SszInfo, error) {
|
||||
value := reflect.ValueOf(obj)
|
||||
|
||||
info, err := analyzeType(value, nil)
|
||||
@@ -28,9 +28,9 @@ func AnalyzeObject(obj SSZObject) (*sszInfo, error) {
|
||||
}
|
||||
|
||||
// PopulateVariableLengthInfo populates runtime information for SSZ fields of variable-sized types.
|
||||
// This function updates the sszInfo structure with actual lengths and offsets that can only
|
||||
// This function updates the SszInfo structure with actual lengths and offsets that can only
|
||||
// be determined at runtime for variable-sized items like Lists and variable-sized Container fields.
|
||||
func PopulateVariableLengthInfo(sszInfo *sszInfo, value reflect.Value) error {
|
||||
func PopulateVariableLengthInfo(sszInfo *SszInfo, value reflect.Value) error {
|
||||
if sszInfo == nil {
|
||||
return errors.New("sszInfo is nil")
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func PopulateVariableLengthInfo(sszInfo *sszInfo, value reflect.Value) error {
|
||||
fieldInfo := containerInfo.fields[fieldName]
|
||||
childSszInfo := fieldInfo.sszInfo
|
||||
if childSszInfo == nil {
|
||||
return fmt.Errorf("sszInfo is nil for field %s", fieldName)
|
||||
return fmt.Errorf("SszInfo is nil for field %s", fieldName)
|
||||
}
|
||||
|
||||
// Skip fixed-size fields.
|
||||
@@ -158,7 +158,7 @@ func PopulateVariableLengthInfo(sszInfo *sszInfo, value reflect.Value) error {
|
||||
}
|
||||
|
||||
// analyzeType is an entry point that inspects a reflect.Value and computes its SSZ layout information.
|
||||
func analyzeType(value reflect.Value, tag *reflect.StructTag) (*sszInfo, error) {
|
||||
func analyzeType(value reflect.Value, tag *reflect.StructTag) (*SszInfo, error) {
|
||||
switch value.Kind() {
|
||||
// Basic types (e.g., uintN where N is 8, 16, 32, 64)
|
||||
// NOTE: uint128 and uint256 are represented as []byte in Go,
|
||||
@@ -182,7 +182,7 @@ func analyzeType(value reflect.Value, tag *reflect.StructTag) (*sszInfo, error)
|
||||
}
|
||||
|
||||
// analyzeBasicType analyzes SSZ basic types (uintN, bool) and returns its info.
|
||||
func analyzeBasicType(value reflect.Value) (*sszInfo, error) {
|
||||
func analyzeBasicType(value reflect.Value) (*SszInfo, error) {
|
||||
var sszType SSZType
|
||||
|
||||
switch value.Kind() {
|
||||
@@ -200,7 +200,7 @@ func analyzeBasicType(value reflect.Value) (*sszInfo, error) {
|
||||
return nil, fmt.Errorf("unsupported basic type %v for SSZ calculation", value.Kind())
|
||||
}
|
||||
|
||||
sszInfo := &sszInfo{
|
||||
sszInfo := &SszInfo{
|
||||
sszType: sszType,
|
||||
typ: value.Type(),
|
||||
|
||||
@@ -212,7 +212,7 @@ func analyzeBasicType(value reflect.Value) (*sszInfo, error) {
|
||||
}
|
||||
|
||||
// analyzeHomogeneousColType analyzes homogeneous collection types (e.g., List, Vector, Bitlist, Bitvector) and returns its SSZ info.
|
||||
func analyzeHomogeneousColType(value reflect.Value, tag *reflect.StructTag) (*sszInfo, error) {
|
||||
func analyzeHomogeneousColType(value reflect.Value, tag *reflect.StructTag) (*SszInfo, error) {
|
||||
if value.Kind() != reflect.Slice {
|
||||
return nil, fmt.Errorf("can only analyze slice types, got %v", value.Kind())
|
||||
}
|
||||
@@ -262,9 +262,9 @@ func analyzeHomogeneousColType(value reflect.Value, tag *reflect.StructTag) (*ss
|
||||
}
|
||||
|
||||
// analyzeListType analyzes SSZ List/Bitlist type and returns its SSZ info.
|
||||
func analyzeListType(value reflect.Value, elementInfo *sszInfo, limit uint64, isBitfield bool) (*sszInfo, error) {
|
||||
func analyzeListType(value reflect.Value, elementInfo *SszInfo, limit uint64, isBitfield bool) (*SszInfo, error) {
|
||||
if isBitfield {
|
||||
return &sszInfo{
|
||||
return &SszInfo{
|
||||
sszType: Bitlist,
|
||||
typ: value.Type(),
|
||||
|
||||
@@ -280,7 +280,7 @@ func analyzeListType(value reflect.Value, elementInfo *sszInfo, limit uint64, is
|
||||
return nil, errors.New("element info is required for List")
|
||||
}
|
||||
|
||||
return &sszInfo{
|
||||
return &SszInfo{
|
||||
sszType: List,
|
||||
typ: value.Type(),
|
||||
|
||||
@@ -294,9 +294,9 @@ func analyzeListType(value reflect.Value, elementInfo *sszInfo, limit uint64, is
|
||||
}
|
||||
|
||||
// analyzeVectorType analyzes SSZ Vector/Bitvector type and returns its SSZ info.
|
||||
func analyzeVectorType(value reflect.Value, elementInfo *sszInfo, length uint64, isBitfield bool) (*sszInfo, error) {
|
||||
func analyzeVectorType(value reflect.Value, elementInfo *SszInfo, length uint64, isBitfield bool) (*SszInfo, error) {
|
||||
if isBitfield {
|
||||
return &sszInfo{
|
||||
return &SszInfo{
|
||||
sszType: Bitvector,
|
||||
typ: value.Type(),
|
||||
|
||||
@@ -318,7 +318,7 @@ func analyzeVectorType(value reflect.Value, elementInfo *sszInfo, length uint64,
|
||||
return nil, fmt.Errorf("vector length must be greater than 0, got %d", length)
|
||||
}
|
||||
|
||||
return &sszInfo{
|
||||
return &SszInfo{
|
||||
sszType: Vector,
|
||||
typ: value.Type(),
|
||||
|
||||
@@ -332,7 +332,7 @@ func analyzeVectorType(value reflect.Value, elementInfo *sszInfo, length uint64,
|
||||
}
|
||||
|
||||
// analyzeContainerType analyzes SSZ Container type and returns its SSZ info.
|
||||
func analyzeContainerType(value reflect.Value) (*sszInfo, error) {
|
||||
func analyzeContainerType(value reflect.Value) (*SszInfo, error) {
|
||||
if value.Kind() != reflect.Struct {
|
||||
return nil, fmt.Errorf("can only analyze struct types, got %v", value.Kind())
|
||||
}
|
||||
@@ -386,7 +386,7 @@ func analyzeContainerType(value reflect.Value) (*sszInfo, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return &sszInfo{
|
||||
return &SszInfo{
|
||||
sszType: Container,
|
||||
typ: containerTyp,
|
||||
source: castToSSZObject(value),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package query
|
||||
|
||||
// containerInfo has
|
||||
// 1. fields: a field map that maps a field's JSON name to its sszInfo for nested Containers
|
||||
// 1. fields: a field map that maps a field's JSON name to its SszInfo for nested Containers
|
||||
// 2. order: a list of field names in the order they should be serialized
|
||||
// 3. fixedOffset: the total size of the fixed part of the container
|
||||
type containerInfo struct {
|
||||
@@ -12,7 +12,7 @@ type containerInfo struct {
|
||||
|
||||
type fieldInfo struct {
|
||||
// sszInfo contains the SSZ information of the field.
|
||||
sszInfo *sszInfo
|
||||
sszInfo *SszInfo
|
||||
// offset is the offset of the field within the parent struct.
|
||||
offset uint64
|
||||
// goFieldName is the name of the field in Go struct.
|
||||
|
||||
@@ -13,7 +13,7 @@ type listInfo struct {
|
||||
// limit is the maximum number of elements in the list.
|
||||
limit uint64
|
||||
// element is the SSZ info of the list's element type.
|
||||
element *sszInfo
|
||||
element *SszInfo
|
||||
// length is the actual number of elements at runtime (0 if not set).
|
||||
length uint64
|
||||
// elementSizes caches each element's byte size for variable-sized type elements
|
||||
@@ -27,7 +27,7 @@ func (l *listInfo) Limit() uint64 {
|
||||
return l.limit
|
||||
}
|
||||
|
||||
func (l *listInfo) Element() (*sszInfo, error) {
|
||||
func (l *listInfo) Element() (*SszInfo, error) {
|
||||
if l == nil {
|
||||
return nil, errors.New("listInfo is nil")
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
)
|
||||
|
||||
// CalculateOffsetAndLength calculates the offset and length of a given path within the SSZ object.
|
||||
// By walking the given path, it accumulates the offsets based on sszInfo.
|
||||
func CalculateOffsetAndLength(sszInfo *sszInfo, path []PathElement) (*sszInfo, uint64, uint64, error) {
|
||||
// By walking the given path, it accumulates the offsets based on SszInfo.
|
||||
func CalculateOffsetAndLength(sszInfo *SszInfo, path []PathElement) (*SszInfo, uint64, uint64, error) {
|
||||
if sszInfo == nil {
|
||||
return nil, 0, 0, errors.New("sszInfo is nil")
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/OffchainLabs/prysm/v6/encoding/ssz/query"
|
||||
"github.com/OffchainLabs/prysm/v6/encoding/ssz/query/testutil"
|
||||
sszquerypb "github.com/OffchainLabs/prysm/v6/proto/ssz_query"
|
||||
sszquerypb "github.com/OffchainLabs/prysm/v6/proto/ssz_query/testing"
|
||||
"github.com/OffchainLabs/prysm/v6/testing/require"
|
||||
"github.com/prysmaticlabs/go-bitfield"
|
||||
)
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// sszInfo holds the all necessary data for analyzing SSZ data types.
|
||||
type sszInfo struct {
|
||||
// SszInfo holds the all necessary data for analyzing SSZ data types.
|
||||
type SszInfo struct {
|
||||
// Type of the SSZ structure (Basic, Container, List, etc.).
|
||||
sszType SSZType
|
||||
// Type in Go. Need this for unmarshaling.
|
||||
@@ -35,7 +35,7 @@ type sszInfo struct {
|
||||
bitvectorInfo *bitvectorInfo
|
||||
}
|
||||
|
||||
func (info *sszInfo) Size() uint64 {
|
||||
func (info *SszInfo) Size() uint64 {
|
||||
if info == nil {
|
||||
return 0
|
||||
}
|
||||
@@ -72,73 +72,73 @@ func (info *sszInfo) Size() uint64 {
|
||||
}
|
||||
}
|
||||
|
||||
func (info *sszInfo) ContainerInfo() (*containerInfo, error) {
|
||||
func (info *SszInfo) ContainerInfo() (*containerInfo, error) {
|
||||
if info == nil {
|
||||
return nil, errors.New("sszInfo is nil")
|
||||
return nil, errors.New("SszInfo is nil")
|
||||
}
|
||||
|
||||
if info.sszType != Container {
|
||||
return nil, fmt.Errorf("sszInfo is not a Container type, got %s", info.sszType)
|
||||
return nil, fmt.Errorf("SszInfo is not a Container type, got %s", info.sszType)
|
||||
}
|
||||
|
||||
if info.containerInfo == nil {
|
||||
return nil, errors.New("sszInfo.containerInfo is nil")
|
||||
return nil, errors.New("SszInfo.containerInfo is nil")
|
||||
}
|
||||
|
||||
return info.containerInfo, nil
|
||||
}
|
||||
|
||||
func (info *sszInfo) ListInfo() (*listInfo, error) {
|
||||
func (info *SszInfo) ListInfo() (*listInfo, error) {
|
||||
if info == nil {
|
||||
return nil, errors.New("sszInfo is nil")
|
||||
return nil, errors.New("SszInfo is nil")
|
||||
}
|
||||
|
||||
if info.sszType != List {
|
||||
return nil, fmt.Errorf("sszInfo is not a List type, got %s", info.sszType)
|
||||
return nil, fmt.Errorf("SszInfo is not a List type, got %s", info.sszType)
|
||||
}
|
||||
|
||||
return info.listInfo, nil
|
||||
}
|
||||
|
||||
func (info *sszInfo) VectorInfo() (*vectorInfo, error) {
|
||||
func (info *SszInfo) VectorInfo() (*vectorInfo, error) {
|
||||
if info == nil {
|
||||
return nil, errors.New("sszInfo is nil")
|
||||
return nil, errors.New("SszInfo is nil")
|
||||
}
|
||||
|
||||
if info.sszType != Vector {
|
||||
return nil, fmt.Errorf("sszInfo is not a Vector type, got %s", info.sszType)
|
||||
return nil, fmt.Errorf("SszInfo is not a Vector type, got %s", info.sszType)
|
||||
}
|
||||
|
||||
return info.vectorInfo, nil
|
||||
}
|
||||
|
||||
func (info *sszInfo) BitlistInfo() (*bitlistInfo, error) {
|
||||
func (info *SszInfo) BitlistInfo() (*bitlistInfo, error) {
|
||||
if info == nil {
|
||||
return nil, errors.New("sszInfo is nil")
|
||||
return nil, errors.New("SszInfo is nil")
|
||||
}
|
||||
|
||||
if info.sszType != Bitlist {
|
||||
return nil, fmt.Errorf("sszInfo is not a Bitlist type, got %s", info.sszType)
|
||||
return nil, fmt.Errorf("SszInfo is not a Bitlist type, got %s", info.sszType)
|
||||
}
|
||||
|
||||
return info.bitlistInfo, nil
|
||||
}
|
||||
|
||||
func (info *sszInfo) BitvectorInfo() (*bitvectorInfo, error) {
|
||||
func (info *SszInfo) BitvectorInfo() (*bitvectorInfo, error) {
|
||||
if info == nil {
|
||||
return nil, errors.New("sszInfo is nil")
|
||||
return nil, errors.New("SszInfo is nil")
|
||||
}
|
||||
|
||||
if info.sszType != Bitvector {
|
||||
return nil, fmt.Errorf("sszInfo is not a Bitvector type, got %s", info.sszType)
|
||||
return nil, fmt.Errorf("SszInfo is not a Bitvector type, got %s", info.sszType)
|
||||
}
|
||||
|
||||
return info.bitvectorInfo, nil
|
||||
}
|
||||
|
||||
// String implements the Stringer interface for sszInfo.
|
||||
// String implements the Stringer interface for SszInfo.
|
||||
// This follows the notation used in the consensus specs.
|
||||
func (info *sszInfo) String() string {
|
||||
func (info *SszInfo) String() string {
|
||||
if info == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
@@ -163,8 +163,8 @@ func (info *sszInfo) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
// Print returns a string representation of the sszInfo, which is useful for debugging.
|
||||
func (info *sszInfo) Print() string {
|
||||
// Print returns a string representation of the SszInfo, which is useful for debugging.
|
||||
func (info *SszInfo) Print() string {
|
||||
if info == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
@@ -173,7 +173,7 @@ func (info *sszInfo) Print() string {
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
func printRecursive(info *sszInfo, builder *strings.Builder, prefix string) {
|
||||
func printRecursive(info *SszInfo, builder *strings.Builder, prefix string) {
|
||||
var sizeDesc string
|
||||
if info.isVariable {
|
||||
sizeDesc = "Variable-size"
|
||||
|
||||
@@ -9,13 +9,13 @@ type SSZObject interface {
|
||||
|
||||
// HashTreeRoot calls the HashTreeRoot method on the stored interface if it implements SSZObject.
|
||||
// Returns the 32-byte hash tree root or an error if the interface doesn't support hashing.
|
||||
func (info *sszInfo) HashTreeRoot() ([32]byte, error) {
|
||||
func (info *SszInfo) HashTreeRoot() ([32]byte, error) {
|
||||
if info == nil {
|
||||
return [32]byte{}, errors.New("sszInfo is nil")
|
||||
return [32]byte{}, errors.New("SszInfo is nil")
|
||||
}
|
||||
|
||||
if info.source == nil {
|
||||
return [32]byte{}, errors.New("sszInfo.source is nil")
|
||||
return [32]byte{}, errors.New("SszInfo.source is nil")
|
||||
}
|
||||
|
||||
// Check if the value implements the Hashable interface
|
||||
|
||||
@@ -5,7 +5,7 @@ import "errors"
|
||||
// vectorInfo holds information about a SSZ Vector type.
|
||||
type vectorInfo struct {
|
||||
// element is the SSZ info of the vector's element type.
|
||||
element *sszInfo
|
||||
element *SszInfo
|
||||
// length is the fixed length of the vector.
|
||||
length uint64
|
||||
}
|
||||
@@ -18,7 +18,7 @@ func (v *vectorInfo) Length() uint64 {
|
||||
return v.length
|
||||
}
|
||||
|
||||
func (v *vectorInfo) Element() (*sszInfo, error) {
|
||||
func (v *vectorInfo) Element() (*SszInfo, error) {
|
||||
if v == nil {
|
||||
return nil, errors.New("vectorInfo is nil")
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
load("//proto:ssz_proto_library.bzl", "ssz_proto_files")
|
||||
load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
|
||||
|
||||
# gazelle:ignore
|
||||
|
||||
proto_library(
|
||||
name = "proto",
|
||||
srcs = ["ssz_query.proto"],
|
||||
srcs = ["response.proto"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//proto/eth/ext:proto",
|
||||
@@ -25,22 +24,21 @@ go_proto_library(
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//proto/eth/ext:go_default_library",
|
||||
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
|
||||
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# SSZ generation for test proto messages
|
||||
# SSZ generation for proto messages
|
||||
ssz_gen_marshal(
|
||||
name = "ssz_generated",
|
||||
out = "ssz_query.ssz.go",
|
||||
out = "response.ssz.go",
|
||||
go_proto = ":go_proto",
|
||||
objs = [
|
||||
"FixedTestContainer",
|
||||
"FixedNestedContainer",
|
||||
"VariableTestContainer",
|
||||
"SSZQueryProof",
|
||||
"SSZQueryResponse",
|
||||
"SSZQueryResponseWithProof",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -55,16 +53,5 @@ go_library(
|
||||
deps = SSZ_DEPS + [
|
||||
"//proto/eth/ext:go_default_library",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
ssz_proto_files(
|
||||
name = "ssz_proto_files",
|
||||
srcs = ["ssz_query.proto"],
|
||||
config = select({
|
||||
"//conditions:default": "mainnet",
|
||||
"//proto:ssz_mainnet": "mainnet",
|
||||
"//proto:ssz_minimal": "minimal",
|
||||
}),
|
||||
)
|
||||
|
||||
282
proto/ssz_query/response.pb.go
generated
Executable file
282
proto/ssz_query/response.pb.go
generated
Executable file
@@ -0,0 +1,282 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.3
|
||||
// protoc v3.21.7
|
||||
// source: proto/ssz_query/response.proto
|
||||
|
||||
package ssz_query
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
_ "github.com/OffchainLabs/prysm/v6/proto/eth/ext"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type SSZQueryProof struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Leaf []byte `protobuf:"bytes,1,opt,name=leaf,proto3" json:"leaf,omitempty" ssz-size:"32"`
|
||||
Gindex uint64 `protobuf:"varint,2,opt,name=gindex,proto3" json:"gindex,omitempty"`
|
||||
Proofs [][]byte `protobuf:"bytes,3,rep,name=proofs,proto3" json:"proofs,omitempty" ssz-max:"64,?" ssz-size:"?,32"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SSZQueryProof) Reset() {
|
||||
*x = SSZQueryProof{}
|
||||
mi := &file_proto_ssz_query_response_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SSZQueryProof) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SSZQueryProof) ProtoMessage() {}
|
||||
|
||||
func (x *SSZQueryProof) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_response_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SSZQueryProof.ProtoReflect.Descriptor instead.
|
||||
func (*SSZQueryProof) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_response_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SSZQueryProof) GetLeaf() []byte {
|
||||
if x != nil {
|
||||
return x.Leaf
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SSZQueryProof) GetGindex() uint64 {
|
||||
if x != nil {
|
||||
return x.Gindex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSZQueryProof) GetProofs() [][]byte {
|
||||
if x != nil {
|
||||
return x.Proofs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SSZQueryResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Root []byte `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty" ssz-size:"32"`
|
||||
Result []byte `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty" ssz-max:"1073741824"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponse) Reset() {
|
||||
*x = SSZQueryResponse{}
|
||||
mi := &file_proto_ssz_query_response_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SSZQueryResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SSZQueryResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_response_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SSZQueryResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SSZQueryResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_response_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponse) GetRoot() []byte {
|
||||
if x != nil {
|
||||
return x.Root
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponse) GetResult() []byte {
|
||||
if x != nil {
|
||||
return x.Result
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SSZQueryResponseWithProof struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Root []byte `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty" ssz-size:"32"`
|
||||
Result []byte `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty" ssz-max:"1073741824"`
|
||||
Proof *SSZQueryProof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponseWithProof) Reset() {
|
||||
*x = SSZQueryResponseWithProof{}
|
||||
mi := &file_proto_ssz_query_response_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponseWithProof) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SSZQueryResponseWithProof) ProtoMessage() {}
|
||||
|
||||
func (x *SSZQueryResponseWithProof) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_response_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SSZQueryResponseWithProof.ProtoReflect.Descriptor instead.
|
||||
func (*SSZQueryResponseWithProof) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_response_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponseWithProof) GetRoot() []byte {
|
||||
if x != nil {
|
||||
return x.Root
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponseWithProof) GetResult() []byte {
|
||||
if x != nil {
|
||||
return x.Result
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SSZQueryResponseWithProof) GetProof() *SSZQueryProof {
|
||||
if x != nil {
|
||||
return x.Proof
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_proto_ssz_query_response_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_proto_ssz_query_response_proto_rawDesc = []byte{
|
||||
0x0a, 0x1e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x07, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x0d, 0x53, 0x53, 0x5a, 0x51, 0x75, 0x65,
|
||||
0x72, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1a, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x04, 0x6c,
|
||||
0x65, 0x61, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x06, 0x67, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x28, 0x0a, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18,
|
||||
0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x36, 0x34, 0x2c, 0x3f, 0x52, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x6f, 0x66, 0x73, 0x22, 0x56, 0x0a, 0x10, 0x53, 0x53, 0x5a, 0x51, 0x75, 0x65, 0x72,
|
||||
0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x04, 0x72, 0x6f, 0x6f,
|
||||
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0e, 0x92, 0xb5, 0x18, 0x0a, 0x31, 0x30, 0x37, 0x33, 0x37,
|
||||
0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x8d, 0x01,
|
||||
0x0a, 0x19, 0x53, 0x53, 0x5a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1a, 0x0a, 0x04, 0x72,
|
||||
0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33,
|
||||
0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c,
|
||||
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0e, 0x92, 0xb5, 0x18, 0x0a, 0x31, 0x30, 0x37,
|
||||
0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
|
||||
0x2c, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
|
||||
0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x53, 0x5a, 0x51, 0x75, 0x65, 0x72,
|
||||
0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x32, 0x5a,
|
||||
0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x66, 0x66, 0x63,
|
||||
0x68, 0x61, 0x69, 0x6e, 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
|
||||
0x36, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_proto_ssz_query_response_proto_rawDescOnce sync.Once
|
||||
file_proto_ssz_query_response_proto_rawDescData = file_proto_ssz_query_response_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_proto_ssz_query_response_proto_rawDescGZIP() []byte {
|
||||
file_proto_ssz_query_response_proto_rawDescOnce.Do(func() {
|
||||
file_proto_ssz_query_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_ssz_query_response_proto_rawDescData)
|
||||
})
|
||||
return file_proto_ssz_query_response_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_ssz_query_response_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_proto_ssz_query_response_proto_goTypes = []any{
|
||||
(*SSZQueryProof)(nil), // 0: testing.SSZQueryProof
|
||||
(*SSZQueryResponse)(nil), // 1: testing.SSZQueryResponse
|
||||
(*SSZQueryResponseWithProof)(nil), // 2: testing.SSZQueryResponseWithProof
|
||||
}
|
||||
var file_proto_ssz_query_response_proto_depIdxs = []int32{
|
||||
0, // 0: testing.SSZQueryResponseWithProof.proof:type_name -> testing.SSZQueryProof
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_ssz_query_response_proto_init() }
|
||||
func file_proto_ssz_query_response_proto_init() {
|
||||
if File_proto_ssz_query_response_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_ssz_query_response_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_proto_ssz_query_response_proto_goTypes,
|
||||
DependencyIndexes: file_proto_ssz_query_response_proto_depIdxs,
|
||||
MessageInfos: file_proto_ssz_query_response_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_ssz_query_response_proto = out.File
|
||||
file_proto_ssz_query_response_proto_rawDesc = nil
|
||||
file_proto_ssz_query_response_proto_goTypes = nil
|
||||
file_proto_ssz_query_response_proto_depIdxs = nil
|
||||
}
|
||||
27
proto/ssz_query/response.proto
Normal file
27
proto/ssz_query/response.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package testing;
|
||||
|
||||
import "proto/eth/ext/options.proto";
|
||||
|
||||
option go_package = "github.com/OffchainLabs/prysm/v6/proto/ssz_query";
|
||||
|
||||
message SSZQueryProof {
|
||||
bytes leaf = 1 [ (ethereum.eth.ext.ssz_size) = "32" ];
|
||||
uint64 gindex = 2;
|
||||
repeated bytes proofs = 3 [
|
||||
(ethereum.eth.ext.ssz_size) = "?,32",
|
||||
(ethereum.eth.ext.ssz_max) = "64,?"
|
||||
];
|
||||
}
|
||||
|
||||
message SSZQueryResponse {
|
||||
bytes root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ];
|
||||
bytes result = 2 [ (ethereum.eth.ext.ssz_max) = "1073741824" ];
|
||||
}
|
||||
|
||||
message SSZQueryResponseWithProof {
|
||||
bytes root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ];
|
||||
bytes result = 2 [ (ethereum.eth.ext.ssz_max) = "1073741824" ];
|
||||
SSZQueryProof proof = 3;
|
||||
}
|
||||
410
proto/ssz_query/response.ssz.go
Normal file
410
proto/ssz_query/response.ssz.go
Normal file
@@ -0,0 +1,410 @@
|
||||
// Code generated by fastssz. DO NOT EDIT.
|
||||
package ssz_query
|
||||
|
||||
import (
|
||||
ssz "github.com/prysmaticlabs/fastssz"
|
||||
)
|
||||
|
||||
// MarshalSSZ ssz marshals the SSZQueryProof object
|
||||
func (s *SSZQueryProof) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(s)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the SSZQueryProof object to a target array
|
||||
func (s *SSZQueryProof) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
offset := int(44)
|
||||
|
||||
// Field (0) 'Leaf'
|
||||
if size := len(s.Leaf); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Leaf", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Leaf...)
|
||||
|
||||
// Field (1) 'Gindex'
|
||||
dst = ssz.MarshalUint64(dst, s.Gindex)
|
||||
|
||||
// Offset (2) 'Proofs'
|
||||
dst = ssz.WriteOffset(dst, offset)
|
||||
offset += len(s.Proofs) * 32
|
||||
|
||||
// Field (2) 'Proofs'
|
||||
if size := len(s.Proofs); size > 64 {
|
||||
err = ssz.ErrListTooBigFn("--.Proofs", size, 64)
|
||||
return
|
||||
}
|
||||
for ii := 0; ii < len(s.Proofs); ii++ {
|
||||
if size := len(s.Proofs[ii]); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Proofs[ii]", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Proofs[ii]...)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the SSZQueryProof object
|
||||
func (s *SSZQueryProof) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size < 44 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
tail := buf
|
||||
var o2 uint64
|
||||
|
||||
// Field (0) 'Leaf'
|
||||
if cap(s.Leaf) == 0 {
|
||||
s.Leaf = make([]byte, 0, len(buf[0:32]))
|
||||
}
|
||||
s.Leaf = append(s.Leaf, buf[0:32]...)
|
||||
|
||||
// Field (1) 'Gindex'
|
||||
s.Gindex = ssz.UnmarshallUint64(buf[32:40])
|
||||
|
||||
// Offset (2) 'Proofs'
|
||||
if o2 = ssz.ReadOffset(buf[40:44]); o2 > size {
|
||||
return ssz.ErrOffset
|
||||
}
|
||||
|
||||
if o2 != 44 {
|
||||
return ssz.ErrInvalidVariableOffset
|
||||
}
|
||||
|
||||
// Field (2) 'Proofs'
|
||||
{
|
||||
buf = tail[o2:]
|
||||
num, err := ssz.DivideInt2(len(buf), 32, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.Proofs = make([][]byte, num)
|
||||
for ii := 0; ii < num; ii++ {
|
||||
if cap(s.Proofs[ii]) == 0 {
|
||||
s.Proofs[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32]))
|
||||
}
|
||||
s.Proofs[ii] = append(s.Proofs[ii], buf[ii*32:(ii+1)*32]...)
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the SSZQueryProof object
|
||||
func (s *SSZQueryProof) SizeSSZ() (size int) {
|
||||
size = 44
|
||||
|
||||
// Field (2) 'Proofs'
|
||||
size += len(s.Proofs) * 32
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the SSZQueryProof object
|
||||
func (s *SSZQueryProof) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(s)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the SSZQueryProof object with a hasher
|
||||
func (s *SSZQueryProof) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'Leaf'
|
||||
if size := len(s.Leaf); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Leaf", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.Leaf)
|
||||
|
||||
// Field (1) 'Gindex'
|
||||
hh.PutUint64(s.Gindex)
|
||||
|
||||
// Field (2) 'Proofs'
|
||||
{
|
||||
if size := len(s.Proofs); size > 64 {
|
||||
err = ssz.ErrListTooBigFn("--.Proofs", size, 64)
|
||||
return
|
||||
}
|
||||
subIndx := hh.Index()
|
||||
for _, i := range s.Proofs {
|
||||
if len(i) != 32 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
hh.Append(i)
|
||||
}
|
||||
|
||||
numItems := uint64(len(s.Proofs))
|
||||
hh.MerkleizeWithMixin(subIndx, numItems, 64)
|
||||
}
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the SSZQueryResponse object
|
||||
func (s *SSZQueryResponse) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(s)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the SSZQueryResponse object to a target array
|
||||
func (s *SSZQueryResponse) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
offset := int(36)
|
||||
|
||||
// Field (0) 'Root'
|
||||
if size := len(s.Root); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Root", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Root...)
|
||||
|
||||
// Offset (1) 'Result'
|
||||
dst = ssz.WriteOffset(dst, offset)
|
||||
offset += len(s.Result)
|
||||
|
||||
// Field (1) 'Result'
|
||||
if size := len(s.Result); size > 1073741824 {
|
||||
err = ssz.ErrBytesLengthFn("--.Result", size, 1073741824)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Result...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the SSZQueryResponse object
|
||||
func (s *SSZQueryResponse) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size < 36 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
tail := buf
|
||||
var o1 uint64
|
||||
|
||||
// Field (0) 'Root'
|
||||
if cap(s.Root) == 0 {
|
||||
s.Root = make([]byte, 0, len(buf[0:32]))
|
||||
}
|
||||
s.Root = append(s.Root, buf[0:32]...)
|
||||
|
||||
// Offset (1) 'Result'
|
||||
if o1 = ssz.ReadOffset(buf[32:36]); o1 > size {
|
||||
return ssz.ErrOffset
|
||||
}
|
||||
|
||||
if o1 != 36 {
|
||||
return ssz.ErrInvalidVariableOffset
|
||||
}
|
||||
|
||||
// Field (1) 'Result'
|
||||
{
|
||||
buf = tail[o1:]
|
||||
if len(buf) > 1073741824 {
|
||||
return ssz.ErrBytesLength
|
||||
}
|
||||
if cap(s.Result) == 0 {
|
||||
s.Result = make([]byte, 0, len(buf))
|
||||
}
|
||||
s.Result = append(s.Result, buf...)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the SSZQueryResponse object
|
||||
func (s *SSZQueryResponse) SizeSSZ() (size int) {
|
||||
size = 36
|
||||
|
||||
// Field (1) 'Result'
|
||||
size += len(s.Result)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the SSZQueryResponse object
|
||||
func (s *SSZQueryResponse) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(s)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the SSZQueryResponse object with a hasher
|
||||
func (s *SSZQueryResponse) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'Root'
|
||||
if size := len(s.Root); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Root", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.Root)
|
||||
|
||||
// Field (1) 'Result'
|
||||
{
|
||||
elemIndx := hh.Index()
|
||||
byteLen := uint64(len(s.Result))
|
||||
if byteLen > 1073741824 {
|
||||
err = ssz.ErrIncorrectListSize
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.Result)
|
||||
hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32)
|
||||
}
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the SSZQueryResponseWithProof object
|
||||
func (s *SSZQueryResponseWithProof) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(s)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the SSZQueryResponseWithProof object to a target array
|
||||
func (s *SSZQueryResponseWithProof) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
offset := int(40)
|
||||
|
||||
// Field (0) 'Root'
|
||||
if size := len(s.Root); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Root", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Root...)
|
||||
|
||||
// Offset (1) 'Result'
|
||||
dst = ssz.WriteOffset(dst, offset)
|
||||
offset += len(s.Result)
|
||||
|
||||
// Offset (2) 'Proof'
|
||||
dst = ssz.WriteOffset(dst, offset)
|
||||
if s.Proof == nil {
|
||||
s.Proof = new(SSZQueryProof)
|
||||
}
|
||||
offset += s.Proof.SizeSSZ()
|
||||
|
||||
// Field (1) 'Result'
|
||||
if size := len(s.Result); size > 1073741824 {
|
||||
err = ssz.ErrBytesLengthFn("--.Result", size, 1073741824)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Result...)
|
||||
|
||||
// Field (2) 'Proof'
|
||||
if dst, err = s.Proof.MarshalSSZTo(dst); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the SSZQueryResponseWithProof object
|
||||
func (s *SSZQueryResponseWithProof) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size < 40 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
tail := buf
|
||||
var o1, o2 uint64
|
||||
|
||||
// Field (0) 'Root'
|
||||
if cap(s.Root) == 0 {
|
||||
s.Root = make([]byte, 0, len(buf[0:32]))
|
||||
}
|
||||
s.Root = append(s.Root, buf[0:32]...)
|
||||
|
||||
// Offset (1) 'Result'
|
||||
if o1 = ssz.ReadOffset(buf[32:36]); o1 > size {
|
||||
return ssz.ErrOffset
|
||||
}
|
||||
|
||||
if o1 != 40 {
|
||||
return ssz.ErrInvalidVariableOffset
|
||||
}
|
||||
|
||||
// Offset (2) 'Proof'
|
||||
if o2 = ssz.ReadOffset(buf[36:40]); o2 > size || o1 > o2 {
|
||||
return ssz.ErrOffset
|
||||
}
|
||||
|
||||
// Field (1) 'Result'
|
||||
{
|
||||
buf = tail[o1:o2]
|
||||
if len(buf) > 1073741824 {
|
||||
return ssz.ErrBytesLength
|
||||
}
|
||||
if cap(s.Result) == 0 {
|
||||
s.Result = make([]byte, 0, len(buf))
|
||||
}
|
||||
s.Result = append(s.Result, buf...)
|
||||
}
|
||||
|
||||
// Field (2) 'Proof'
|
||||
{
|
||||
buf = tail[o2:]
|
||||
if s.Proof == nil {
|
||||
s.Proof = new(SSZQueryProof)
|
||||
}
|
||||
if err = s.Proof.UnmarshalSSZ(buf); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the SSZQueryResponseWithProof object
|
||||
func (s *SSZQueryResponseWithProof) SizeSSZ() (size int) {
|
||||
size = 40
|
||||
|
||||
// Field (1) 'Result'
|
||||
size += len(s.Result)
|
||||
|
||||
// Field (2) 'Proof'
|
||||
if s.Proof == nil {
|
||||
s.Proof = new(SSZQueryProof)
|
||||
}
|
||||
size += s.Proof.SizeSSZ()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the SSZQueryResponseWithProof object
|
||||
func (s *SSZQueryResponseWithProof) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(s)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the SSZQueryResponseWithProof object with a hasher
|
||||
func (s *SSZQueryResponseWithProof) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'Root'
|
||||
if size := len(s.Root); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.Root", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.Root)
|
||||
|
||||
// Field (1) 'Result'
|
||||
{
|
||||
elemIndx := hh.Index()
|
||||
byteLen := uint64(len(s.Result))
|
||||
if byteLen > 1073741824 {
|
||||
err = ssz.ErrIncorrectListSize
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.Result)
|
||||
hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32)
|
||||
}
|
||||
|
||||
// Field (2) 'Proof'
|
||||
if err = s.Proof.HashTreeRootWith(hh); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
70
proto/ssz_query/testing/BUILD.bazel
Normal file
70
proto/ssz_query/testing/BUILD.bazel
Normal file
@@ -0,0 +1,70 @@
|
||||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
load("//proto:ssz_proto_library.bzl", "ssz_proto_files")
|
||||
load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
|
||||
|
||||
# gazelle:ignore
|
||||
|
||||
proto_library(
|
||||
name = "proto",
|
||||
srcs = ["test_containers.proto"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//proto/eth/ext:proto",
|
||||
],
|
||||
)
|
||||
|
||||
go_proto_library(
|
||||
name = "go_proto",
|
||||
compilers = [
|
||||
"@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",
|
||||
],
|
||||
importpath = "github.com/OffchainLabs/prysm/v6/proto/ssz_query/testing",
|
||||
proto = ":proto",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//proto/eth/ext:go_default_library",
|
||||
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
|
||||
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# SSZ generation for test proto messages
|
||||
ssz_gen_marshal(
|
||||
name = "ssz_generated",
|
||||
out = "test_containers.ssz.go",
|
||||
go_proto = ":go_proto",
|
||||
objs = [
|
||||
"FixedTestContainer",
|
||||
"FixedNestedContainer",
|
||||
"VariableTestContainer",
|
||||
],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
":ssz_generated", # keep
|
||||
],
|
||||
embed = [":go_proto"],
|
||||
importpath = "github.com/OffchainLabs/prysm/v6/proto/ssz_query/testing",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = SSZ_DEPS + [
|
||||
"//proto/eth/ext:go_default_library",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
ssz_proto_files(
|
||||
name = "ssz_proto_files",
|
||||
srcs = ["test_containers.proto"],
|
||||
config = select({
|
||||
"//conditions:default": "mainnet",
|
||||
"//proto:ssz_mainnet": "mainnet",
|
||||
"//proto:ssz_minimal": "minimal",
|
||||
}),
|
||||
)
|
||||
@@ -2,9 +2,9 @@
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.3
|
||||
// protoc v3.21.7
|
||||
// source: proto/ssz_query/ssz_query.proto
|
||||
// source: proto/ssz_query/testing/test_containers.proto
|
||||
|
||||
package ssz_query
|
||||
package testing
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
@@ -33,7 +33,7 @@ type FixedNestedContainer struct {
|
||||
|
||||
func (x *FixedNestedContainer) Reset() {
|
||||
*x = FixedNestedContainer{}
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[0]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (x *FixedNestedContainer) String() string {
|
||||
func (*FixedNestedContainer) ProtoMessage() {}
|
||||
|
||||
func (x *FixedNestedContainer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[0]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -58,7 +58,7 @@ func (x *FixedNestedContainer) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use FixedNestedContainer.ProtoReflect.Descriptor instead.
|
||||
func (*FixedNestedContainer) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_ssz_query_proto_rawDescGZIP(), []int{0}
|
||||
return file_proto_ssz_query_testing_test_containers_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *FixedNestedContainer) GetValue1() uint64 {
|
||||
@@ -93,7 +93,7 @@ type FixedTestContainer struct {
|
||||
|
||||
func (x *FixedTestContainer) Reset() {
|
||||
*x = FixedTestContainer{}
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[1]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func (x *FixedTestContainer) String() string {
|
||||
func (*FixedTestContainer) ProtoMessage() {}
|
||||
|
||||
func (x *FixedTestContainer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[1]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -118,7 +118,7 @@ func (x *FixedTestContainer) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use FixedTestContainer.ProtoReflect.Descriptor instead.
|
||||
func (*FixedTestContainer) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_ssz_query_proto_rawDescGZIP(), []int{1}
|
||||
return file_proto_ssz_query_testing_test_containers_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *FixedTestContainer) GetFieldUint32() uint32 {
|
||||
@@ -202,7 +202,7 @@ type VariableNestedContainer struct {
|
||||
|
||||
func (x *VariableNestedContainer) Reset() {
|
||||
*x = VariableNestedContainer{}
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[2]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -214,7 +214,7 @@ func (x *VariableNestedContainer) String() string {
|
||||
func (*VariableNestedContainer) ProtoMessage() {}
|
||||
|
||||
func (x *VariableNestedContainer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[2]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -227,7 +227,7 @@ func (x *VariableNestedContainer) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use VariableNestedContainer.ProtoReflect.Descriptor instead.
|
||||
func (*VariableNestedContainer) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_ssz_query_proto_rawDescGZIP(), []int{2}
|
||||
return file_proto_ssz_query_testing_test_containers_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *VariableNestedContainer) GetValue1() uint64 {
|
||||
@@ -261,7 +261,7 @@ type VariableOuterContainer struct {
|
||||
|
||||
func (x *VariableOuterContainer) Reset() {
|
||||
*x = VariableOuterContainer{}
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[3]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -273,7 +273,7 @@ func (x *VariableOuterContainer) String() string {
|
||||
func (*VariableOuterContainer) ProtoMessage() {}
|
||||
|
||||
func (x *VariableOuterContainer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[3]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -286,7 +286,7 @@ func (x *VariableOuterContainer) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use VariableOuterContainer.ProtoReflect.Descriptor instead.
|
||||
func (*VariableOuterContainer) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_ssz_query_proto_rawDescGZIP(), []int{3}
|
||||
return file_proto_ssz_query_testing_test_containers_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *VariableOuterContainer) GetInner_1() *VariableNestedContainer {
|
||||
@@ -320,7 +320,7 @@ type VariableTestContainer struct {
|
||||
|
||||
func (x *VariableTestContainer) Reset() {
|
||||
*x = VariableTestContainer{}
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[4]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -332,7 +332,7 @@ func (x *VariableTestContainer) String() string {
|
||||
func (*VariableTestContainer) ProtoMessage() {}
|
||||
|
||||
func (x *VariableTestContainer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_ssz_query_ssz_query_proto_msgTypes[4]
|
||||
mi := &file_proto_ssz_query_testing_test_containers_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -345,7 +345,7 @@ func (x *VariableTestContainer) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use VariableTestContainer.ProtoReflect.Descriptor instead.
|
||||
func (*VariableTestContainer) Descriptor() ([]byte, []int) {
|
||||
return file_proto_ssz_query_ssz_query_proto_rawDescGZIP(), []int{4}
|
||||
return file_proto_ssz_query_testing_test_containers_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *VariableTestContainer) GetLeadingField() []byte {
|
||||
@@ -411,100 +411,100 @@ func (x *VariableTestContainer) GetTrailingField() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_proto_ssz_query_ssz_query_proto protoreflect.FileDescriptor
|
||||
var File_proto_ssz_query_testing_test_containers_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_proto_ssz_query_ssz_query_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x2f, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x09, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x1b, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x14, 0x46, 0x69, 0x78,
|
||||
0x65, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x12, 0x1e, 0x0a, 0x06, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33,
|
||||
0x32, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0x22, 0xd2, 0x04, 0x0a, 0x12, 0x46, 0x69,
|
||||
0x78, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||
0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x55, 0x69, 0x6e,
|
||||
0x74, 0x33, 0x32, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x75, 0x69, 0x6e,
|
||||
0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
|
||||
0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62,
|
||||
0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
|
||||
0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73,
|
||||
0x33, 0x32, 0x12, 0x37, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46,
|
||||
0x69, 0x78, 0x65, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x52, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x0c, 0x76,
|
||||
0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28,
|
||||
0x04, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x34, 0x52, 0x0b, 0x76, 0x65, 0x63, 0x74, 0x6f,
|
||||
0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x43, 0x0a, 0x19, 0x74, 0x77, 0x6f, 0x5f, 0x64, 0x69,
|
||||
0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35,
|
||||
0x2c, 0x33, 0x32, 0x52, 0x16, 0x74, 0x77, 0x6f, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x66, 0x0a, 0x11, 0x62,
|
||||
0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x39, 0x82, 0xb5, 0x18, 0x30, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63,
|
||||
0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x8a, 0xb5, 0x18, 0x01,
|
||||
0x38, 0x52, 0x10, 0x62, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x46, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x12, 0x6a, 0x0a, 0x12, 0x62, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72,
|
||||
0x35, 0x31, 0x32, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f,
|
||||
0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63,
|
||||
0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, 0x52, 0x11, 0x62, 0x69,
|
||||
0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12,
|
||||
0x2d, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x35, 0x36, 0x52,
|
||||
0x0d, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xa5,
|
||||
0x01, 0x0a, 0x17, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65,
|
||||
0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x31, 0x12, 0x33, 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74,
|
||||
0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x07, 0x92,
|
||||
0xb5, 0x18, 0x03, 0x31, 0x30, 0x30, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x3d, 0x0a, 0x11, 0x6e, 0x65, 0x73, 0x74, 0x65,
|
||||
0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03,
|
||||
0x28, 0x0c, 0x42, 0x11, 0x8a, 0xb5, 0x18, 0x03, 0x3f, 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x06, 0x31,
|
||||
0x30, 0x30, 0x2c, 0x35, 0x30, 0x52, 0x0f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x92, 0x01, 0x0a, 0x16, 0x56, 0x61, 0x72, 0x69, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x12, 0x3b, 0x0a, 0x07, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56,
|
||||
0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e,
|
||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x31, 0x12, 0x3b,
|
||||
0x0a, 0x07, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x22, 0x2e, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x61, 0x72, 0x69,
|
||||
0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x52, 0x06, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x32, 0x22, 0x81, 0x05, 0x0a, 0x15,
|
||||
0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67,
|
||||
0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
|
||||
0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65,
|
||||
0x6c, 0x64, 0x12, 0x34, 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74,
|
||||
0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x92,
|
||||
0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x5a, 0x0a, 0x14, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65,
|
||||
0x72, 0x79, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f,
|
||||
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38,
|
||||
0x52, 0x12, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x12, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6c, 0x69,
|
||||
0x73, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c,
|
||||
0x42, 0x0f, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x30,
|
||||
0x30, 0x52, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x74, 0x65,
|
||||
0x73, 0x33, 0x32, 0x12, 0x3a, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e,
|
||||
0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f,
|
||||
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12,
|
||||
0x61, 0x0a, 0x17, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x21, 0x2e, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x61, 0x72,
|
||||
var file_proto_ssz_query_testing_test_containers_proto_rawDesc = []byte{
|
||||
0x0a, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x07, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
|
||||
0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x14, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x65,
|
||||
0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x31, 0x12, 0x1e, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x06, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x32, 0x22, 0xd0, 0x04, 0x0a, 0x12, 0x46, 0x69, 0x78, 0x65, 0x64, 0x54,
|
||||
0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12,
|
||||
0x21, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x55, 0x69, 0x6e, 0x74,
|
||||
0x36, 0x34, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x6f, 0x6f, 0x6c,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x6f, 0x6f,
|
||||
0x6c, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73,
|
||||
0x33, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32,
|
||||
0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x12, 0x35,
|
||||
0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d,
|
||||
0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x65,
|
||||
0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x6e,
|
||||
0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x0c, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x42, 0x06, 0x8a, 0xb5, 0x18,
|
||||
0x02, 0x32, 0x34, 0x52, 0x0b, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x12, 0x43, 0x0a, 0x19, 0x74, 0x77, 0x6f, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x07, 0x20,
|
||||
0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, 0x2c, 0x33, 0x32, 0x52, 0x16, 0x74,
|
||||
0x77, 0x6f, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73,
|
||||
0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x66, 0x0a, 0x11, 0x62, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74,
|
||||
0x6f, 0x72, 0x36, 0x34, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x42, 0x39, 0x82, 0xb5, 0x18, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67,
|
||||
0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65,
|
||||
0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x38, 0x52, 0x10, 0x62, 0x69, 0x74,
|
||||
0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x6a, 0x0a,
|
||||
0x12, 0x62, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x5f, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61,
|
||||
0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32,
|
||||
0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, 0x52, 0x11, 0x62, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f,
|
||||
0x72, 0x35, 0x31, 0x32, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2d, 0x0a, 0x0e, 0x74, 0x72, 0x61,
|
||||
0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x35, 0x36, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x69, 0x6c,
|
||||
0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x72,
|
||||
0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x12, 0x33, 0x0a, 0x11,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36,
|
||||
0x34, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x30, 0x30,
|
||||
0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x36,
|
||||
0x34, 0x12, 0x3d, 0x0a, 0x11, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74,
|
||||
0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x11, 0x8a, 0xb5,
|
||||
0x18, 0x03, 0x3f, 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x06, 0x31, 0x30, 0x30, 0x2c, 0x35, 0x30, 0x52,
|
||||
0x0f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x22, 0x8e, 0x01, 0x0a, 0x16, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74,
|
||||
0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x07, 0x69,
|
||||
0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e,
|
||||
0x65, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x06,
|
||||
0x69, 0x6e, 0x6e, 0x65, 0x72, 0x31, 0x12, 0x39, 0x0a, 0x07, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f,
|
||||
0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x69, 0x6e, 0x6e, 0x65, 0x72,
|
||||
0x32, 0x22, 0xfb, 0x04, 0x0a, 0x15, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x65,
|
||||
0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x6c,
|
||||
0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x64,
|
||||
0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x34, 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x04, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0f, 0x66,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x58,
|
||||
0x0a, 0x14, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x65, 0x73, 0x74,
|
||||
0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x07, 0x92, 0xb5, 0x18,
|
||||
0x03, 0x31, 0x32, 0x38, 0x52, 0x12, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x43,
|
||||
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x12, 0x66, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x18, 0x04,
|
||||
0x20, 0x03, 0x28, 0x0c, 0x42, 0x0f, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5,
|
||||
0x18, 0x03, 0x31, 0x30, 0x30, 0x52, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x12, 0x38, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65,
|
||||
0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65,
|
||||
0x64, 0x12, 0x5f, 0x0a, 0x17, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f,
|
||||
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x61, 0x72,
|
||||
0x69, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x30, 0x52, 0x15, 0x76, 0x61, 0x72,
|
||||
0x69, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x69,
|
||||
@@ -521,39 +521,40 @@ var file_proto_ssz_query_ssz_query_proto_rawDesc = []byte{
|
||||
0x12, 0x2d, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65,
|
||||
0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x35, 0x36,
|
||||
0x52, 0x0d, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42,
|
||||
0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x66,
|
||||
0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x66,
|
||||
0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
|
||||
0x2f, 0x76, 0x36, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x7a, 0x5f, 0x71, 0x75,
|
||||
0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x65, 0x72, 0x79, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x3b, 0x74, 0x65, 0x73, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_proto_ssz_query_ssz_query_proto_rawDescOnce sync.Once
|
||||
file_proto_ssz_query_ssz_query_proto_rawDescData = file_proto_ssz_query_ssz_query_proto_rawDesc
|
||||
file_proto_ssz_query_testing_test_containers_proto_rawDescOnce sync.Once
|
||||
file_proto_ssz_query_testing_test_containers_proto_rawDescData = file_proto_ssz_query_testing_test_containers_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_proto_ssz_query_ssz_query_proto_rawDescGZIP() []byte {
|
||||
file_proto_ssz_query_ssz_query_proto_rawDescOnce.Do(func() {
|
||||
file_proto_ssz_query_ssz_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_ssz_query_ssz_query_proto_rawDescData)
|
||||
func file_proto_ssz_query_testing_test_containers_proto_rawDescGZIP() []byte {
|
||||
file_proto_ssz_query_testing_test_containers_proto_rawDescOnce.Do(func() {
|
||||
file_proto_ssz_query_testing_test_containers_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_ssz_query_testing_test_containers_proto_rawDescData)
|
||||
})
|
||||
return file_proto_ssz_query_ssz_query_proto_rawDescData
|
||||
return file_proto_ssz_query_testing_test_containers_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_ssz_query_ssz_query_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_proto_ssz_query_ssz_query_proto_goTypes = []any{
|
||||
(*FixedNestedContainer)(nil), // 0: ssz_query.FixedNestedContainer
|
||||
(*FixedTestContainer)(nil), // 1: ssz_query.FixedTestContainer
|
||||
(*VariableNestedContainer)(nil), // 2: ssz_query.VariableNestedContainer
|
||||
(*VariableOuterContainer)(nil), // 3: ssz_query.VariableOuterContainer
|
||||
(*VariableTestContainer)(nil), // 4: ssz_query.VariableTestContainer
|
||||
var file_proto_ssz_query_testing_test_containers_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_proto_ssz_query_testing_test_containers_proto_goTypes = []any{
|
||||
(*FixedNestedContainer)(nil), // 0: testing.FixedNestedContainer
|
||||
(*FixedTestContainer)(nil), // 1: testing.FixedTestContainer
|
||||
(*VariableNestedContainer)(nil), // 2: testing.VariableNestedContainer
|
||||
(*VariableOuterContainer)(nil), // 3: testing.VariableOuterContainer
|
||||
(*VariableTestContainer)(nil), // 4: testing.VariableTestContainer
|
||||
}
|
||||
var file_proto_ssz_query_ssz_query_proto_depIdxs = []int32{
|
||||
0, // 0: ssz_query.FixedTestContainer.nested:type_name -> ssz_query.FixedNestedContainer
|
||||
2, // 1: ssz_query.VariableOuterContainer.inner_1:type_name -> ssz_query.VariableNestedContainer
|
||||
2, // 2: ssz_query.VariableOuterContainer.inner_2:type_name -> ssz_query.VariableNestedContainer
|
||||
0, // 3: ssz_query.VariableTestContainer.field_list_container:type_name -> ssz_query.FixedNestedContainer
|
||||
2, // 4: ssz_query.VariableTestContainer.nested:type_name -> ssz_query.VariableNestedContainer
|
||||
3, // 5: ssz_query.VariableTestContainer.variable_container_list:type_name -> ssz_query.VariableOuterContainer
|
||||
var file_proto_ssz_query_testing_test_containers_proto_depIdxs = []int32{
|
||||
0, // 0: testing.FixedTestContainer.nested:type_name -> testing.FixedNestedContainer
|
||||
2, // 1: testing.VariableOuterContainer.inner_1:type_name -> testing.VariableNestedContainer
|
||||
2, // 2: testing.VariableOuterContainer.inner_2:type_name -> testing.VariableNestedContainer
|
||||
0, // 3: testing.VariableTestContainer.field_list_container:type_name -> testing.FixedNestedContainer
|
||||
2, // 4: testing.VariableTestContainer.nested:type_name -> testing.VariableNestedContainer
|
||||
3, // 5: testing.VariableTestContainer.variable_container_list:type_name -> testing.VariableOuterContainer
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
@@ -561,27 +562,27 @@ var file_proto_ssz_query_ssz_query_proto_depIdxs = []int32{
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_ssz_query_ssz_query_proto_init() }
|
||||
func file_proto_ssz_query_ssz_query_proto_init() {
|
||||
if File_proto_ssz_query_ssz_query_proto != nil {
|
||||
func init() { file_proto_ssz_query_testing_test_containers_proto_init() }
|
||||
func file_proto_ssz_query_testing_test_containers_proto_init() {
|
||||
if File_proto_ssz_query_testing_test_containers_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_ssz_query_ssz_query_proto_rawDesc,
|
||||
RawDescriptor: file_proto_ssz_query_testing_test_containers_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_proto_ssz_query_ssz_query_proto_goTypes,
|
||||
DependencyIndexes: file_proto_ssz_query_ssz_query_proto_depIdxs,
|
||||
MessageInfos: file_proto_ssz_query_ssz_query_proto_msgTypes,
|
||||
GoTypes: file_proto_ssz_query_testing_test_containers_proto_goTypes,
|
||||
DependencyIndexes: file_proto_ssz_query_testing_test_containers_proto_depIdxs,
|
||||
MessageInfos: file_proto_ssz_query_testing_test_containers_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_ssz_query_ssz_query_proto = out.File
|
||||
file_proto_ssz_query_ssz_query_proto_rawDesc = nil
|
||||
file_proto_ssz_query_ssz_query_proto_goTypes = nil
|
||||
file_proto_ssz_query_ssz_query_proto_depIdxs = nil
|
||||
File_proto_ssz_query_testing_test_containers_proto = out.File
|
||||
file_proto_ssz_query_testing_test_containers_proto_rawDesc = nil
|
||||
file_proto_ssz_query_testing_test_containers_proto_goTypes = nil
|
||||
file_proto_ssz_query_testing_test_containers_proto_depIdxs = nil
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package ssz_query;
|
||||
package testing;
|
||||
|
||||
import "proto/eth/ext/options.proto";
|
||||
|
||||
option go_package = "github.com/OffchainLabs/prysm/v6/proto/ssz_query";
|
||||
option go_package = "github.com/OffchainLabs/prysm/v6/proto/ssz_query/testing;testing";
|
||||
|
||||
|
||||
// ===== FIXED-SIZE TEST CONTAINERS =====
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by fastssz. DO NOT EDIT.
|
||||
package ssz_query
|
||||
package testing
|
||||
|
||||
import (
|
||||
ssz "github.com/prysmaticlabs/fastssz"
|
||||
227
proto/testing/test.pb.go
generated
227
proto/testing/test.pb.go
generated
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc-gen-go v1.36.3
|
||||
// protoc v3.21.7
|
||||
// source: proto/testing/test.proto
|
||||
|
||||
@@ -73,21 +73,18 @@ func (Person_PhoneType) EnumDescriptor() ([]byte, []int) {
|
||||
}
|
||||
|
||||
type TestMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
|
||||
Bar string `protobuf:"bytes,2,opt,name=bar,proto3" json:"bar,omitempty" spec-name:"foo" ssz-size:"32"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
|
||||
Bar string `protobuf:"bytes,2,opt,name=bar,proto3" json:"bar,omitempty" spec-name:"foo" ssz-size:"32"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TestMessage) Reset() {
|
||||
*x = TestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TestMessage) String() string {
|
||||
@@ -98,7 +95,7 @@ func (*TestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *TestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -128,21 +125,18 @@ func (x *TestMessage) GetBar() string {
|
||||
}
|
||||
|
||||
type TestNestedMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Fuzz string `protobuf:"bytes,1,opt,name=fuzz,proto3" json:"fuzz,omitempty"`
|
||||
Msg *TestMessage `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Fuzz string `protobuf:"bytes,1,opt,name=fuzz,proto3" json:"fuzz,omitempty"`
|
||||
Msg *TestMessage `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TestNestedMessage) Reset() {
|
||||
*x = TestNestedMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TestNestedMessage) String() string {
|
||||
@@ -153,7 +147,7 @@ func (*TestNestedMessage) ProtoMessage() {}
|
||||
|
||||
func (x *TestNestedMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -183,21 +177,18 @@ func (x *TestNestedMessage) GetMsg() *TestMessage {
|
||||
}
|
||||
|
||||
type Puzzle struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Challenge string `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"`
|
||||
Answer string `protobuf:"bytes,2,opt,name=answer,proto3" json:"answer,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Challenge string `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"`
|
||||
Answer string `protobuf:"bytes,2,opt,name=answer,proto3" json:"answer,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Puzzle) Reset() {
|
||||
*x = Puzzle{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Puzzle) String() string {
|
||||
@@ -208,7 +199,7 @@ func (*Puzzle) ProtoMessage() {}
|
||||
|
||||
func (x *Puzzle) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -238,24 +229,21 @@ func (x *Puzzle) GetAnswer() string {
|
||||
}
|
||||
|
||||
type Person struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
|
||||
Phones []*Person_PhoneNumber `protobuf:"bytes,4,rep,name=phones,proto3" json:"phones,omitempty"`
|
||||
LastUpdated *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
|
||||
Phones []*Person_PhoneNumber `protobuf:"bytes,4,rep,name=phones,proto3" json:"phones,omitempty"`
|
||||
LastUpdated *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Person) Reset() {
|
||||
*x = Person{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Person) String() string {
|
||||
@@ -266,7 +254,7 @@ func (*Person) ProtoMessage() {}
|
||||
|
||||
func (x *Person) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -317,20 +305,17 @@ func (x *Person) GetLastUpdated() *timestamppb.Timestamp {
|
||||
}
|
||||
|
||||
type AddressBook struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
People []*Person `protobuf:"bytes,1,rep,name=people,proto3" json:"people,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
People []*Person `protobuf:"bytes,1,rep,name=people,proto3" json:"people,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AddressBook) Reset() {
|
||||
*x = AddressBook{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AddressBook) String() string {
|
||||
@@ -341,7 +326,7 @@ func (*AddressBook) ProtoMessage() {}
|
||||
|
||||
func (x *AddressBook) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -364,21 +349,18 @@ func (x *AddressBook) GetPeople() []*Person {
|
||||
}
|
||||
|
||||
type TestSimpleMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Foo []byte `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
|
||||
Bar uint64 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Foo []byte `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
|
||||
Bar uint64 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TestSimpleMessage) Reset() {
|
||||
*x = TestSimpleMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TestSimpleMessage) String() string {
|
||||
@@ -389,7 +371,7 @@ func (*TestSimpleMessage) ProtoMessage() {}
|
||||
|
||||
func (x *TestSimpleMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -419,21 +401,18 @@ func (x *TestSimpleMessage) GetBar() uint64 {
|
||||
}
|
||||
|
||||
type Person_PhoneNumber struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"`
|
||||
Type Person_PhoneType `protobuf:"varint,2,opt,name=type,proto3,enum=testing.Person_PhoneType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"`
|
||||
Type Person_PhoneType `protobuf:"varint,2,opt,name=type,proto3,enum=testing.Person_PhoneType" json:"type,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Person_PhoneNumber) Reset() {
|
||||
*x = Person_PhoneNumber{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_proto_testing_test_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Person_PhoneNumber) String() string {
|
||||
@@ -444,7 +423,7 @@ func (*Person_PhoneNumber) ProtoMessage() {}
|
||||
|
||||
func (x *Person_PhoneNumber) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_testing_test_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -574,7 +553,7 @@ func file_proto_testing_test_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_proto_testing_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_proto_testing_test_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_proto_testing_test_proto_goTypes = []interface{}{
|
||||
var file_proto_testing_test_proto_goTypes = []any{
|
||||
(Person_PhoneType)(0), // 0: testing.Person.PhoneType
|
||||
(*TestMessage)(nil), // 1: testing.TestMessage
|
||||
(*TestNestedMessage)(nil), // 2: testing.TestNestedMessage
|
||||
@@ -606,92 +585,6 @@ func file_proto_testing_test_proto_init() {
|
||||
if File_proto_testing_test_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_proto_testing_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_testing_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TestNestedMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_testing_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Puzzle); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_testing_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Person); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_testing_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AddressBook); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_testing_test_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TestSimpleMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_testing_test_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Person_PhoneNumber); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
Reference in New Issue
Block a user