// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: provenance/ledger/v1/ledger_settlement.proto

package types

import (
	fmt "fmt"
	_ "github.com/cosmos/cosmos-proto"
	types "github.com/cosmos/cosmos-sdk/types"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/proto"
	io "io"
	math "math"
	math_bits "math/bits"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

// FundingTransferStatus represents the current status of a funding transfer.
type FundingTransferStatus int32

const (
	// Unspecified funding transfer status.
	FUNDING_TRANSFER_STATUS_UNSPECIFIED FundingTransferStatus = 0
	// Pending funding transfer status.
	FUNDING_TRANSFER_STATUS_PENDING FundingTransferStatus = 1
	// Processing funding transfer status.
	FUNDING_TRANSFER_STATUS_PROCESSING FundingTransferStatus = 2
	// Completed funding transfer status.
	FUNDING_TRANSFER_STATUS_COMPLETED FundingTransferStatus = 3
	// Failed funding transfer status.
	FUNDING_TRANSFER_STATUS_FAILED FundingTransferStatus = 4
)

var FundingTransferStatus_name = map[int32]string{
	0: "FUNDING_TRANSFER_STATUS_UNSPECIFIED",
	1: "FUNDING_TRANSFER_STATUS_PENDING",
	2: "FUNDING_TRANSFER_STATUS_PROCESSING",
	3: "FUNDING_TRANSFER_STATUS_COMPLETED",
	4: "FUNDING_TRANSFER_STATUS_FAILED",
}

var FundingTransferStatus_value = map[string]int32{
	"FUNDING_TRANSFER_STATUS_UNSPECIFIED": 0,
	"FUNDING_TRANSFER_STATUS_PENDING":     1,
	"FUNDING_TRANSFER_STATUS_PROCESSING":  2,
	"FUNDING_TRANSFER_STATUS_COMPLETED":   3,
	"FUNDING_TRANSFER_STATUS_FAILED":      4,
}

func (x FundingTransferStatus) String() string {
	return proto.EnumName(FundingTransferStatus_name, int32(x))
}

func (FundingTransferStatus) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_0caa3a369f9ea91c, []int{0}
}

// FundTransferWithSettlement represents a fund transfer with settlement instructions.
type FundTransferWithSettlement struct {
	// The ledger key identifying the ledger for this transfer.
	Key *LedgerKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The correlation ID of the ledger entry associated with this transfer.
	LedgerEntryCorrelationId string                   `protobuf:"bytes,2,opt,name=ledger_entry_correlation_id,json=ledgerEntryCorrelationId,proto3" json:"ledger_entry_correlation_id,omitempty"`
	SettlementInstructions   []*SettlementInstruction `protobuf:"bytes,3,rep,name=settlement_instructions,json=settlementInstructions,proto3" json:"settlement_instructions,omitempty"`
}

func (m *FundTransferWithSettlement) Reset()         { *m = FundTransferWithSettlement{} }
func (m *FundTransferWithSettlement) String() string { return proto.CompactTextString(m) }
func (*FundTransferWithSettlement) ProtoMessage()    {}
func (*FundTransferWithSettlement) Descriptor() ([]byte, []int) {
	return fileDescriptor_0caa3a369f9ea91c, []int{0}
}
func (m *FundTransferWithSettlement) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *FundTransferWithSettlement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_FundTransferWithSettlement.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *FundTransferWithSettlement) XXX_Merge(src proto.Message) {
	xxx_messageInfo_FundTransferWithSettlement.Merge(m, src)
}
func (m *FundTransferWithSettlement) XXX_Size() int {
	return m.Size()
}
func (m *FundTransferWithSettlement) XXX_DiscardUnknown() {
	xxx_messageInfo_FundTransferWithSettlement.DiscardUnknown(m)
}

var xxx_messageInfo_FundTransferWithSettlement proto.InternalMessageInfo

func (m *FundTransferWithSettlement) GetKey() *LedgerKey {
	if m != nil {
		return m.Key
	}
	return nil
}

func (m *FundTransferWithSettlement) GetLedgerEntryCorrelationId() string {
	if m != nil {
		return m.LedgerEntryCorrelationId
	}
	return ""
}

