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.
SettledOffered
A SignedChannel
is in SettledOffered
state when the local party
has sent a [dlc_messages::channel::SettleOffer
] message.
Fields
next_per_update_point: PublicKey
The per update point that the local party would use for the next channel state.
SettledReceived
A SignedChannel
is in SettledReceived
state when the local party
has received a [dlc_messages::channel::SettleOffer
] message.
Fields
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.
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.
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.
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.
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.
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.
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.
offer_buffer_adaptor_signature: EcdsaAdaptorSignature
The adaptor signature for the buffer transaction generated by the offer party.
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.
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.
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.
CollaborativeCloseOffered
A SignedChannel
is in CollaborativeCloseOffered
state when the local party
has sent a [dlc_messages::channel::CollaborativeCloseOffer
] message.
Fields
close_tx: Transaction
The closing transaction.
Implementations§
Source§impl SignedChannelState
impl SignedChannelState
Sourcepub fn is_of_type(&self, t: &SignedChannelStateType) -> bool
pub fn is_of_type(&self, t: &SignedChannelStateType) -> bool
Returns whether the variant is of the given type.
Sourcepub fn get_type(&self) -> SignedChannelStateType
pub fn get_type(&self) -> SignedChannelStateType
Returns the type associated with the variant.
Trait Implementations§
Source§impl Clone for SignedChannelState
impl Clone for SignedChannelState
Source§fn clone(&self) -> SignedChannelState
fn clone(&self) -> SignedChannelState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more