Struct hedera::TransactionResponse
source · pub struct TransactionResponse {
pub node_account_id: AccountId,
pub transaction_id: TransactionId,
pub transaction_hash: TransactionHash,
pub validate_status: bool,
}
Expand description
Response from Transaction::execute
.
When the client sends a node a transaction of any kind, the node replies with this, which simply says that the transaction passed the pre-check (so the node will submit it to the network).
To learn the consensus result, the client should later obtain a receipt (free), or can buy a more detailed record (not free).
Fields§
§node_account_id: AccountId
The account ID of the node that the transaction was submitted to.
transaction_id: TransactionId
The client-generated transaction ID of the transaction that was submitted.
This can be used to lookup the transaction in an explorer.
transaction_hash: TransactionHash
The client-generated SHA-384 hash of the transaction that was submitted.
This can be used to lookup the transaction in an explorer.
validate_status: bool
Whether the receipt/record status should be validated.
Implementations§
source§impl TransactionResponse
impl TransactionResponse
sourcepub fn validate_status(&mut self, validate: bool) -> &mut Self
pub fn validate_status(&mut self, validate: bool) -> &mut Self
Whether the receipt/record status should be validated.
sourcepub fn get_receipt_query(&self) -> TransactionReceiptQuery
pub fn get_receipt_query(&self) -> TransactionReceiptQuery
Create a query that will get the receipt for this transaction.
sourcepub fn get_record_query(&self) -> TransactionRecordQuery
pub fn get_record_query(&self) -> TransactionRecordQuery
Create a query that will get the record for this transaction.
sourcepub async fn get_receipt(&self, client: &Client) -> Result<TransactionReceipt>
pub async fn get_receipt(&self, client: &Client) -> Result<TransactionReceipt>
Get the receipt for this transaction. Will wait for consensus.
§Errors
- if
validate_status
istrue
:Error::ReceiptStatus
for a failing receipt.
fixme: is that it? Surely there are more situations.
sourcepub async fn get_receipt_with_timeout(
&self,
client: &Client,
timeout: Duration
) -> Result<TransactionReceipt>
pub async fn get_receipt_with_timeout( &self, client: &Client, timeout: Duration ) -> Result<TransactionReceipt>
Get the receipt for this transaction. Will wait for consensus.
§Errors
- if
validate_status
istrue
:Error::ReceiptStatus
for a failing receipt.
sourcepub async fn get_record(&self, client: &Client) -> Result<TransactionRecord>
pub async fn get_record(&self, client: &Client) -> Result<TransactionRecord>
Get the record for this transaction. Will wait for consensus.
§Errors
- if
validate_status
istrue
:Error::ReceiptStatus
for a failing receipt in the record.
sourcepub async fn get_record_with_timeout(
&self,
client: &Client,
timeout: Duration
) -> Result<TransactionRecord>
pub async fn get_record_with_timeout( &self, client: &Client, timeout: Duration ) -> Result<TransactionRecord>
Get the record for this transaction. Will wait for consensus.
§Errors
- if
validate_status
istrue
:Error::ReceiptStatus
for a failing receipt in the record.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TransactionResponse
impl RefUnwindSafe for TransactionResponse
impl Send for TransactionResponse
impl Sync for TransactionResponse
impl Unpin for TransactionResponse
impl UnwindSafe for TransactionResponse
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request