[−][src]Struct exonum::runtime::AnyTx
Transaction with the information required to dispatch it to a service.
Examples
Creates a new signed transaction.
use exonum::{ crypto, messages::Verified, runtime::{AnyTx, CallInfo}, }; let keypair = crypto::KeyPair::random(); // Service instance which we want to call. let instance_id = 1024; // Specific method of the service interface. let method_id = 0; let call_info = CallInfo::new(instance_id, method_id); // `AnyTx` object created from `CallInfo` and payload. let arguments = "Talk is cheap. Show me the code. – Linus Torvalds".to_owned().into_bytes(); let any_tx = AnyTx::new(call_info, arguments); let transaction = any_tx.sign_with_keypair(&keypair);
Fields (Non-exhaustive)
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.call_info: CallInfo
Information required for the call of the corresponding executor.
arguments: Vec<u8>
Serialized transaction arguments.
Methods
impl AnyTx
[src]
pub fn new(call_info: CallInfo, arguments: Vec<u8>) -> Self
[src]
Creates a new AnyTx
object.
pub fn sign(
self,
public_key: PublicKey,
secret_key: &SecretKey
) -> Verified<Self>
[src]
self,
public_key: PublicKey,
secret_key: &SecretKey
) -> Verified<Self>
Signs a transaction with the specified Ed25519 keys.
pub fn sign_with_keypair(self, keypair: &KeyPair) -> Verified<Self>
[src]
Signs a transaction with the specified Ed25519 keypair.
pub fn parse<T: BinaryValue>(&self) -> Result<T>
[src]
Parse transaction arguments as a specific type.
Trait Implementations
impl BinaryValue for AnyTx
[src]
fn to_bytes(&self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Result<Self, Error>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
impl Clone for AnyTx
[src]
impl Debug for AnyTx
[src]
impl<'de> Deserialize<'de> for AnyTx
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for AnyTx
[src]
impl From<AnyTx> for CoreMessage
[src]
impl IntoMessage for AnyTx
[src]
type Container = CoreMessage
Container for the message.
impl Ord for AnyTx
[src]
fn cmp(&self, other: &AnyTx) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<AnyTx> for AnyTx
[src]
impl PartialOrd<AnyTx> for AnyTx
[src]
fn partial_cmp(&self, other: &AnyTx) -> Option<Ordering>
[src]
fn lt(&self, other: &AnyTx) -> bool
[src]
fn le(&self, other: &AnyTx) -> bool
[src]
fn gt(&self, other: &AnyTx) -> bool
[src]
fn ge(&self, other: &AnyTx) -> bool
[src]
impl ProtobufConvert for AnyTx
[src]
type ProtoStruct = AnyTx
Type generated from the Protobuf definition.
fn from_pb(pb: Self::ProtoStruct) -> Result<Self, Error>
[src]
fn to_pb(&self) -> Self::ProtoStruct
[src]
impl Serialize for AnyTx
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for AnyTx
[src]
impl StructuralPartialEq for AnyTx
[src]
impl<'_> TryFrom<&'_ SignedMessage> for AnyTx
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &SignedMessage) -> Result<Self, Self::Error>
[src]
impl TryFrom<CoreMessage> for AnyTx
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(msg: CoreMessage) -> Result<Self>
[src]
impl TryFrom<SignedMessage> for AnyTx
[src]
Auto Trait Implementations
impl RefUnwindSafe for AnyTx
impl Send for AnyTx
impl Sync for AnyTx
impl Unpin for AnyTx
impl UnwindSafe for AnyTx
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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.
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>,