Struct safe_network::transfers::TransferActor[][src]

pub struct TransferActor<S: Signing> { /* fields omitted */ }
Expand description

The Actor is the part of an AT2 system that initiates transfers, by requesting Replicas to validate them, and then receive the proof of agreement. It also syncs transfers from the Replicas.

Implementations

Use this ctor for a new instance, or to rehydrate from events (see the synch method). Pass in the key set of the replicas of this actor, i.e. our replicas. Credits to our wallet are most likely debited at other replicas than our own (the sender’s replicas),

Temp, for test purposes

Query for the id of the Actor.

Query for the balance of the Actor.

History of credits and debits


––––––––––– Cmds ———————————––

Step 1. Build a valid cmd for validation of a debit.

Step 2. Receive validations from Replicas, aggregate the signatures.

Step 3. Registration of an agreed transfer. (The actual sending of the registration over the wire is done by upper layer, only after that, the event is applied to the actor instance.)

Step xx. Continuously receiving credits from Replicas via push or pull model, decided by upper layer. The credits are most likely originating at an Actor whose Replicas are not the same as our Replicas. That means that the signature on the DebitAgreementProof, is that of some Replicas we don’t know. What we do here is to validate replicas in upper layers for determining if this remote group of Replicas is indeed valid.

This also ensures that we receive transfers initiated at other Actor instances (same id or other, i.e. with multiple instances of same Actor we can also sync debits made on other isntances). Todo: This looks to be handling the case when there is a transfer in flight from this client (i.e. self.next_expected_debit has been incremented, but transfer not yet accumulated). Just make sure this is 100% the case as well.

NB: If a non-complete* set of debits has been provided, this Actor instance will still apply any credits, and thus be out of synch with its Replicas, as it will have a balance that is higher than at the Replicas. (*Non-complete means non-contiguous set or not starting immediately after current debit version.)


––––––––––– Mutation ———————————

Mutation of state. There is no validation of an event, it is assumed to have been properly validated before raised, and thus anything that breaks is a bug.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.