Struct sn_transfers::WalletReplica [−][src]
The Replica is the part of an AT2 system that forms validating groups, and signs individual transfers between wallets. Replicas validate requests to debit an wallet, and apply operations that has a valid “debit agreement proof” from the group, i.e. signatures from a quorum of its peers. Replicas don’t initiate transfers or drive the algo - only Actors do.
Implementations
impl WalletReplica
[src]
pub fn from_history(
id: OwnerType,
replica_id: PublicKeyShare,
key_index: usize,
peer_replicas: PublicKeySet,
events: Vec<ReplicaEvent>
) -> Result<Self, Error>
[src]
id: OwnerType,
replica_id: PublicKeyShare,
key_index: usize,
peer_replicas: PublicKeySet,
events: Vec<ReplicaEvent>
) -> Result<Self, Error>
A new Replica instance from a history of events.
pub fn from_snapshot(
id: OwnerType,
replica_id: PublicKeyShare,
key_index: usize,
peer_replicas: PublicKeySet,
wallet: Wallet,
pending_proposals: HashMap<u64, HashMap<usize, TransferValidationProposed>>,
pending_debit: Option<u64>
) -> Self
[src]
id: OwnerType,
replica_id: PublicKeyShare,
key_index: usize,
peer_replicas: PublicKeySet,
wallet: Wallet,
pending_proposals: HashMap<u64, HashMap<usize, TransferValidationProposed>>,
pending_debit: Option<u64>
) -> Self
A new Replica instance from current state.
pub fn balance(&self) -> Token
[src]
pub fn wallet(&self) -> Option<WalletSnapshot>
[src]
pub fn genesis(
&self,
credit_proof: &CreditAgreementProof
) -> Result<Option<()>, Error>
[src]
&self,
credit_proof: &CreditAgreementProof
) -> Result<Option<()>, Error>
––––––––––– Cmds ———————————––
This is the one and only infusion of money to the system. Ever. It is carried out by the first node in the network.
pub fn test_validate_transfer(
&self,
signed_debit: &SignedDebit,
signed_credit: &SignedCredit
) -> Result<Option<()>, Error>
[src]
&self,
signed_debit: &SignedDebit,
signed_credit: &SignedCredit
) -> Result<Option<()>, Error>
For now, with test token there is no from wallet.., token is created from thin air.
pub fn validate(
&self,
signed_debit: &SignedDebit,
signed_credit: &SignedCredit
) -> Result<Option<()>, Error>
[src]
&self,
signed_debit: &SignedDebit,
signed_credit: &SignedCredit
) -> Result<Option<()>, Error>
Step 1. Main business logic validation of a debit.
pub fn register(
&self,
transfer_proof: &TransferAgreementProof
) -> Result<Option<TransferRegistered>, Error>
[src]
&self,
transfer_proof: &TransferAgreementProof
) -> Result<Option<TransferRegistered>, Error>
Step 2. Validation of agreement, and order at debit source.
pub fn receive_propagated(
&self,
credit_proof: &CreditAgreementProof
) -> Result<Option<()>, Error>
[src]
&self,
credit_proof: &CreditAgreementProof
) -> Result<Option<()>, Error>
Step 3. Validation of TransferAgreementProof, and credit idempotency at credit destination. (Since this leads to a credit, there is no requirement on order.)
pub fn apply(&mut self, event: ReplicaEvent) -> Result<(), Error>
[src]
––––––––––– Mutation ———————————
Mutation of state. There is no validation of an event, it (the cmd) is assumed to have been properly validated before the fact is established (event raised), and thus anything that breaks here, is a bug in the validation..
impl WalletReplica
[src]
pub fn propose_validation(
&self,
signed_transfer: &SignedTransferShare
) -> Result<Option<TransferValidationProposed>, Error>
[src]
&self,
signed_transfer: &SignedTransferShare
) -> Result<Option<TransferValidationProposed>, Error>
Step 1. Main business logic validation of a debit.
Trait Implementations
impl Clone for WalletReplica
[src]
fn clone(&self) -> WalletReplica
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WalletReplica
[src]
impl Eq for WalletReplica
[src]
impl PartialEq<WalletReplica> for WalletReplica
[src]
fn eq(&self, other: &WalletReplica) -> bool
[src]
fn ne(&self, other: &WalletReplica) -> bool
[src]
impl StructuralEq for WalletReplica
[src]
impl StructuralPartialEq for WalletReplica
[src]
Auto Trait Implementations
impl RefUnwindSafe for WalletReplica
impl Send for WalletReplica
impl Sync for WalletReplica
impl Unpin for WalletReplica
impl UnwindSafe for WalletReplica
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,