Skip to content

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

Merged
ascjones merged 1 commit intouse-ink:masterfrom
xermicus:fix-upload-existing-contract-error-message
Aug 2, 2022
Merged

contract upload: emitting a warning instead of an error when the cont…#644
ascjones merged 1 commit intouse-ink:masterfrom
xermicus:fix-upload-existing-contract-error-message

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