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

Fail deploy on failed status #242

Merged
merged 2 commits into from Aug 6, 2019

Conversation

geigerzaehler
Copy link
Contributor

Deploying a contract is successful only if the status field of the receipt is 0x1. Before, the deployment was considered successful if the contract address was present.

Fixes #241

Deploying a contract is successful only if the `status` field of the
receipt is `0x1`. Before, the deployment was considered successful if
the contract address was present.

Fixes tomusdrw#241
match receipt.contract_address {
Some(address) => Ok(Async::Ready(Contract::new(eth, address, abi))),
None => Err(Error::ContractDeploymentFailure(receipt.transaction_hash)),
let status = receipt.status.ok_or(Error::Api(ApiError::InvalidResponse(String::from(
Copy link
Owner

Choose a reason for hiding this comment

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

It's not an error, for chains that don't support status the value will be None. Please just fall back to contratAddress detection in such case as I've suggested in the issue.

Copy link
Owner

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

Thanks!

@tomusdrw tomusdrw merged commit b2aa733 into tomusdrw:master Aug 6, 2019
@geigerzaehler geigerzaehler deleted the fail-deploy-on-status branch August 7, 2019 07:52
geigerzaehler pushed a commit to oscoin/oscoin-parity-wasm-prototype that referenced this pull request Aug 7, 2019
We use an unreleased version of `web3` which includes a fix for silent
deploy failures [1].

[1]: tomusdrw/rust-web3#242
geigerzaehler pushed a commit to oscoin/oscoin-parity-wasm-prototype that referenced this pull request Aug 7, 2019
We use an unreleased version of `web3` which includes a fix for silent
deploy failures [1].

[1]: tomusdrw/rust-web3#242
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.

Use status field to determine if deployment was successfull
2 participants