Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get tx status with receipts #150

Open
mohamedalichelbi opened this issue Jul 18, 2024 · 1 comment
Open

How to get tx status with receipts #150

mohamedalichelbi opened this issue Jul 18, 2024 · 1 comment

Comments

@mohamedalichelbi
Copy link

I am trying to get tx status with receipts, the RPC is returning correct JSON, but not sure if it is being deserialized correctly. Here are some snippets from my code (not runnable):

use near_jsonrpc_client::{methods::{self, EXPERIMENTAL_tx_status::{self, TransactionInfo}}, JsonRpcClient};

let request = EXPERIMENTAL_tx_status::RpcTransactionStatusRequest {
    transaction_info: TransactionInfo::TransactionId {
        tx_hash,
        sender_account_id,
    },
    wait_until: TxExecutionStatus::Final,
};

let tx_status = provider.call(&request).await?;

With tracing enabled, I see the RPC responding with JSON that contains the attribute "receipts": [....]. However, the rust attribute final_execution_outcome in my variable tx_status has type Some(FinalExecutionOutcomeViewEnum::FinalExecutionOutcome(FinalExecutionOutcomeView)).
I would expect it to have Some(FinalExecutionOutcomeViewEnum::FinalExecutionOutcomeWithReceipt(FinalExecutionOutcomeWithReceiptView))

Any thoughts or help would be appreciated.

@frol
Copy link
Collaborator

frol commented Aug 1, 2024

Just for the reference, here is the relevant chat discussion: https://near.zulipchat.com/#narrow/stream/297873-node/topic/An.20issue.20with.20FinalExecutionOutcomeView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants