// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "tendermint/blocksync/stub.proto" (package "tendermint.blocksync", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
/**
 * SigCountMessage is a stripped down view of Message used by the blocksync
 * MsgBytesFilter for validation before unmarshalling the full BlockResponse
 * Message. Only the BlockResponse oneof case is modelled, and only the path
 * down to {Block,Extended}Commit.signatures.
 *
 * @generated from protobuf message tendermint.blocksync.SigCountMessage
 */
export interface SigCountMessage {
    /**
     * @generated from protobuf field: tendermint.blocksync.SigCountBlockResponse block_response = 3
     */
    blockResponse?: SigCountBlockResponse;
}
/**
 * @generated from protobuf message tendermint.blocksync.SigCountBlockResponse
 */
export interface SigCountBlockResponse {
    /**
     * @generated from protobuf field: tendermint.blocksync.SigCountBlock block = 1
     */
    block?: SigCountBlock;
    /**
     * @generated from protobuf field: tendermint.blocksync.SigCountExtendedCommit ext_commit = 2
     */
    extCommit?: SigCountExtendedCommit;
}
/**
 * @generated from protobuf message tendermint.blocksync.SigCountBlock
 */
export interface SigCountBlock {
    /**
     * @generated from protobuf field: tendermint.blocksync.SigCountCommit last_commit = 4
     */
    lastCommit?: SigCountCommit;
}
/**
 * @generated from protobuf message tendermint.blocksync.SigCountCommit
 */
export interface SigCountCommit {
    /**
     * @generated from protobuf field: repeated bytes signatures = 4
     */
    signatures: Uint8Array[];
}
/**
 * @generated from protobuf message tendermint.blocksync.SigCountExtendedCommit
 */
export interface SigCountExtendedCommit {
    /**
     * @generated from protobuf field: repeated bytes extended_signatures = 4
     */
    extendedSignatures: Uint8Array[];
}
// @generated message type with reflection information, may provide speed optimized methods
class SigCountMessage$Type extends MessageType<SigCountMessage> {
    constructor() {
        super("tendermint.blocksync.SigCountMessage", [
            { no: 3, name: "block_response", kind: "message", T: () => SigCountBlockResponse }
        ]);
    }
    create(value?: PartialMessage<SigCountMessage>): SigCountMessage {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<SigCountMessage>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SigCountMessage): SigCountMessage {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* tendermint.blocksync.SigCountBlockResponse block_response */ 3:
                    message.blockResponse = SigCountBlockResponse.internalBinaryRead(reader, reader.uint32(), options, message.blockResponse);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: SigCountMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* tendermint.blocksync.SigCountBlockResponse block_response = 3; */
        if (message.blockResponse)
            SigCountBlockResponse.internalBinaryWrite(message.blockResponse, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message tendermint.blocksync.SigCountMessage
 */
export const SigCountMessage = new SigCountMessage$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SigCountBlockResponse$Type extends MessageType<SigCountBlockResponse> {
    constructor() {
        super("tendermint.blocksync.SigCountBlockResponse", [
            { no: 1, name: "block", kind: "message", T: () => SigCountBlock },
            { no: 2, name: "ext_commit", kind: "message", T: () => SigCountExtendedCommit }
        ]);
    }
    create(value?: PartialMessage<SigCountBlockResponse>): SigCountBlockResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<SigCountBlockResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SigCountBlockResponse): SigCountBlockResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* tendermint.blocksync.SigCountBlock block */ 1:
                    message.block = SigCountBlock.internalBinaryRead(reader, reader.uint32(), options, message.block);
                    break;
                case /* tendermint.blocksync.SigCountExtendedCommit ext_commit */ 2:
                    message.extCommit = SigCountExtendedCommit.internalBinaryRead(reader, reader.uint32(), options, message.extCommit);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: SigCountBlockResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* tendermint.blocksync.SigCountBlock block = 1; */
        if (message.block)
            SigCountBlock.internalBinaryWrite(message.block, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* tendermint.blocksync.SigCountExtendedCommit ext_commit = 2; */
        if (message.extCommit)
            SigCountExtendedCommit.internalBinaryWrite(message.extCommit, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message tendermint.blocksync.SigCountBlockResponse
 */
export const SigCountBlockResponse = new SigCountBlockResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SigCountBlock$Type extends MessageType<SigCountBlock> {
    constructor() {
        super("tendermint.blocksync.SigCountBlock", [
            { no: 4, name: "last_commit", kind: "message", T: () => SigCountCommit }
        ]);
    }
    create(value?: PartialMessage<SigCountBlock>): SigCountBlock {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<SigCountBlock>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SigCountBlock): SigCountBlock {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* tendermint.blocksync.SigCountCommit last_commit */ 4:
                    message.lastCommit = SigCountCommit.internalBinaryRead(reader, reader.uint32(), options, message.lastCommit);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: SigCountBlock, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* tendermint.blocksync.SigCountCommit last_commit = 4; */
        if (message.lastCommit)
            SigCountCommit.internalBinaryWrite(message.lastCommit, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message tendermint.blocksync.SigCountBlock
 */
export const SigCountBlock = new SigCountBlock$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SigCountCommit$Type extends MessageType<SigCountCommit> {
    constructor() {
        super("tendermint.blocksync.SigCountCommit", [
            { no: 4, name: "signatures", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "NoSig" } }
        ]);
    }
    create(value?: PartialMessage<SigCountCommit>): SigCountCommit {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.signatures = [];
        if (value !== undefined)
            reflectionMergePartial<SigCountCommit>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SigCountCommit): SigCountCommit {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated bytes signatures */ 4:
                    message.signatures.push(reader.bytes());
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: SigCountCommit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated bytes signatures = 4; */
        for (let i = 0; i < message.signatures.length; i++)
            writer.tag(4, WireType.LengthDelimited).bytes(message.signatures[i]);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message tendermint.blocksync.SigCountCommit
 */
export const SigCountCommit = new SigCountCommit$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SigCountExtendedCommit$Type extends MessageType<SigCountExtendedCommit> {
    constructor() {
        super("tendermint.blocksync.SigCountExtendedCommit", [
            { no: 4, name: "extended_signatures", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "NoSig" } }
        ]);
    }
    create(value?: PartialMessage<SigCountExtendedCommit>): SigCountExtendedCommit {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.extendedSignatures = [];
        if (value !== undefined)
            reflectionMergePartial<SigCountExtendedCommit>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SigCountExtendedCommit): SigCountExtendedCommit {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated bytes extended_signatures */ 4:
                    message.extendedSignatures.push(reader.bytes());
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: SigCountExtendedCommit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated bytes extended_signatures = 4; */
        for (let i = 0; i < message.extendedSignatures.length; i++)
            writer.tag(4, WireType.LengthDelimited).bytes(message.extendedSignatures[i]);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message tendermint.blocksync.SigCountExtendedCommit
 */
export const SigCountExtendedCommit = new SigCountExtendedCommit$Type();