func (m *FundTransferWithSettlement) GetSettlementInstructions() []*SettlementInstruction {
	if m != nil {
		return m.SettlementInstructions
	}
	return nil
}

// SettlementInstruction represents blockchain-specific settlement instructions.
type SettlementInstruction struct {
	// The amount to be transferred.
	Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"`
	// The recipient's blockchain address.
	RecipientAddress string `protobuf:"bytes,2,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"`
	// The current status of the funding transfer.
	Status FundingTransferStatus `protobuf:"varint,3,opt,name=status,proto3,enum=provenance.ledger.v1.FundingTransferStatus" json:"status,omitempty"`
	// An optional memo or note for the transaction.
	Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"`
}

func (m *SettlementInstruction) Reset()         { *m = SettlementInstruction{} }
func (m *SettlementInstruction) String() string { return proto.CompactTextString(m) }
func (*SettlementInstruction) ProtoMessage()    {}
func (*SettlementInstruction) Descriptor() ([]byte, []int) {
	return fileDescriptor_0caa3a369f9ea91c, []int{1}
}
func (m *SettlementInstruction) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *SettlementInstruction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_SettlementInstruction.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *SettlementInstruction) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SettlementInstruction.Merge(m, src)
}
func (m *SettlementInstruction) XXX_Size() int {
	return m.Size()
}
func (m *SettlementInstruction) XXX_DiscardUnknown() {
	xxx_messageInfo_SettlementInstruction.DiscardUnknown(m)
}

var xxx_messageInfo_SettlementInstruction proto.InternalMessageInfo

func (m *SettlementInstruction) GetAmount() types.Coin {
	if m != nil {
		return m.Amount
	}
	return types.Coin{}
}

func (m *SettlementInstruction) GetRecipientAddress() string {
	if m != nil {
		return m.RecipientAddress
	}
	return ""
}

func (m *SettlementInstruction) GetStatus() FundingTransferStatus {
	if m != nil {
		return m.Status
	}
	return FUNDING_TRANSFER_STATUS_UNSPECIFIED
}

func (m *SettlementInstruction) GetMemo() string {
	if m != nil {
		return m.Memo
	}
	return ""
}

// StoredSettlementInstructions is used as the stored version of settlement instructions against a ledger key and entry
// correlation id.
type StoredSettlementInstructions struct {
	SettlementInstructions []*SettlementInstruction `protobuf:"bytes,1,rep,name=settlement_instructions,json=settlementInstructions,proto3" json:"settlement_instructions,omitempty"`
}

func (m *StoredSettlementInstructions) Reset()         { *m = StoredSettlementInstructions{} }
func (m *StoredSettlementInstructions) String() string { return proto.CompactTextString(m) }
func (*StoredSettlementInstructions) ProtoMessage()    {}
func (*StoredSettlementInstructions) Descriptor() ([]byte, []int) {
	return fileDescriptor_0caa3a369f9ea91c, []int{2}
}
func (m *StoredSettlementInstructions) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *StoredSettlementInstructions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_StoredSettlementInstructions.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *StoredSettlementInstructions) XXX_Merge(src proto.Message) {
	xxx_messageInfo_StoredSettlementInstructions.Merge(m, src)
}
func (m *StoredSettlementInstructions) XXX_Size() int {
	return m.Size()
}
func (m *StoredSettlementInstructions) XXX_DiscardUnknown() {
	xxx_messageInfo_StoredSettlementInstructions.DiscardUnknown(m)
}

var xxx_messageInfo_StoredSettlementInstructions proto.InternalMessageInfo

func (m *StoredSettlementInstructions) GetSettlementInstructions() []*SettlementInstruction {
	if m != nil {
		return m.SettlementInstructions
	}
	return nil
}

