Struct stack_epic_wallet_libwallet::slate::Slate
source · pub struct Slate {
pub version_info: VersionCompatInfo,
pub num_participants: usize,
pub id: Uuid,
pub tx: Transaction,
pub amount: u64,
pub fee: u64,
pub height: u64,
pub lock_height: u64,
pub ttl_cutoff_height: Option<u64>,
pub participant_data: Vec<ParticipantData>,
pub payment_proof: Option<PaymentInfo>,
}Expand description
A ‘Slate’ is passed around to all parties to build up all of the public transaction data needed to create a finalized transaction. Callers can pass the slate around by whatever means they choose, (but we can provide some binary or JSON serialization helpers here).
Fields§
§version_info: VersionCompatInfoVersioning info
num_participants: usizeThe number of participants intended to take part in this transaction
id: UuidUnique transaction ID, selected by sender
tx: TransactionThe core transaction data: inputs, outputs, kernels, kernel offset
amount: u64base amount (excluding fee)
fee: u64fee amount
height: u64Block height for the transaction
lock_height: u64Lock height
ttl_cutoff_height: Option<u64>TTL, the block height at which wallets should refuse to process the transaction and unlock all associated outputs
participant_data: Vec<ParticipantData>Participant data, each participant in the transaction will insert their public data here. For now, 0 is sender and 1 is receiver, though this will change for multi-party
payment_proof: Option<PaymentInfo>Payment Proof
Implementations§
source§impl Slate
impl Slate
sourcepub fn parse_slate_version(slate_json: &str) -> Result<u16, Error>
pub fn parse_slate_version(slate_json: &str) -> Result<u16, Error>
Attempt to find slate version
sourcepub fn deserialize_upgrade(slate_json: &str) -> Result<Slate, Error>
pub fn deserialize_upgrade(slate_json: &str) -> Result<Slate, Error>
Recieve a slate, upgrade it to the latest version internally
sourcepub fn add_transaction_elements<K, B>(
&mut self,
keychain: &K,
builder: &B,
elems: Vec<Box<Append<K, B>>>
) -> Result<BlindingFactor, Error>where
K: Keychain,
B: ProofBuild,
pub fn add_transaction_elements<K, B>(
&mut self,
keychain: &K,
builder: &B,
elems: Vec<Box<Append<K, B>>>
) -> Result<BlindingFactor, Error>where
K: Keychain,
B: ProofBuild,
Adds selected inputs and outputs to the slate’s transaction Returns blinding factor
sourcepub fn update_kernel(&mut self)
pub fn update_kernel(&mut self)
Update the tx kernel based on kernel features derived from the current slate. The fee may change as we build a transaction and we need to update the tx kernel to reflect this during the tx building process.
sourcepub fn fill_round_1<K>(
&mut self,
keychain: &K,
sec_key: &mut SecretKey,
sec_nonce: &SecretKey,
participant_id: usize,
message: Option<String>,
use_test_rng: bool
) -> Result<(), Error>where
K: Keychain,
pub fn fill_round_1<K>(
&mut self,
keychain: &K,
sec_key: &mut SecretKey,
sec_nonce: &SecretKey,
participant_id: usize,
message: Option<String>,
use_test_rng: bool
) -> Result<(), Error>where
K: Keychain,
Completes callers part of round 1, adding public key info to the slate
sourcepub fn fill_round_2<K>(
&mut self,
keychain: &K,
sec_key: &SecretKey,
sec_nonce: &SecretKey,
participant_id: usize
) -> Result<(), Error>where
K: Keychain,
pub fn fill_round_2<K>(
&mut self,
keychain: &K,
sec_key: &SecretKey,
sec_nonce: &SecretKey,
participant_id: usize
) -> Result<(), Error>where
K: Keychain,
Completes caller’s part of round 2, completing signatures
sourcepub fn finalize<K>(&mut self, keychain: &K) -> Result<(), Error>where
K: Keychain,
pub fn finalize<K>(&mut self, keychain: &K) -> Result<(), Error>where
K: Keychain,
Creates the final signature, callable by either the sender or recipient (after phase 3: sender confirmation)
sourcepub fn participant_with_id(&self, id: usize) -> Option<ParticipantData>
pub fn participant_with_id(&self, id: usize) -> Option<ParticipantData>
Return the participant with the given id
sourcepub fn participant_messages(&self) -> ParticipantMessages
pub fn participant_messages(&self) -> ParticipantMessages
helper to return all participant messages
sourcepub fn verify_messages(&self) -> Result<(), Error>
pub fn verify_messages(&self) -> Result<(), Error>
Verifies any messages in the slate’s participant data match their signatures
sourcepub fn calc_excess<K>(&self, keychain: &K) -> Result<Commitment, Error>where
K: Keychain,
pub fn calc_excess<K>(&self, keychain: &K) -> Result<Commitment, Error>where
K: Keychain,
return the final excess
Trait Implementations§
source§impl<'de> Deserialize<'de> for Slate
impl<'de> Deserialize<'de> for Slate
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<&VersionedSlate> for Slate
impl From<&VersionedSlate> for Slate
source§fn from(slate: &VersionedSlate) -> Slate
fn from(slate: &VersionedSlate) -> Slate
source§impl From<VersionedSlate> for Slate
impl From<VersionedSlate> for Slate
source§fn from(slate: VersionedSlate) -> Slate
fn from(slate: VersionedSlate) -> Slate
Auto Trait Implementations§
impl RefUnwindSafe for Slate
impl Send for Slate
impl Sync for Slate
impl Unpin for Slate
impl UnwindSafe for Slate
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneAny for T
impl<T> CloneAny for T
§impl<'a, T> DefaultFeatures<'a> for T
impl<'a, T> DefaultFeatures<'a> for T
§fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
Box
behind a trait object of this trait.§fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
self. Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
§fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
Box
behind a trait object of this trait.§fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
self. Read more§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
ptr, which was obtained from a prior call to Self::borrow(),
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self. Read more