SignedChannelState

Enum SignedChannelState 

Source
pub enum SignedChannelState {
    Established {
        signed_contract_id: ContractId,
        counter_buffer_adaptor_signature: EcdsaAdaptorSignature,
        own_buffer_adaptor_signature: EcdsaAdaptorSignature,
        buffer_transaction: Transaction,
        is_offer: bool,
        total_collateral: Amount,
        keys_id: KeysId,
    },
    SettledOffered {
        counter_payout: Amount,
        next_per_update_point: PublicKey,
        timeout: u64,
        keys_id: KeysId,
    },
    SettledReceived {
        own_payout: Amount,
        counter_payout: Amount,
        counter_next_per_update_point: PublicKey,
        keys_id: KeysId,
    },
    SettledAccepted {
        counter_next_per_update_point: PublicKey,
        own_next_per_update_point: PublicKey,
        own_settle_adaptor_signature: EcdsaAdaptorSignature,
        settle_tx: Transaction,
        timeout: u64,
        own_payout: Amount,
        counter_payout: Amount,
        keys_id: KeysId,
    },
    SettledConfirmed {
        settle_tx: Transaction,
        counter_settle_adaptor_signature: EcdsaAdaptorSignature,
        counter_next_per_update_point: PublicKey,
        own_next_per_update_point: PublicKey,
        own_settle_adaptor_signature: EcdsaAdaptorSignature,
        timeout: u64,
        own_payout: Amount,
        counter_payout: Amount,
        keys_id: KeysId,
    },
    Settled {
        settle_tx: Transaction,
        counter_settle_adaptor_signature: EcdsaAdaptorSignature,
        own_settle_adaptor_signature: EcdsaAdaptorSignature,
        own_payout: Amount,
        counter_payout: Amount,
        keys_id: KeysId,
    },
    RenewOffered {
        offered_contract_id: ContractId,
        counter_payout: Amount,
        offer_next_per_update_point: PublicKey,
        is_offer: bool,
        timeout: u64,
        keys_id: KeysId,
    },
    RenewAccepted {
        contract_id: ContractId,
        offer_per_update_point: PublicKey,
        accept_per_update_point: PublicKey,
        buffer_transaction: Transaction,
        buffer_script_pubkey: ScriptBuf,
        timeout: u64,
        own_payout: Amount,
        keys_id: KeysId,
    },
    RenewConfirmed {
        contract_id: ContractId,
        offer_per_update_point: PublicKey,
        accept_per_update_point: PublicKey,
        buffer_transaction: Transaction,
        buffer_script_pubkey: ScriptBuf,
        offer_buffer_adaptor_signature: EcdsaAdaptorSignature,
        timeout: u64,
        own_payout: Amount,
        total_collateral: Amount,
        keys_id: KeysId,
    },
    RenewFinalized {
        contract_id: ContractId,
        prev_offer_per_update_point: PublicKey,
        buffer_transaction: Transaction,
        buffer_script_pubkey: ScriptBuf,
        offer_buffer_adaptor_signature: EcdsaAdaptorSignature,
        accept_buffer_adaptor_signature: EcdsaAdaptorSignature,
        timeout: u64,
        own_payout: Amount,
        total_collateral: Amount,
        keys_id: KeysId,
    },
    Closing {
        buffer_transaction: Transaction,
        contract_id: ContractId,
        is_initiator: bool,
        keys_id: KeysId,
    },
    CollaborativeCloseOffered {
        counter_payout: Amount,
        offer_signature: Signature,
        close_tx: Transaction,
        timeout: u64,
        keys_id: KeysId,
    },
}
Expand description

Contains the possible states in which a SignedChannel can be.

Variants§

§

Established

A SignedChannel is in Established state when a contract is fully setup inside the channel.

Fields

§signed_contract_id: ContractId

The crate::ContractId of the contract currently setup in the channel.

§counter_buffer_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature created by the counter party for the buffer transaction.

§own_buffer_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature created by the local party for the buffer transaction.

§buffer_transaction: Transaction

