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

Add error message on system contract #1494

Merged
merged 10 commits into from
Jul 29, 2024
Merged

Add error message on system contract #1494

merged 10 commits into from
Jul 29, 2024

Conversation

Ifropc
Copy link
Contributor

@Ifropc Ifropc commented Jul 27, 2024

What

Add clear error message when trying to fetch asset contract's WASM

cargo run --bin stellar -- contract fetch  --rpc-url https://docs-demo.stellar-mainnet.quiknode.pro/ --network-passphrase "Public Global Stellar Network ; September 2015" --id CBBJTE34KZHJACB2A6OXCRTDDLX4LI7GKYYD6XYJSGMX46BLNAG752HS
error: cannot fetch wasm for contract because the contract is a network built-in asset contract that does not have a downloadable code binary

As the result, moved logic of parsing contract data from rpc client to cli

Why

Previous error message was unclear (see discussion)

Known limitations

N/A

@Ifropc Ifropc linked an issue Jul 27, 2024 that may be closed by this pull request
@leighmcculloch leighmcculloch self-requested a review July 28, 2024 20:30
Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. See my comments on stellar/rs-stellar-rpc-client#9.

cmd/soroban-cli/src/commands/contract/fetch.rs Outdated Show resolved Hide resolved
Ifropc added 4 commits July 29, 2024 10:52
…m-error-message

# Conflicts:
#	Cargo.lock
#	cmd/soroban-cli/src/commands/contract/fetch.rs
Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! 👏🏻

One comment inline.

Cargo.toml Outdated Show resolved Hide resolved
@leighmcculloch
Copy link
Member

To update the CLI Help Doc, run make generate-full-help-doc.

@Ifropc Ifropc merged commit 4a7349f into main Jul 29, 2024
24 checks passed
@Ifropc Ifropc deleted the 1488-wasm-error-message branch July 29, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

error: unexpected contract code got token on Contract addresses
2 participants