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

Misc extrinsics display improvements #916

Merged
merged 4 commits into from
Jan 24, 2023
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
2 changes: 1 addition & 1 deletion crates/cargo-contract/src/cmd/extrinsics/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl DisplayEvents {
let event_field_indent: usize = DEFAULT_KEY_COL_WIDTH - 3;
let mut out = format!(
"{:>width$}\n",
"Events".bold(),
"Events".bright_purple().bold(),
width = DEFAULT_KEY_COL_WIDTH
);
for event in &self.0 {
Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-contract/src/cmd/extrinsics/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,11 @@ impl Exec {
};
println!("{}", display_instantiate_result.to_json()?)
} else {
println!("{}", events.display_events(self.verbosity, token_metadata)?);
if let Some(code_hash) = code_hash {
name_value_println!("Code hash", format!("{:?}", code_hash));
}
name_value_println!("Contract", contract_address);
println!("{}", events.display_events(self.verbosity, token_metadata)?)
};
Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion crates/cargo-contract/src/cmd/extrinsics/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ impl UploadCommand {
}
Ok(())
} else {
let code_hash = hex::encode(code_hash);
Err(anyhow::anyhow!(
"This contract has already been uploaded with code hash: {code_hash:?}"
"This contract has already been uploaded with code hash: 0x{code_hash}"
)
.into())
}
Expand Down