The buffer transaction for the current channel state.

§is_offer: bool

Whether the local party is the one that initiated the latest channel state change.

§total_collateral: Amount

The total amount of collateral in the channel

§keys_id: KeysId

Keys Id for generating the signers

§

SettledOffered

A SignedChannel is in SettledOffered state when the local party has sent a [dlc_messages::channel::SettleOffer] message.

Fields

§counter_payout: Amount

The payout that was proposed to the counter party.

§next_per_update_point: PublicKey

The per update point that the local party would use for the next channel state.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§keys_id: KeysId

Keys Id for generating the signers

§

SettledReceived

A SignedChannel is in SettledReceived state when the local party has received a [dlc_messages::channel::SettleOffer] message.

Fields

§own_payout: Amount

The payout that was proposed to the local party to settle the channel.

§counter_payout: Amount

The payout that was proposed to the counter party.

§counter_next_per_update_point: PublicKey

The per update point to be used by the counter party for the setup of the next channel state.

§keys_id: KeysId

Keys Id for generating the signers

§

SettledAccepted

A SignedChannel is in SettledAccepted state when the local party has sent a [dlc_messages::channel::SettleAccept] message.

Fields

§counter_next_per_update_point: PublicKey

The per update point to be used by the counter party for the setup of the next channel state.

§own_next_per_update_point: PublicKey

The per update point to be used by the local party for the setup of the next channel state.

§own_settle_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the settle transaction generated by the local party.

§settle_tx: Transaction

The settle transaction.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§own_payout: Amount

The payout to the local party after settling the channel.

§counter_payout: Amount

The payout that was proposed to the counter party.

§keys_id: KeysId

Keys Id for generating the signers

§

SettledConfirmed

A SignedChannel is in SettledConfirmed state when the local party has sent a [dlc_messages::channel::SettleConfirm] message.

Fields

§settle_tx: Transaction

The settle transaction.

§counter_settle_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the settle transaction generated by the counter party.

§counter_next_per_update_point: PublicKey

The per update point to be used by the counter party for the setup of the next channel state.

§own_next_per_update_point: PublicKey

The per update point to be used by the local party for the setup of the next channel state.

§own_settle_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the settle transaction generated by the local party.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§own_payout: Amount

The payout to the local party after settling the channel.

§counter_payout: Amount

The payout that was proposed to the counter party.

§keys_id: KeysId

Keys Id for generating the signers

§

Settled

A SignedChannel is in Settled state when the local party has all the necessary information to close the channel with the last agreed upon settled state.

Fields

§settle_tx: Transaction

The settle transaction that can be used to close the channel.

§counter_settle_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the settle transaction generated by the counter party.

§own_settle_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the settle transaction generated by the local party.

§own_payout: Amount

The amount the local party holds in the channel.

§counter_payout: Amount

The amount the counter party holds in the channel.

§keys_id: KeysId

Keys Id for generating the signers

§

RenewOffered

A SignedChannel is in RenewOffered state when the local party has sent or received a [dlc_messages::channel::RenewOffer] message.

Fields

§offered_contract_id: ContractId

The temporary crate::ContractId of the offered contract.

§counter_payout: Amount

The payout offered to settle the previous channel state.

§offer_next_per_update_point: PublicKey

The per update point to be used by the offer party for the setup of the next channel state.

§is_offer: bool

Indicates whether the local party offered the renewal or not.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§keys_id: KeysId

Keys Id for generating the signers

§

RenewAccepted

A SignedChannel is in RenewAccepted state when the local party has sent a [dlc_messages::channel::RenewAccept] message.

Fields

§contract_id: ContractId

The crate::ContractId of the offered contract.

§offer_per_update_point: PublicKey

The per update point to be used by the offer party for the setup of the next channel state.

§accept_per_update_point: PublicKey

The per update point to be used by the accept party for the setup of the next channel state.

§buffer_transaction: Transaction

The buffer transaction.

§buffer_script_pubkey: ScriptBuf

The buffer transaction script pubkey.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§own_payout: Amount

