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

contract upload: emitting a warning instead of an error when the cont… #644

Merged

Conversation

xermicus
Copy link
Contributor

When uploading the same contract multiple times, no CodeStored event will be emitted anymore. So instead of failing the command, I propose to just issue a warning as hint for the user.

I think this very similar to: #594

Fixes #643

…ract already existed is more user friendly

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Copy link
Collaborator

@ascjones ascjones left a comment

Choose a reason for hiding this comment

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

LGTM

format!("{:?}", code_stored.code_hash)
);
} else {
eprintln!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually to be consistent could we return Err(anyhow!( as we do elsewhere, then it will eprintln! at the top level.

@ascjones ascjones merged commit 2ea5153 into use-ink:master Aug 2, 2022
@ascjones ascjones mentioned this pull request Aug 15, 2022
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.

Missing CodeStored Event in cargo contract upload
2 participants