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

handles case when publication exists #32

Merged
merged 1 commit into from
Mar 28, 2024
Merged

Conversation

brunocalza
Copy link
Collaborator

@brunocalza brunocalza commented Mar 26, 2024

This PR adds a check in case a vault already exists. This was something @dtbuchholz asked.

@brunocalza brunocalza changed the title handles case when publication exists [staging] handles case when publication exists Mar 26, 2024
@brunocalza brunocalza self-assigned this Mar 26, 2024
@brunocalza brunocalza requested a review from avichalp March 26, 2024 20:56
@@ -43,7 +43,13 @@ impl EVMClient for BasinClient {
.create_pub(owner, name.into())
.send()
.await
.map_err(|e| Error::Evm(e.to_string()))?;
.map_err(|e| {
if e.is_revert() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've tried to use e.decode_contract_revert() to decode the error and check the revert message, but could not get it to work. So I've settled on just checking if it's a revert. Not ideal, but good enough for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

e.decode_contract_revert() did it return None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

e.decode_contract_revert() did it return None?

yeah! not sure why

@brunocalza brunocalza marked this pull request as ready for review March 26, 2024 20:59
@brunocalza brunocalza merged commit fe95f45 into main Mar 28, 2024
5 checks passed
@brunocalza brunocalza deleted the bcalza/pubalreadyexists branch March 28, 2024 20:24
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.

2 participants