The payout to the local party attributed for closing the previous state.

§keys_id: KeysId

Keys Id for generating the signers

§

RenewConfirmed

A SignedChannel is in RenewConfirmed state when the local party has sent a [dlc_messages::channel::RenewConfirm] message.

Fields

§contract_id: ContractId

The crate::ContractId of the offered contract.

§offer_per_update_point: PublicKey

The per update point to be used by the offer party for the setup of the next channel state.

§accept_per_update_point: PublicKey

The per update point to be used by the accept party for the setup of the next channel state.

§buffer_transaction: Transaction

The buffer transaction.

§buffer_script_pubkey: ScriptBuf

The buffer transaction script pubkey.

§offer_buffer_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the buffer transaction generated by the offer party.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§own_payout: Amount

The payout to the local party attributed for closing the previous state.

§total_collateral: Amount

The total amount of collateral in the channel.

§keys_id: KeysId

Keys Id for generating the signers

§

RenewFinalized

Finalize the renewal of the contract within a DLC channel.

Fields

§contract_id: ContractId

The crate::ContractId of the offered contract.

§prev_offer_per_update_point: PublicKey

The previous per update point that was used by the offer party for the previous state of the channel.

§buffer_transaction: Transaction

The buffer transaction.

§buffer_script_pubkey: ScriptBuf

The buffer transaction script pubkey.

§offer_buffer_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the buffer transaction generated by the offer party.

§accept_buffer_adaptor_signature: EcdsaAdaptorSignature

The adaptor signature for the buffer transaction generated by the accept party.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§own_payout: Amount

The payout to the local party attributed for closing the previous state.

§total_collateral: Amount

The total amount of collateral in the channel.

§keys_id: KeysId

Keys Id for generating the signers

§

Closing

A SignedChannel is in Closing state when the local party has broadcast a buffer transaction and is waiting to finalize the closing of a the channel by broadcasting a CET.

Fields

§buffer_transaction: Transaction

The buffer transaction that was broadcast.

§contract_id: ContractId

The crate::ContractId of the contract that was used to close the channel.

§is_initiator: bool

Whether the party is the initiator of the closing.

§keys_id: KeysId

Keys Id for generating the signers

§

CollaborativeCloseOffered

A SignedChannel is in CollaborativeCloseOffered state when the local party has sent a [dlc_messages::channel::CollaborativeCloseOffer] message.

Fields

§counter_payout: Amount

The payout offered to the counter party to close the channel.

§offer_signature: Signature

The signature of the local party for the closing transaction.

§close_tx: Transaction

The closing transaction.

§timeout: u64

The UNIX epoch at which the counter party will be considered unresponsive and the channel will be forced closed.

§keys_id: KeysId

Keys Id for generating the signers

Implementations§

Source§

impl SignedChannelState

Source

pub fn is_of_type(&self, t: &SignedChannelStateType) -> bool

Returns whether the variant is of the given type.

Source

pub fn get_type(&self) -> SignedChannelStateType

Returns the type associated with the variant.

Trait Implementations§

Source§

impl Clone for SignedChannelState

Source§

fn clone(&self) -> SignedChannelState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SignedChannelState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SignedChannelState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SignedChannelState

Source§

fn eq(&self, other: &SignedChannelState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Readable for SignedChannelState

Source§

fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError>

Reads a Self in from the given Read.
Source§

impl Writeable for SignedChannelState

Source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

Writes self out to the given Writer.
Source§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.
Source§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.
Source§

impl Eq for SignedChannelState

Source§

impl StructuralPartialEq for SignedChannelState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeReadable for T
where T: Readable,

Source§

fn read<R>(reader: &mut R) -> Result<Option<T>, DecodeError>
where R: Read,

Reads a Self in from the given Read.
Source§

impl<T> Serializable for T
where T: Writeable + Readable,

Source§

fn serialize(&self) -> Result<Vec<u8>, Error>

Serialize the object.
Source§

fn deserialize<R>(reader: &mut R) -> Result<T, DecodeError>
where R: Read,

Deserialize the object.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more