Skip to content

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 🎉

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 🎉

@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.

4 participants