func init() {
	proto.RegisterEnum("provenance.ledger.v1.FundingTransferStatus", FundingTransferStatus_name, FundingTransferStatus_value)
	proto.RegisterType((*FundTransferWithSettlement)(nil), "provenance.ledger.v1.FundTransferWithSettlement")
	proto.RegisterType((*SettlementInstruction)(nil), "provenance.ledger.v1.SettlementInstruction")
	proto.RegisterType((*StoredSettlementInstructions)(nil), "provenance.ledger.v1.StoredSettlementInstructions")
}

func init() {
	proto.RegisterFile("provenance/ledger/v1/ledger_settlement.proto", fileDescriptor_0caa3a369f9ea91c)
}

var fileDescriptor_0caa3a369f9ea91c = []byte{
	// 580 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x3f, 0x6f, 0xd3, 0x40,
	0x18, 0xc6, 0x7d, 0x4d, 0x54, 0xc1, 0x55, 0x42, 0xe1, 0xd4, 0x52, 0x37, 0x20, 0xb7, 0x4d, 0x05,
	0x44, 0x40, 0x6d, 0xa5, 0x0c, 0x4c, 0x0c, 0xa9, 0xe3, 0x20, 0x8b, 0x92, 0x46, 0x76, 0x22, 0x24,
	0x16, 0xcb, 0xb1, 0x0f, 0xf7, 0x44, 0x7c, 0x17, 0xdd, 0x5d, 0x22, 0xb2, 0x33, 0x30, 0xf2, 0x1d,
	0x60, 0xe0, 0x03, 0xf0, 0x21, 0x3a, 0x56, 0x4c, 0x4c, 0x08, 0x25, 0x5f, 0x80, 0x81, 0x0f, 0x80,
	0xfc, 0xa7, 0x35, 0x83, 0xd3, 0x89, 0xed, 0xf5, 0xfb, 0xfe, 0x1e, 0xeb, 0x79, 0x9f, 0x57, 0x07,
	0x9f, 0x4c, 0x38, 0x9b, 0x61, 0xea, 0xd3, 0x00, 0x1b, 0x63, 0x1c, 0x46, 0x98, 0x1b, 0xb3, 0x56,
	0x5e, 0x79, 0x02, 0x4b, 0x39, 0xc6, 0x31, 0xa6, 0x52, 0x9f, 0x70, 0x26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0x01, 0xb5, 0x55, 0x58, 0xb7, 0x6d, 0x9f, 0x58, 0x9d,
	0x5a, 0xb5, 0x7e, 0xe3, 0xe3, 0x67, 0x4d, 0xf9, 0xfa, 0x45, 0x03, 0xc7, 0xd1, 0xf9, 0x42, 0x03,
	0x17, 0x0b, 0x0d, 0xfc, 0x5a, 0x68, 0xe0, 0xd3, 0x52, 0x53, 0x2e, 0x96, 0x9a, 0xf2, 0x63, 0xa9,
	0x29, 0x70, 0x9b, 0xb0, 0xd2, 0x14, 0xfb, 0xe0, 0xcd, 0x51, 0x44, 0xe4, 0xd9, 0x74, 0xa4, 0x07,
	0x2c, 0x36, 0x0a, 0xe4, 0x90, 0xb0, 0x7f, 0xbe, 0x8c, 0xf7, 0x97, 0x0f, 0x59, 0xce, 0x27, 0x58,
	0x8c, 0xd6, 0xd3, 0x57, 0xfc, 0xf4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xaf, 0x88, 0xd0,
	0x7f, 0x04, 0x00, 0x00,
}

