[−]Struct private_currency::transactions::Transfer
Transfer from one wallet to another wallet.
See crate docs for explanation about fields and workflow of Transfer
transactions.
Methods
impl Transfer
impl Transfer
pub fn new(
from: &PublicKey,
to: &PublicKey,
rollback_delay: u32,
history_len: u64,
amount: Commitment,
amount_proof: SimpleRangeProof,
sufficient_balance_proof: SimpleRangeProof,
encrypted_data: EncryptedData,
secret_key: &SecretKey
) -> Transfer
pub fn new(
from: &PublicKey,
to: &PublicKey,
rollback_delay: u32,
history_len: u64,
amount: Commitment,
amount_proof: SimpleRangeProof,
sufficient_balance_proof: SimpleRangeProof,
encrypted_data: EncryptedData,
secret_key: &SecretKey
) -> Transfer
Creates message and signs it.
pub fn new_with_signature(
from: &PublicKey,
to: &PublicKey,
rollback_delay: u32,
history_len: u64,
amount: Commitment,
amount_proof: SimpleRangeProof,
sufficient_balance_proof: SimpleRangeProof,
encrypted_data: EncryptedData,
signature: &Signature
) -> Transfer
pub fn new_with_signature(
from: &PublicKey,
to: &PublicKey,
rollback_delay: u32,
history_len: u64,
amount: Commitment,
amount_proof: SimpleRangeProof,
sufficient_balance_proof: SimpleRangeProof,
encrypted_data: EncryptedData,
signature: &Signature
) -> Transfer
Creates message and appends existing signature.
pub fn to_hex(&self) -> String
pub fn to_hex(&self) -> String
Returns the hex representation of the binary data. Lower case letters are used (e.g. f9b4ca).
pub fn from(&self) -> &PublicKey
pub fn from(&self) -> &PublicKey
Ed25519 public key of the sender. The transaction must be signed with the corresponding secret key.
pub fn to(&self) -> &PublicKey
pub fn to(&self) -> &PublicKey
Ed25519 public key of the receiver.
pub fn rollback_delay(&self) -> u32
pub fn rollback_delay(&self) -> u32
Relative delay (measured in block height) to wait for transfer acceptance from the
receiver. The delay is counted from the height of a block containing
this Transfer
.
If the transaction is not Accept
ed by the receiver when the delay expires,
the transfer is automatically rolled back.
pub fn history_len(&self) -> u64
pub fn history_len(&self) -> u64
Length of the wallet history as perceived by the wallet sender.
This value may be lesser than the real wallet history length. What’s important
is that history_len
must not be less then last_send_index
of the sender’s
wallet (i.e., the sender must be aware of all her outgoing transfers).
If history_len
is less, the transfer is considered invalid.
pub fn amount(&self) -> Commitment
pub fn amount(&self) -> Commitment
Commitment to the transferred amount.
pub fn amount_proof(&self) -> SimpleRangeProof
pub fn amount_proof(&self) -> SimpleRangeProof
Proof that amount
is positive.
pub fn sufficient_balance_proof(&self) -> SimpleRangeProof
pub fn sufficient_balance_proof(&self) -> SimpleRangeProof
Proof that the sender’s balance is sufficient relative to amount
.
pub fn encrypted_data(&self) -> EncryptedData
pub fn encrypted_data(&self) -> EncryptedData
Encryption of the opening for amount
.
Trait Implementations
impl Clone for Transfer
impl Clone for Transfer
fn clone(&self) -> Transfer
fn clone(&self) -> Transfer
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl AsRef<RawMessage> for Transfer
impl AsRef<RawMessage> for Transfer
fn as_ref(&self) -> &RawMessage
fn as_ref(&self) -> &RawMessage
impl PartialEq<Transfer> for Transfer
impl PartialEq<Transfer> for Transfer
impl Debug for Transfer
impl Debug for Transfer
impl ExonumJson for Transfer
impl ExonumJson for Transfer
fn deserialize_field<B>(
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<dyn Error>> where
B: WriteBufferWrapper,
fn deserialize_field<B>(
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<dyn Error>> where
B: WriteBufferWrapper,
fn serialize_field(&self) -> Result<Value, Box<dyn Error + Send + Sync>>
fn serialize_field(&self) -> Result<Value, Box<dyn Error + Send + Sync>>
impl ExonumJsonDeserialize for Transfer
impl ExonumJsonDeserialize for Transfer
fn deserialize(value: &Value) -> Result<Self, Box<dyn Error>>
fn deserialize(value: &Value) -> Result<Self, Box<dyn Error>>
impl Serialize for Transfer
impl Serialize for Transfer
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
impl<'de> Deserialize<'de> for Transfer
impl<'de> Deserialize<'de> for Transfer
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>,
impl FromHex for Transfer
impl FromHex for Transfer
impl<'a> SegmentField<'a> for Transfer
impl<'a> SegmentField<'a> for Transfer
fn item_size() -> Offset
fn item_size() -> Offset
fn count(&self) -> Offset
fn count(&self) -> Offset
fn extend_buffer(&self, buffer: &mut Vec<u8>)
fn extend_buffer(&self, buffer: &mut Vec<u8>)
unsafe fn from_buffer(buffer: &'a [u8], from: Offset, count: Offset) -> Self
unsafe fn from_buffer(buffer: &'a [u8], from: Offset, count: Offset) -> Self
fn check_data(
buffer: &'a [u8],
from: CheckedOffset,
count: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
fn check_data(
buffer: &'a [u8],
from: CheckedOffset,
count: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
impl ServiceMessage for Transfer
impl ServiceMessage for Transfer
const SERVICE_ID: u16
const MESSAGE_ID: u16
impl StorageValue for Transfer
impl StorageValue for Transfer
fn into_bytes(self) -> Vec<u8>
fn into_bytes(self) -> Vec<u8>
fn from_bytes(value: Cow<[u8]>) -> Self
fn from_bytes(value: Cow<[u8]>) -> Self
impl Transaction for Transfer
[src]
impl Transaction for Transfer
impl Message for Transfer
impl Message for Transfer
fn from_raw(raw: RawMessage) -> Result<Transfer, Error>
fn from_raw(raw: RawMessage) -> Result<Transfer, Error>
fn raw(&self) -> &RawMessage
fn raw(&self) -> &RawMessage
fn verify_signature(&self, pub_key: &PublicKey) -> bool
[src]
fn verify_signature(&self, pub_key: &PublicKey) -> bool
Verifies the message using given public key.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<'a, T> Field for T where
T: SegmentField<'a>,
[src]
impl<'a, T> Field for T where
T: SegmentField<'a>,
fn field_size() -> u32
[src]
fn field_size() -> u32
unsafe fn read(buffer: &'a [u8], from: u32, to: u32) -> T
[src]
unsafe fn read(buffer: &'a [u8], from: u32, to: u32) -> T
fn write(&self, buffer: &mut Vec<u8>, from: u32, to: u32)
[src]
fn write(&self, buffer: &mut Vec<u8>, from: u32, to: u32)
fn check(
buffer: &'a [u8],
pointer_from: CheckedOffset,
pointer_to: CheckedOffset,
latest_segment: CheckedOffset
) -> Result<CheckedOffset, Error>
[src]
fn check(
buffer: &'a [u8],
pointer_from: CheckedOffset,
pointer_to: CheckedOffset,
latest_segment: CheckedOffset
) -> Result<CheckedOffset, Error>
impl<T> CryptoHash for T where
T: Message,
[src]
impl<T> CryptoHash for T where
T: Message,
impl<T> UniqueHash for T where
T: CryptoHash,
[src]
impl<T> UniqueHash for T where
T: CryptoHash,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Erased for T
impl<T> Erased for T
impl<T> SerializeContent for T where
T: Serialize,
[src]
impl<T> SerializeContent for T where
T: Serialize,
fn serialize_content<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
fn serialize_content<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self