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

Improve error message for expected String #1492

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Improved error message for Strings as CLI arguments - [#1492](https://github.com/paritytech/cargo-contract/pull/1492)
- Add a user-friendly view of contract storage data in the form of a table - [#1414](https://github.com/paritytech/cargo-contract/pull/1414)
- Add `rpc` command - [#1458](https://github.com/paritytech/cargo-contract/pull/1458)

Expand Down
4 changes: 3 additions & 1 deletion crates/transcode/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ impl<'a> Encoder<'a> {
s.encode_to(output);
Ok(())
} else {
Err(anyhow::anyhow!("Expected a String value"))
Err(anyhow::anyhow!("Expected a String value\n\
On the command-line, String values need to be wrapped in escaped quotes: \
\\\"…\\\"."))
}
}
TypeDefPrimitive::U8 => encode_uint::<u8, O>(value, "u8", output),
Expand Down
Loading