mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
* 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>
71 lines
2.0 KiB
Python
71 lines
2.0 KiB
Python
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",
|
|
}),
|
|
)
|