func (m *FundTransferWithSettlement) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *FundTransferWithSettlement) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *FundTransferWithSettlement) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.SettlementInstructions) > 0 {
		for iNdEx := len(m.SettlementInstructions) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.SettlementInstructions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintLedgerSettlement(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x1a
		}
	}
	if len(m.LedgerEntryCorrelationId) > 0 {
		i -= len(m.LedgerEntryCorrelationId)
		copy(dAtA[i:], m.LedgerEntryCorrelationId)
		i = encodeVarintLedgerSettlement(dAtA, i, uint64(len(m.LedgerEntryCorrelationId)))
		i--
		dAtA[i] = 0x12
	}
	if m.Key != nil {
		{
			size, err := m.Key.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintLedgerSettlement(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *SettlementInstruction) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *SettlementInstruction) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *SettlementInstruction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Memo) > 0 {
		i -= len(m.Memo)
		copy(dAtA[i:], m.Memo)
		i = encodeVarintLedgerSettlement(dAtA, i, uint64(len(m.Memo)))
		i--
		dAtA[i] = 0x22
	}
	if m.Status != 0 {
		i = encodeVarintLedgerSettlement(dAtA, i, uint64(m.Status))
		i--
		dAtA[i] = 0x18
	}
	if len(m.RecipientAddress) > 0 {
		i -= len(m.RecipientAddress)
		copy(dAtA[i:], m.RecipientAddress)
		i = encodeVarintLedgerSettlement(dAtA, i, uint64(len(m.RecipientAddress)))
		i--
		dAtA[i] = 0x12
	}
	{
		size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintLedgerSettlement(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

func (m *StoredSettlementInstructions) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *StoredSettlementInstructions) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *StoredSettlementInstructions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.SettlementInstructions) > 0 {
		for iNdEx := len(m.SettlementInstructions) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.SettlementInstructions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintLedgerSettlement(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func encodeVarintLedgerSettlement(dAtA []byte, offset int, v uint64) int {
	offset -= sovLedgerSettlement(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *FundTransferWithSettlement) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Key != nil {
		l = m.Key.Size()
		n += 1 + l + sovLedgerSettlement(uint64(l))
	}
	l = len(m.LedgerEntryCorrelationId)
	if l > 0 {
		n += 1 + l + sovLedgerSettlement(uint64(l))
	}
	if len(m.SettlementInstructions) > 0 {
		for _, e := range m.SettlementInstructions {
			l = e.Size()
			n += 1 + l + sovLedgerSettlement(uint64(l))
		}
	}
	return n
}

func (m *SettlementInstruction) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Amount.Size()
	n += 1 + l + sovLedgerSettlement(uint64(l))
	l = len(m.RecipientAddress)
	if l > 0 {
		n += 1 + l + sovLedgerSettlement(uint64(l))
	}
	if m.Status != 0 {
		n += 1 + sovLedgerSettlement(uint64(m.Status))
	}
	l = len(m.Memo)
	if l > 0 {
		n += 1 + l + sovLedgerSettlement(uint64(l))
	}
	return n
}

func (m *StoredSettlementInstructions) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.SettlementInstructions) > 0 {
		for _, e := range m.SettlementInstructions {
			l = e.Size()
			n += 1 + l + sovLedgerSettlement(uint64(l))
		}
	}
	return n
}

func sovLedgerSettlement(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozLedgerSettlement(x uint64) (n int) {
	return sovLedgerSettlement(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *FundTransferWithSettlement) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowLedgerSettlement
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: FundTransferWithSettlement: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: FundTransferWithSettlement: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Key == nil {
				m.Key = &LedgerKey{}
			}
			if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field LedgerEntryCorrelationId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.LedgerEntryCorrelationId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field SettlementInstructions", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.SettlementInstructions = append(m.SettlementInstructions, &SettlementInstruction{})
			if err := m.SettlementInstructions[len(m.SettlementInstructions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipLedgerSettlement(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SettlementInstruction) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowLedgerSettlement
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: SettlementInstruction: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SettlementInstruction: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.RecipientAddress = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
			}
			m.Status = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Status |= FundingTransferStatus(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Memo = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipLedgerSettlement(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *StoredSettlementInstructions) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowLedgerSettlement
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: StoredSettlementInstructions: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: StoredSettlementInstructions: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field SettlementInstructions", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.SettlementInstructions = append(m.SettlementInstructions, &SettlementInstruction{})
			if err := m.SettlementInstructions[len(m.SettlementInstructions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipLedgerSettlement(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthLedgerSettlement
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipLedgerSettlement(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowLedgerSettlement
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowLedgerSettlement
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthLedgerSettlement
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupLedgerSettlement
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthLedgerSettlement
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthLedgerSettlement        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLedgerSettlement          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLedgerSettlement = fmt.Errorf("proto: unexpected end of group")
)
