-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement revoke admin cli support #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to do a little more work to tell the user what's going on here - specific comment below but might be worth adding a couple other log lines - I'll leave that up to your judgement as I don't have much context with this code!
cli/src/utils.rs
Outdated
|
||
info!("estimated grant gas cost {:#?}", claim_tx.tx.gas().unwrap()); | ||
|
||
send_tx(&claim_tx.tx, client, retries).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible for this to throw errors? I don't know rust, but is there some mechanism for handling potential transaction failures? at the very least I think we should add a log line here confirming that the transaction was executed successfully, and ideally point the user at the chain explorer where they can manually verify the address is no longer an admin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The ?
operator is going to propagate any error back to the caller function because this function has a Result<(), Box<dyn std::error::Error>>
return type.
That's a great suggestion. It would definitely help in terms of usability. I'll look into it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than logging already suggested, this looks good. My rust knowledge is minimal for now, so I might be missing things.
Should there be a test for granting and revoking admin?
Thank you! I agree we should have this. I will have to learn how to use the test tooling to pull it off (which is probably a good thing anyway). Should it be a necessary to merge the PR? |
4679729
to
49fdbdc
Compare
49fdbdc
to
1fb33dc
Compare
I should also note that as things are, it's not possible to run integration tests locally as we're missing three secrets and we have to rely on CI. However, it's possible to troubleshoot what's going on with all these invocations on calibrationnet. Here's an example of the last CI run with all the integration test transactions (you'll need the abi.json to decode the messages). |
eb1fbc4
to
4eb13a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Thanks for adding the admin grant/revoke tests. Since these pass I think we can call this good
We couldn't really remove admins from the cli, so this should fix that. I wanted to cleanup the code a little bit, but I figured it would be more important to ship this rather than adjust existing functionality for code reuse.
revoke_admin
method;