[][src]Struct grin_wallet_libwallet::Context

pub struct Context {
    pub parent_key_id: Identifier,
    pub sec_key: SecretKey,
    pub sec_nonce: SecretKey,
    pub output_ids: Vec<(Identifier, Option<u64>, u64)>,
    pub input_ids: Vec<(Identifier, Option<u64>, u64)>,
    pub fee: u64,
    pub participant_id: usize,
}

Holds the context for a single aggsig transaction

Fields

parent_key_id: Identifier

Parent key id

sec_key: SecretKey

Secret key (of which public is shared)

sec_nonce: SecretKey

Secret nonce (of which public is shared) (basically a SecretKey)

output_ids: Vec<(Identifier, Option<u64>, u64)>

store my outputs + amounts between invocations Id, mmr_index (if known), amount

input_ids: Vec<(Identifier, Option<u64>, u64)>

store my inputs Id, mmr_index (if known), amount

fee: u64

store the calculated fee

participant_id: usize

keep track of the participant id

Methods

impl Context[src]

pub fn new(
    secp: &Secp256k1,
    sec_key: SecretKey,
    parent_key_id: &Identifier,
    use_test_rng: bool,
    participant_id: usize
) -> Context
[src]

Create a new context with defaults

impl Context[src]

pub fn add_output(
    &mut self,
    output_id: &Identifier,
    mmr_index: &Option<u64>,
    amount: u64
)
[src]

Tracks an output contributing to my excess value (if it needs to be kept between invocations

pub fn get_outputs(&self) -> Vec<(Identifier, Option<u64>, u64)>[src]

Returns all stored outputs

pub fn add_input(
    &mut self,
    input_id: &Identifier,
    mmr_index: &Option<u64>,
    amount: u64
)
[src]

Tracks IDs of my inputs into the transaction be kept between invocations

pub fn get_inputs(&self) -> Vec<(Identifier, Option<u64>, u64)>[src]

Returns all stored input identifiers

pub fn get_private_keys(&self) -> (SecretKey, SecretKey)[src]

Returns private key, private nonce

pub fn get_public_keys(&self, secp: &Secp256k1) -> (PublicKey, PublicKey)[src]

Returns public key, public nonce

Trait Implementations

impl Clone for Context[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Context[src]

impl Serialize for Context[src]

impl<'de> Deserialize<'de> for Context[src]

impl Writeable for Context[src]

impl Readable for Context[src]

Auto Trait Implementations

impl Send for Context

impl Unpin for Context

impl Sync for Context

impl UnwindSafe for Context

impl RefUnwindSafe for Context

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Send + Sync + Clone

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

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