// Copyright 2025 Sonic Operations Ltd
// This file is part of the Sonic Client
//
// Sonic is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Sonic is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Sonic. If not, see <http://www.gnu.org/licenses/>.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v3.21.12
// source: payload.proto

package pb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

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)
)

// Payload is the top-level payload data of the version 3 of the lachesis event.
// It constitutes the entry point for any information to be stored in events,
// and can be expanded in a backward-compatible way in the future.
type Payload struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The version of the proto-payload. The initial version is 1.
	// If the payload container is expanded with new significant fields that
	// require a hard-fork, this version number is to be increased.
	Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// The turn number of the last seen proposal. Validators take turns in
	// proposing blocks. In each turn, one validator is allowed to propose a
	// block. If done so, another validator is selected for the next turn. If
	// a validator responsible for proposing a block fails to do so in a given
	// number of Lachesis frames / rounds, it is identified as failed and the
	// next turn is starts.
	LastSeenProposalTurn uint32 `protobuf:"varint,2,opt,name=lastSeenProposalTurn,proto3" json:"lastSeenProposalTurn,omitempty"`
	// The frame number of the last seen proposal. For genesis events, this
	// value is 0.
	LastSeenProposalFrame uint32 `protobuf:"varint,3,opt,name=lastSeenProposalFrame,proto3" json:"lastSeenProposalFrame,omitempty"`
	// An optional proposal made by this event. If present, it is the latest
	// seen proposal for this event. Proposals made must be valid successors
	// of the last seen proposal in the strict ancestry of this event.
	Proposal      *Proposal `protobuf:"bytes,4,opt,name=proposal,proto3,oneof" json:"proposal,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Payload) Reset() {
	*x = Payload{}
	mi := &file_payload_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Payload) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Payload) ProtoMessage() {}

func (x *Payload) ProtoReflect() protoreflect.Message {
	mi := &file_payload_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 Payload.ProtoReflect.Descriptor instead.
func (*Payload) Descriptor() ([]byte, []int) {
	return file_payload_proto_rawDescGZIP(), []int{0}
}

func (x *Payload) GetVersion() uint32 {
	if x != nil {
		return x.Version
	}
	return 0
}

func (x *Payload) GetLastSeenProposalTurn() uint32 {
	if x != nil {
		return x.LastSeenProposalTurn
	}
	return 0
}

func (x *Payload) GetLastSeenProposalFrame() uint32 {
	if x != nil {
		return x.LastSeenProposalFrame
	}
	return 0
}

func (x *Payload) GetProposal() *Proposal {
	if x != nil {
		return x.Proposal
	}
	return nil
}

var File_payload_proto protoreflect.FileDescriptor

const file_payload_proto_rawDesc = "" +
	"\n" +
	"\rpayload.proto\x12\x11sonic.inter.proto\x1a\x0eproposal.proto\"\xd8\x01\n" +
	"\aPayload\x12\x18\n" +
	"\aversion\x18\x01 \x01(\rR\aversion\x122\n" +
	"\x14lastSeenProposalTurn\x18\x02 \x01(\rR\x14lastSeenProposalTurn\x124\n" +
	"\x15lastSeenProposalFrame\x18\x03 \x01(\rR\x15lastSeenProposalFrame\x12<\n" +
	"\bproposal\x18\x04 \x01(\v2\x1b.sonic.inter.proto.ProposalH\x00R\bproposal\x88\x01\x01B\v\n" +
	"\t_proposalB\x06Z\x04.;pbb\x06proto3"

var (
	file_payload_proto_rawDescOnce sync.Once
	file_payload_proto_rawDescData []byte
)

func file_payload_proto_rawDescGZIP() []byte {
	file_payload_proto_rawDescOnce.Do(func() {
		file_payload_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_payload_proto_rawDesc), len(file_payload_proto_rawDesc)))
	})
	return file_payload_proto_rawDescData
}

var file_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_payload_proto_goTypes = []any{
	(*Payload)(nil),  // 0: sonic.inter.proto.Payload
	(*Proposal)(nil), // 1: sonic.inter.proto.Proposal
}
var file_payload_proto_depIdxs = []int32{
	1, // 0: sonic.inter.proto.Payload.proposal:type_name -> sonic.inter.proto.Proposal
	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_payload_proto_init() }
func file_payload_proto_init() {
	if File_payload_proto != nil {
		return
	}
	file_proposal_proto_init()
	file_payload_proto_msgTypes[0].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_payload_proto_rawDesc), len(file_payload_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_payload_proto_goTypes,
		DependencyIndexes: file_payload_proto_depIdxs,
		MessageInfos:      file_payload_proto_msgTypes,
	}.Build()
	File_payload_proto = out.File
	file_payload_proto_goTypes = nil
	file_payload_proto_depIdxs = nil
}
