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

Implement transaction/dry-run #236

Merged
merged 2 commits into from
Aug 26, 2020
Merged

Implement transaction/dry-run #236

merged 2 commits into from
Aug 26, 2020

Conversation

emostov
Copy link
Contributor

@emostov emostov commented Aug 25, 2020

#227

Relates to paritytech/substrate#6300

This PR implements transaction/dry-run and codifies the sidecar API.

N.B. system_dryRun will not have any effects on chain state.


Below are some sample responses:

{
    "at": {
        "hash": "0xd46b3789ddd9d930da20fdf7a47a6fbc41e5851b325738b378351d67e65ecc4d",
        "height": "63"
    },
    "dryRunResult": {
        "resultType": "DispatchOutcome",
        "result": {
            "Error": {
                "Module": {
                    "index": "6", // balances
                    "error": "3" // InsufficientBalance
                }
            }
        }
    }
}
{
    "at": {
        "hash": "0x1de484ce19478a86d649f60c6fd79d0f2ce361555fc3706cf2cdcce38c358ebc",
        "height": "32"
    },
    "dryRunResult": {
        "resultType": "DispatchOutcome",
        "result": {
            "Ok": []
        }
    }
}

{
    "at": {
        "hash": "0xfa9aa674faacc41b0246a84bb908e8b53054dc2840ba7f6b87bcbf57e9988d5f",
        "height": "507"
    },
    "dryRunResult": {
        "resultType": "TransactionValidityError",
        "result": {
            "BadProof": null
        },
        "validityErrorType": "Invalid"
    }
}

{
    "at": {
        "hash": "0xa1c7887369ba8fc97c67a6271bf8133cbabbbc970eb95edb081f84477f7402ed",
        "height": "0"
    },
    "dryRunResult": {
        "resultType": "TransactionValidityError",
        "result": {
            "AncientBirthBlock": null
        },
        "validityErrorType": "Invalid"
    }
}

{
    "at": {
        "hash": "0x00dd123520b97da32fd88c6ed2e0b72d7686187019748d5d3bbdf10bbff0009f",
        "height": "21"
    },
    "dryRunResult": {
        "resultType": "TransactionValidityError",
        "result": {
            "Future": null
        },
        "validityErrorType": "Invalid"
    }
}

Copy link
Contributor

@danforbes danforbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome 🎉

@@ -1737,6 +1737,42 @@ components:
items:
type: string
format: ss58
TransactionDryRun:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice docs 🎉

openapi/openapi-proposal.yaml Outdated Show resolved Hide resolved
@joepetrowski joepetrowski merged commit 104dde8 into master Aug 26, 2020
@joepetrowski joepetrowski deleted the zeke-dry-run branch August 26, 2020 17:22
@emostov emostov mentioned this pull request Aug 26, 2020
19 tasks
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

Successfully merging this pull request may close these issues.

3 participants