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

Investigate why some errors at the fuel-core / fuel-vm level aren’t being captured by the SDK #102

Closed
iqdecay opened this issue Feb 16, 2022 · 1 comment · Fixed by #103
Assignees
Labels
bug Something isn't working

Comments

@iqdecay
Copy link
Contributor

iqdecay commented Feb 16, 2022

Sometimes, some errors do not get captured at all by the SDK. For an example of that, see branch https://github.com/FuelLabs/fuels-rs/tree/repro-storage-slots where the 2nd transaction is actually a reverting transaction with MemoryOverflow error, and nothing appears in the receipts.

@iqdecay iqdecay added the bug Something isn't working label Feb 16, 2022
@digorithm
Copy link
Member

Update on this: use https://github.com/FuelLabs/fuel-core/blob/master/fuel-client/src/client.rs#L166 at https://github.com/FuelLabs/fuels-rs/blob/eb0f17c5907cb17b54c302f60283ea4f8f483605/fuels-contract/src/script.rs

 pub async fn call(self, fuel_client: &FuelClient) -> Result<Vec<Receipt>, Error> {
    let tx_id = fuel_client.submit(&self.tx).await.unwrap();

    let receipts = fuel_client.receipts(&tx_id.0.to_string()).await.unwrap();

    Ok(receipts)
}

If value == 0 and receipts.len() == 0. This way we should be able to get the reason of the failed transaction and bubble it up to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants