ZcashLightClientKit/Tests/TestUtils/proto/darkside.pb.swift

426 lines
16 KiB
Swift

// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: darkside.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
// Copyright (c) 2019-2020 The Zcash developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php .
import Foundation
import SwiftProtobuf
@testable import ZcashLightClientKit
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
struct DarksideMetaState {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var saplingActivation: Int32 = 0
var branchID: String = String()
var chainName: String = String()
var startSaplingCommitmentTreeSize: UInt32 = 0
var startOrchardCommitmentTreeSize: UInt32 = 0
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
/// A block is a hex-encoded string.
struct DarksideBlock {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var block: String = String()
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
/// DarksideBlocksURL is typically something like:
/// https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/basic-reorg/before-reorg.txt
struct DarksideBlocksURL {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var url: String = String()
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
/// DarksideTransactionsURL refers to an HTTP source that contains a list
/// of hex-encoded transactions, one per line, that are to be associated
/// with the given height (fake-mined into the block at that height)
struct DarksideTransactionsURL {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var height: Int32 = 0
var url: String = String()
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
struct DarksideHeight {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var height: Int32 = 0
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
struct DarksideEmptyBlocks {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var height: Int32 = 0
var nonce: Int32 = 0
var count: Int32 = 0
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
struct DarksideSubtreeRoots {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var shieldedProtocol: ShieldedProtocol = .sapling
var startIndex: UInt32 = 0
var subtreeRoots: [SubtreeRoot] = []
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
#if swift(>=5.5) && canImport(_Concurrency)
extension DarksideMetaState: @unchecked Sendable {}
extension DarksideBlock: @unchecked Sendable {}
extension DarksideBlocksURL: @unchecked Sendable {}
extension DarksideTransactionsURL: @unchecked Sendable {}
extension DarksideHeight: @unchecked Sendable {}
extension DarksideEmptyBlocks: @unchecked Sendable {}
extension DarksideSubtreeRoots: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "cash.z.wallet.sdk.rpc"
extension DarksideMetaState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideMetaState"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "saplingActivation"),
2: .same(proto: "branchID"),
3: .same(proto: "chainName"),
4: .same(proto: "startSaplingCommitmentTreeSize"),
5: .same(proto: "startOrchardCommitmentTreeSize"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularInt32Field(value: &self.saplingActivation) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.branchID) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.chainName) }()
case 4: try { try decoder.decodeSingularUInt32Field(value: &self.startSaplingCommitmentTreeSize) }()
case 5: try { try decoder.decodeSingularUInt32Field(value: &self.startOrchardCommitmentTreeSize) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.saplingActivation != 0 {
try visitor.visitSingularInt32Field(value: self.saplingActivation, fieldNumber: 1)
}
if !self.branchID.isEmpty {
try visitor.visitSingularStringField(value: self.branchID, fieldNumber: 2)
}
if !self.chainName.isEmpty {
try visitor.visitSingularStringField(value: self.chainName, fieldNumber: 3)
}
if self.startSaplingCommitmentTreeSize != 0 {
try visitor.visitSingularUInt32Field(value: self.startSaplingCommitmentTreeSize, fieldNumber: 4)
}
if self.startOrchardCommitmentTreeSize != 0 {
try visitor.visitSingularUInt32Field(value: self.startOrchardCommitmentTreeSize, fieldNumber: 5)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideMetaState, rhs: DarksideMetaState) -> Bool {
if lhs.saplingActivation != rhs.saplingActivation {return false}
if lhs.branchID != rhs.branchID {return false}
if lhs.chainName != rhs.chainName {return false}
if lhs.startSaplingCommitmentTreeSize != rhs.startSaplingCommitmentTreeSize {return false}
if lhs.startOrchardCommitmentTreeSize != rhs.startOrchardCommitmentTreeSize {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension DarksideBlock: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideBlock"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "block"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.block) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.block.isEmpty {
try visitor.visitSingularStringField(value: self.block, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideBlock, rhs: DarksideBlock) -> Bool {
if lhs.block != rhs.block {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension DarksideBlocksURL: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideBlocksURL"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "url"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.url) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.url.isEmpty {
try visitor.visitSingularStringField(value: self.url, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideBlocksURL, rhs: DarksideBlocksURL) -> Bool {
if lhs.url != rhs.url {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension DarksideTransactionsURL: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideTransactionsURL"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "height"),
2: .same(proto: "url"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularInt32Field(value: &self.height) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.url) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.height != 0 {
try visitor.visitSingularInt32Field(value: self.height, fieldNumber: 1)
}
if !self.url.isEmpty {
try visitor.visitSingularStringField(value: self.url, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideTransactionsURL, rhs: DarksideTransactionsURL) -> Bool {
if lhs.height != rhs.height {return false}
if lhs.url != rhs.url {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension DarksideHeight: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideHeight"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "height"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularInt32Field(value: &self.height) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.height != 0 {
try visitor.visitSingularInt32Field(value: self.height, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideHeight, rhs: DarksideHeight) -> Bool {
if lhs.height != rhs.height {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension DarksideEmptyBlocks: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideEmptyBlocks"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "height"),
2: .same(proto: "nonce"),
3: .same(proto: "count"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularInt32Field(value: &self.height) }()
case 2: try { try decoder.decodeSingularInt32Field(value: &self.nonce) }()
case 3: try { try decoder.decodeSingularInt32Field(value: &self.count) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.height != 0 {
try visitor.visitSingularInt32Field(value: self.height, fieldNumber: 1)
}
if self.nonce != 0 {
try visitor.visitSingularInt32Field(value: self.nonce, fieldNumber: 2)
}
if self.count != 0 {
try visitor.visitSingularInt32Field(value: self.count, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideEmptyBlocks, rhs: DarksideEmptyBlocks) -> Bool {
if lhs.height != rhs.height {return false}
if lhs.nonce != rhs.nonce {return false}
if lhs.count != rhs.count {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension DarksideSubtreeRoots: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".DarksideSubtreeRoots"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "shieldedProtocol"),
2: .same(proto: "startIndex"),
3: .same(proto: "subtreeRoots"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularEnumField(value: &self.shieldedProtocol) }()
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.startIndex) }()
case 3: try { try decoder.decodeRepeatedMessageField(value: &self.subtreeRoots) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.shieldedProtocol != .sapling {
try visitor.visitSingularEnumField(value: self.shieldedProtocol, fieldNumber: 1)
}
if self.startIndex != 0 {
try visitor.visitSingularUInt32Field(value: self.startIndex, fieldNumber: 2)
}
if !self.subtreeRoots.isEmpty {
try visitor.visitRepeatedMessageField(value: self.subtreeRoots, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: DarksideSubtreeRoots, rhs: DarksideSubtreeRoots) -> Bool {
if lhs.shieldedProtocol != rhs.shieldedProtocol {return false}
if lhs.startIndex != rhs.startIndex {return false}
if lhs.subtreeRoots != rhs.subtreeRoots {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}