pub struct TransactionRequest {
pub action: Action,
pub data: Bytes,
pub gas: Option<U256>,
pub gas_price: Option<U256>,
pub nonce: Option<U256>,
}
Expand description
The data required for a Client
to create a transaction.
Gas limit, gas price, or nonce can be set explicitly, e.g. to create service transactions with zero gas price, or sequences of transactions with consecutive nonces. Added for AuRa needs.
Fields
action: Action
Transaction action
data: Bytes
Transaction data
gas: Option<U256>
Transaction gas usage
gas_price: Option<U256>
Transaction gas price
nonce: Option<U256>
Transaction nonce
Implementations
sourceimpl TransactionRequest
impl TransactionRequest
sourcepub fn call(address: Address, data: Bytes) -> TransactionRequest
pub fn call(address: Address, data: Bytes) -> TransactionRequest
Creates a request to call a contract at address
with the specified call data.
sourcepub fn gas(self, gas: U256) -> TransactionRequest
pub fn gas(self, gas: U256) -> TransactionRequest
Sets a gas limit. If this is not specified, a sensible default is used.
sourcepub fn gas_price<T: Into<Option<U256>>>(
self,
gas_price: T
) -> TransactionRequest
pub fn gas_price<T: Into<Option<U256>>>(
self,
gas_price: T
) -> TransactionRequest
Sets a gas price. If this is not specified or None
, a sensible default is used.
sourcepub fn nonce(self, nonce: U256) -> TransactionRequest
pub fn nonce(self, nonce: U256) -> TransactionRequest
Sets a nonce. If this is not specified, the appropriate latest nonce for the author is used.
Auto Trait Implementations
impl RefUnwindSafe for TransactionRequest
impl Send for TransactionRequest
impl Sync for TransactionRequest
impl Unpin for TransactionRequest
impl UnwindSafe for TransactionRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more