lnrpc.Failure.scala Maven / Gradle / Ivy
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package lnrpc
import org.bitcoins.lnd.rpc.LndUtils._
/** @param code
* Failure code as defined in the Lightning spec
* @param channelUpdate
* An optional channel update message.
* @param htlcMsat
* A failure type-dependent htlc value.
* @param onionSha256
* The sha256 sum of the onion payload.
* @param cltvExpiry
* A failure type-dependent cltv expiry value.
* @param flags
* A failure type-dependent flags value.
* @param failureSourceIndex
*
* The position in the path of the intermediate or final node that generated
* the failure message. Position zero is the sender node.
* @param height
* A failure type-dependent block height.
*/
@SerialVersionUID(0L)
final case class Failure(
code: lnrpc.Failure.FailureCode = lnrpc.Failure.FailureCode.RESERVED,
channelUpdate: _root_.scala.Option[lnrpc.ChannelUpdate] = _root_.scala.None,
htlcMsat: org.bitcoins.core.number.UInt64 = lnrpc.Failure._typemapper_htlcMsat.toCustom(0L),
onionSha256: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
cltvExpiry: org.bitcoins.core.number.UInt32 = lnrpc.Failure._typemapper_cltvExpiry.toCustom(0),
flags: org.bitcoins.core.number.UInt32 = lnrpc.Failure._typemapper_flags.toCustom(0),
failureSourceIndex: org.bitcoins.core.number.UInt32 = lnrpc.Failure._typemapper_failureSourceIndex.toCustom(0),
height: org.bitcoins.core.number.UInt32 = lnrpc.Failure._typemapper_height.toCustom(0),
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Failure] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = code.value
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value)
}
};
if (channelUpdate.isDefined) {
val __value = channelUpdate.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
{
val __value = lnrpc.Failure._typemapper_htlcMsat.toBase(htlcMsat)
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(4, __value)
}
};
{
val __value = onionSha256
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(5, __value)
}
};
{
val __value = lnrpc.Failure._typemapper_cltvExpiry.toBase(cltvExpiry)
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(6, __value)
}
};
{
val __value = lnrpc.Failure._typemapper_flags.toBase(flags)
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(7, __value)
}
};
{
val __value = lnrpc.Failure._typemapper_failureSourceIndex.toBase(failureSourceIndex)
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(8, __value)
}
};
{
val __value = lnrpc.Failure._typemapper_height.toBase(height)
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(9, __value)
}
};
__size += unknownFields.serializedSize
__size
}
override def serializedSize: _root_.scala.Int = {
var __size = __serializedSizeMemoized
if (__size == 0) {
__size = __computeSerializedSize() + 1
__serializedSizeMemoized = __size
}
__size - 1
}
def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
{
val __v = code.value
if (__v != 0) {
_output__.writeEnum(1, __v)
}
};
channelUpdate.foreach { __v =>
val __m = __v
_output__.writeTag(3, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
{
val __v = lnrpc.Failure._typemapper_htlcMsat.toBase(htlcMsat)
if (__v != 0L) {
_output__.writeUInt64(4, __v)
}
};
{
val __v = onionSha256
if (!__v.isEmpty) {
_output__.writeBytes(5, __v)
}
};
{
val __v = lnrpc.Failure._typemapper_cltvExpiry.toBase(cltvExpiry)
if (__v != 0) {
_output__.writeUInt32(6, __v)
}
};
{
val __v = lnrpc.Failure._typemapper_flags.toBase(flags)
if (__v != 0) {
_output__.writeUInt32(7, __v)
}
};
{
val __v = lnrpc.Failure._typemapper_failureSourceIndex.toBase(failureSourceIndex)
if (__v != 0) {
_output__.writeUInt32(8, __v)
}
};
{
val __v = lnrpc.Failure._typemapper_height.toBase(height)
if (__v != 0) {
_output__.writeUInt32(9, __v)
}
};
unknownFields.writeTo(_output__)
}
def withCode(__v: lnrpc.Failure.FailureCode): Failure = copy(code = __v)
def getChannelUpdate: lnrpc.ChannelUpdate = channelUpdate.getOrElse(lnrpc.ChannelUpdate.defaultInstance)
def clearChannelUpdate: Failure = copy(channelUpdate = _root_.scala.None)
def withChannelUpdate(__v: lnrpc.ChannelUpdate): Failure = copy(channelUpdate = Option(__v))
def withHtlcMsat(__v: org.bitcoins.core.number.UInt64): Failure = copy(htlcMsat = __v)
def withOnionSha256(__v: _root_.com.google.protobuf.ByteString): Failure = copy(onionSha256 = __v)
def withCltvExpiry(__v: org.bitcoins.core.number.UInt32): Failure = copy(cltvExpiry = __v)
def withFlags(__v: org.bitcoins.core.number.UInt32): Failure = copy(flags = __v)
def withFailureSourceIndex(__v: org.bitcoins.core.number.UInt32): Failure = copy(failureSourceIndex = __v)
def withHeight(__v: org.bitcoins.core.number.UInt32): Failure = copy(height = __v)
def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 1 => {
val __t = code.javaValueDescriptor
if (__t.getNumber() != 0) __t else null
}
case 3 => channelUpdate.orNull
case 4 => {
val __t = lnrpc.Failure._typemapper_htlcMsat.toBase(htlcMsat)
if (__t != 0L) __t else null
}
case 5 => {
val __t = onionSha256
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 6 => {
val __t = lnrpc.Failure._typemapper_cltvExpiry.toBase(cltvExpiry)
if (__t != 0) __t else null
}
case 7 => {
val __t = lnrpc.Failure._typemapper_flags.toBase(flags)
if (__t != 0) __t else null
}
case 8 => {
val __t = lnrpc.Failure._typemapper_failureSourceIndex.toBase(failureSourceIndex)
if (__t != 0) __t else null
}
case 9 => {
val __t = lnrpc.Failure._typemapper_height.toBase(height)
if (__t != 0) __t else null
}
}
}
def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
_root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
(__field.number: @_root_.scala.unchecked) match {
case 1 => _root_.scalapb.descriptors.PEnum(code.scalaValueDescriptor)
case 3 => channelUpdate.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 4 => _root_.scalapb.descriptors.PLong(lnrpc.Failure._typemapper_htlcMsat.toBase(htlcMsat))
case 5 => _root_.scalapb.descriptors.PByteString(onionSha256)
case 6 => _root_.scalapb.descriptors.PInt(lnrpc.Failure._typemapper_cltvExpiry.toBase(cltvExpiry))
case 7 => _root_.scalapb.descriptors.PInt(lnrpc.Failure._typemapper_flags.toBase(flags))
case 8 => _root_.scalapb.descriptors.PInt(lnrpc.Failure._typemapper_failureSourceIndex.toBase(failureSourceIndex))
case 9 => _root_.scalapb.descriptors.PInt(lnrpc.Failure._typemapper_height.toBase(height))
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: lnrpc.Failure.type = lnrpc.Failure
// @@protoc_insertion_point(GeneratedMessage[lnrpc.Failure])
}
object Failure extends scalapb.GeneratedMessageCompanion[lnrpc.Failure] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.Failure] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.Failure = {
var __code: lnrpc.Failure.FailureCode = lnrpc.Failure.FailureCode.RESERVED
var __channelUpdate: _root_.scala.Option[lnrpc.ChannelUpdate] = _root_.scala.None
var __htlcMsat: _root_.scala.Long = 0L
var __onionSha256: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __cltvExpiry: _root_.scala.Int = 0
var __flags: _root_.scala.Int = 0
var __failureSourceIndex: _root_.scala.Int = 0
var __height: _root_.scala.Int = 0
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 8 =>
__code = lnrpc.Failure.FailureCode.fromValue(_input__.readEnum())
case 26 =>
__channelUpdate = Option(__channelUpdate.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.ChannelUpdate](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 32 =>
__htlcMsat = _input__.readUInt64()
case 42 =>
__onionSha256 = _input__.readBytes()
case 48 =>
__cltvExpiry = _input__.readUInt32()
case 56 =>
__flags = _input__.readUInt32()
case 64 =>
__failureSourceIndex = _input__.readUInt32()
case 72 =>
__height = _input__.readUInt32()
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
lnrpc.Failure(
code = __code,
channelUpdate = __channelUpdate,
htlcMsat = lnrpc.Failure._typemapper_htlcMsat.toCustom(__htlcMsat),
onionSha256 = __onionSha256,
cltvExpiry = lnrpc.Failure._typemapper_cltvExpiry.toCustom(__cltvExpiry),
flags = lnrpc.Failure._typemapper_flags.toCustom(__flags),
failureSourceIndex = lnrpc.Failure._typemapper_failureSourceIndex.toCustom(__failureSourceIndex),
height = lnrpc.Failure._typemapper_height.toCustom(__height),
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.Failure] = _root_.scalapb.descriptors.Reads{
case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
_root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
lnrpc.Failure(
code = lnrpc.Failure.FailureCode.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(lnrpc.Failure.FailureCode.RESERVED.scalaValueDescriptor).number),
channelUpdate = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[lnrpc.ChannelUpdate]]),
htlcMsat = lnrpc.Failure._typemapper_htlcMsat.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
onionSha256 = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
cltvExpiry = lnrpc.Failure._typemapper_cltvExpiry.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
flags = lnrpc.Failure._typemapper_flags.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
failureSourceIndex = lnrpc.Failure._typemapper_failureSourceIndex.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
height = lnrpc.Failure._typemapper_height.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Int]).getOrElse(0))
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(180)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(180)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 3 => __out = lnrpc.ChannelUpdate
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 1 => lnrpc.Failure.FailureCode
}
}
lazy val defaultInstance = lnrpc.Failure(
code = lnrpc.Failure.FailureCode.RESERVED,
channelUpdate = _root_.scala.None,
htlcMsat = lnrpc.Failure._typemapper_htlcMsat.toCustom(0L),
onionSha256 = _root_.com.google.protobuf.ByteString.EMPTY,
cltvExpiry = lnrpc.Failure._typemapper_cltvExpiry.toCustom(0),
flags = lnrpc.Failure._typemapper_flags.toCustom(0),
failureSourceIndex = lnrpc.Failure._typemapper_failureSourceIndex.toCustom(0),
height = lnrpc.Failure._typemapper_height.toCustom(0)
)
sealed abstract class FailureCode(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
type EnumType = FailureCode
def isReserved: _root_.scala.Boolean = false
def isIncorrectOrUnknownPaymentDetails: _root_.scala.Boolean = false
def isIncorrectPaymentAmount: _root_.scala.Boolean = false
def isFinalIncorrectCltvExpiry: _root_.scala.Boolean = false
def isFinalIncorrectHtlcAmount: _root_.scala.Boolean = false
def isFinalExpiryTooSoon: _root_.scala.Boolean = false
def isInvalidRealm: _root_.scala.Boolean = false
def isExpiryTooSoon: _root_.scala.Boolean = false
def isInvalidOnionVersion: _root_.scala.Boolean = false
def isInvalidOnionHmac: _root_.scala.Boolean = false
def isInvalidOnionKey: _root_.scala.Boolean = false
def isAmountBelowMinimum: _root_.scala.Boolean = false
def isFeeInsufficient: _root_.scala.Boolean = false
def isIncorrectCltvExpiry: _root_.scala.Boolean = false
def isChannelDisabled: _root_.scala.Boolean = false
def isTemporaryChannelFailure: _root_.scala.Boolean = false
def isRequiredNodeFeatureMissing: _root_.scala.Boolean = false
def isRequiredChannelFeatureMissing: _root_.scala.Boolean = false
def isUnknownNextPeer: _root_.scala.Boolean = false
def isTemporaryNodeFailure: _root_.scala.Boolean = false
def isPermanentNodeFailure: _root_.scala.Boolean = false
def isPermanentChannelFailure: _root_.scala.Boolean = false
def isExpiryTooFar: _root_.scala.Boolean = false
def isMppTimeout: _root_.scala.Boolean = false
def isInvalidOnionPayload: _root_.scala.Boolean = false
def isInternalFailure: _root_.scala.Boolean = false
def isUnknownFailure: _root_.scala.Boolean = false
def isUnreadableFailure: _root_.scala.Boolean = false
def companion: _root_.scalapb.GeneratedEnumCompanion[FailureCode] = lnrpc.Failure.FailureCode
final def asRecognized: _root_.scala.Option[lnrpc.Failure.FailureCode.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[lnrpc.Failure.FailureCode.Recognized])
}
object FailureCode extends _root_.scalapb.GeneratedEnumCompanion[FailureCode] {
sealed trait Recognized extends FailureCode
implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[FailureCode] = this
/**
* The numbers assigned in this enumeration match the failure codes as
* defined in BOLT #4. Because protobuf 3 requires enums to start with 0,
* a RESERVED value is added.
*/
@SerialVersionUID(0L)
case object RESERVED extends FailureCode(0) with FailureCode.Recognized {
val index = 0
val name = "RESERVED"
override def isReserved: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS extends FailureCode(1) with FailureCode.Recognized {
val index = 1
val name = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"
override def isIncorrectOrUnknownPaymentDetails: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INCORRECT_PAYMENT_AMOUNT extends FailureCode(2) with FailureCode.Recognized {
val index = 2
val name = "INCORRECT_PAYMENT_AMOUNT"
override def isIncorrectPaymentAmount: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object FINAL_INCORRECT_CLTV_EXPIRY extends FailureCode(3) with FailureCode.Recognized {
val index = 3
val name = "FINAL_INCORRECT_CLTV_EXPIRY"
override def isFinalIncorrectCltvExpiry: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object FINAL_INCORRECT_HTLC_AMOUNT extends FailureCode(4) with FailureCode.Recognized {
val index = 4
val name = "FINAL_INCORRECT_HTLC_AMOUNT"
override def isFinalIncorrectHtlcAmount: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object FINAL_EXPIRY_TOO_SOON extends FailureCode(5) with FailureCode.Recognized {
val index = 5
val name = "FINAL_EXPIRY_TOO_SOON"
override def isFinalExpiryTooSoon: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INVALID_REALM extends FailureCode(6) with FailureCode.Recognized {
val index = 6
val name = "INVALID_REALM"
override def isInvalidRealm: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object EXPIRY_TOO_SOON extends FailureCode(7) with FailureCode.Recognized {
val index = 7
val name = "EXPIRY_TOO_SOON"
override def isExpiryTooSoon: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INVALID_ONION_VERSION extends FailureCode(8) with FailureCode.Recognized {
val index = 8
val name = "INVALID_ONION_VERSION"
override def isInvalidOnionVersion: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INVALID_ONION_HMAC extends FailureCode(9) with FailureCode.Recognized {
val index = 9
val name = "INVALID_ONION_HMAC"
override def isInvalidOnionHmac: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INVALID_ONION_KEY extends FailureCode(10) with FailureCode.Recognized {
val index = 10
val name = "INVALID_ONION_KEY"
override def isInvalidOnionKey: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object AMOUNT_BELOW_MINIMUM extends FailureCode(11) with FailureCode.Recognized {
val index = 11
val name = "AMOUNT_BELOW_MINIMUM"
override def isAmountBelowMinimum: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object FEE_INSUFFICIENT extends FailureCode(12) with FailureCode.Recognized {
val index = 12
val name = "FEE_INSUFFICIENT"
override def isFeeInsufficient: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INCORRECT_CLTV_EXPIRY extends FailureCode(13) with FailureCode.Recognized {
val index = 13
val name = "INCORRECT_CLTV_EXPIRY"
override def isIncorrectCltvExpiry: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object CHANNEL_DISABLED extends FailureCode(14) with FailureCode.Recognized {
val index = 14
val name = "CHANNEL_DISABLED"
override def isChannelDisabled: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object TEMPORARY_CHANNEL_FAILURE extends FailureCode(15) with FailureCode.Recognized {
val index = 15
val name = "TEMPORARY_CHANNEL_FAILURE"
override def isTemporaryChannelFailure: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object REQUIRED_NODE_FEATURE_MISSING extends FailureCode(16) with FailureCode.Recognized {
val index = 16
val name = "REQUIRED_NODE_FEATURE_MISSING"
override def isRequiredNodeFeatureMissing: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object REQUIRED_CHANNEL_FEATURE_MISSING extends FailureCode(17) with FailureCode.Recognized {
val index = 17
val name = "REQUIRED_CHANNEL_FEATURE_MISSING"
override def isRequiredChannelFeatureMissing: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object UNKNOWN_NEXT_PEER extends FailureCode(18) with FailureCode.Recognized {
val index = 18
val name = "UNKNOWN_NEXT_PEER"
override def isUnknownNextPeer: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object TEMPORARY_NODE_FAILURE extends FailureCode(19) with FailureCode.Recognized {
val index = 19
val name = "TEMPORARY_NODE_FAILURE"
override def isTemporaryNodeFailure: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object PERMANENT_NODE_FAILURE extends FailureCode(20) with FailureCode.Recognized {
val index = 20
val name = "PERMANENT_NODE_FAILURE"
override def isPermanentNodeFailure: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object PERMANENT_CHANNEL_FAILURE extends FailureCode(21) with FailureCode.Recognized {
val index = 21
val name = "PERMANENT_CHANNEL_FAILURE"
override def isPermanentChannelFailure: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object EXPIRY_TOO_FAR extends FailureCode(22) with FailureCode.Recognized {
val index = 22
val name = "EXPIRY_TOO_FAR"
override def isExpiryTooFar: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object MPP_TIMEOUT extends FailureCode(23) with FailureCode.Recognized {
val index = 23
val name = "MPP_TIMEOUT"
override def isMppTimeout: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object INVALID_ONION_PAYLOAD extends FailureCode(24) with FailureCode.Recognized {
val index = 24
val name = "INVALID_ONION_PAYLOAD"
override def isInvalidOnionPayload: _root_.scala.Boolean = true
}
/**
* An internal error occurred.
*/
@SerialVersionUID(0L)
case object INTERNAL_FAILURE extends FailureCode(997) with FailureCode.Recognized {
val index = 25
val name = "INTERNAL_FAILURE"
override def isInternalFailure: _root_.scala.Boolean = true
}
/**
* The error source is known, but the failure itself couldn't be decoded.
*/
@SerialVersionUID(0L)
case object UNKNOWN_FAILURE extends FailureCode(998) with FailureCode.Recognized {
val index = 26
val name = "UNKNOWN_FAILURE"
override def isUnknownFailure: _root_.scala.Boolean = true
}
/**
* An unreadable failure result is returned if the received failure message
* cannot be decrypted. In that case the error source is unknown.
*/
@SerialVersionUID(0L)
case object UNREADABLE_FAILURE extends FailureCode(999) with FailureCode.Recognized {
val index = 27
val name = "UNREADABLE_FAILURE"
override def isUnreadableFailure: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends FailureCode(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
lazy val values = scala.collection.immutable.Seq(RESERVED, INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS, INCORRECT_PAYMENT_AMOUNT, FINAL_INCORRECT_CLTV_EXPIRY, FINAL_INCORRECT_HTLC_AMOUNT, FINAL_EXPIRY_TOO_SOON, INVALID_REALM, EXPIRY_TOO_SOON, INVALID_ONION_VERSION, INVALID_ONION_HMAC, INVALID_ONION_KEY, AMOUNT_BELOW_MINIMUM, FEE_INSUFFICIENT, INCORRECT_CLTV_EXPIRY, CHANNEL_DISABLED, TEMPORARY_CHANNEL_FAILURE, REQUIRED_NODE_FEATURE_MISSING, REQUIRED_CHANNEL_FEATURE_MISSING, UNKNOWN_NEXT_PEER, TEMPORARY_NODE_FAILURE, PERMANENT_NODE_FAILURE, PERMANENT_CHANNEL_FAILURE, EXPIRY_TOO_FAR, MPP_TIMEOUT, INVALID_ONION_PAYLOAD, INTERNAL_FAILURE, UNKNOWN_FAILURE, UNREADABLE_FAILURE)
def fromValue(__value: _root_.scala.Int): FailureCode = __value match {
case 0 => RESERVED
case 1 => INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS
case 2 => INCORRECT_PAYMENT_AMOUNT
case 3 => FINAL_INCORRECT_CLTV_EXPIRY
case 4 => FINAL_INCORRECT_HTLC_AMOUNT
case 5 => FINAL_EXPIRY_TOO_SOON
case 6 => INVALID_REALM
case 7 => EXPIRY_TOO_SOON
case 8 => INVALID_ONION_VERSION
case 9 => INVALID_ONION_HMAC
case 10 => INVALID_ONION_KEY
case 11 => AMOUNT_BELOW_MINIMUM
case 12 => FEE_INSUFFICIENT
case 13 => INCORRECT_CLTV_EXPIRY
case 14 => CHANNEL_DISABLED
case 15 => TEMPORARY_CHANNEL_FAILURE
case 16 => REQUIRED_NODE_FEATURE_MISSING
case 17 => REQUIRED_CHANNEL_FEATURE_MISSING
case 18 => UNKNOWN_NEXT_PEER
case 19 => TEMPORARY_NODE_FAILURE
case 20 => PERMANENT_NODE_FAILURE
case 21 => PERMANENT_CHANNEL_FAILURE
case 22 => EXPIRY_TOO_FAR
case 23 => MPP_TIMEOUT
case 24 => INVALID_ONION_PAYLOAD
case 997 => INTERNAL_FAILURE
case 998 => UNKNOWN_FAILURE
case 999 => UNREADABLE_FAILURE
case __other => Unrecognized(__other)
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = lnrpc.Failure.javaDescriptor.getEnumTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = lnrpc.Failure.scalaDescriptor.enums(0)
}
implicit class FailureLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Failure]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.Failure](_l) {
def code: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Failure.FailureCode] = field(_.code)((c_, f_) => c_.copy(code = f_))
def channelUpdate: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.ChannelUpdate] = field(_.getChannelUpdate)((c_, f_) => c_.copy(channelUpdate = Option(f_)))
def optionalChannelUpdate: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.ChannelUpdate]] = field(_.channelUpdate)((c_, f_) => c_.copy(channelUpdate = f_))
def htlcMsat: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.htlcMsat)((c_, f_) => c_.copy(htlcMsat = f_))
def onionSha256: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.onionSha256)((c_, f_) => c_.copy(onionSha256 = f_))
def cltvExpiry: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.cltvExpiry)((c_, f_) => c_.copy(cltvExpiry = f_))
def flags: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.flags)((c_, f_) => c_.copy(flags = f_))
def failureSourceIndex: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.failureSourceIndex)((c_, f_) => c_.copy(failureSourceIndex = f_))
def height: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.height)((c_, f_) => c_.copy(height = f_))
}
final val CODE_FIELD_NUMBER = 1
final val CHANNEL_UPDATE_FIELD_NUMBER = 3
final val HTLC_MSAT_FIELD_NUMBER = 4
final val ONION_SHA_256_FIELD_NUMBER = 5
final val CLTV_EXPIRY_FIELD_NUMBER = 6
final val FLAGS_FIELD_NUMBER = 7
final val FAILURE_SOURCE_INDEX_FIELD_NUMBER = 8
final val HEIGHT_FIELD_NUMBER = 9
@transient
private[lnrpc] val _typemapper_htlcMsat: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
@transient
private[lnrpc] val _typemapper_cltvExpiry: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
@transient
private[lnrpc] val _typemapper_flags: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
@transient
private[lnrpc] val _typemapper_failureSourceIndex: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
@transient
private[lnrpc] val _typemapper_height: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
def of(
code: lnrpc.Failure.FailureCode,
channelUpdate: _root_.scala.Option[lnrpc.ChannelUpdate],
htlcMsat: org.bitcoins.core.number.UInt64,
onionSha256: _root_.com.google.protobuf.ByteString,
cltvExpiry: org.bitcoins.core.number.UInt32,
flags: org.bitcoins.core.number.UInt32,
failureSourceIndex: org.bitcoins.core.number.UInt32,
height: org.bitcoins.core.number.UInt32
): _root_.lnrpc.Failure = _root_.lnrpc.Failure(
code,
channelUpdate,
htlcMsat,
onionSha256,
cltvExpiry,
flags,
failureSourceIndex,
height
)
// @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.Failure])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy