Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thank you for the PR @xlc ! It looks good to me! I will just add here some of my thoughts :
queryInfo
in general is available (either from runtime call or rpc) not just checking ifrpc
is available.else
statement after this check. Since it makes sense to call thefetchQueryInfo
function only if one of the two calls are available.apiAt.call.transactionPaymentApi.queryInfo
, e.g. this line or this line, etc. ? So it would beapiAt.call.transactionPaymentApi?.queryInfo
) as shown here in your PR.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.
This wont be necessary (in the context of this PR and not a refactor) since the check is already done before any of the calls are made.
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 thiink 1, 3, 4 are a bit unnecessary for this PR as its more of a fix per se and not a rewrite. But I do agree with point 2 where the error message could be a bit better, and not just specific for the rpc method.