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

EN-5584: endpoint for getting key-value pairs for addresses #143

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

bogdan-rosianu
Copy link
Contributor

Implemented the address/{address}/keys endpoint that will return a map containing all keys and their values for an account. The value is represented in hexadecimal encoding.

@bogdan-rosianu bogdan-rosianu added the enhancement New feature or request label Feb 12, 2021
@bogdan-rosianu bogdan-rosianu self-assigned this Feb 12, 2021
@sasurobert sasurobert self-requested a review February 12, 2021 13:09
apiResponse := data.GenericAPIResponse{}
apiPath := AddressPath + address + "/keys"
respCode, err := ap.proc.CallGetRestEndPoint(observer.Address, apiPath, &apiResponse)
if err == nil || respCode == http.StatusBadRequest || respCode == http.StatusInternalServerError {

Choose a reason for hiding this comment

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

Is this condition ok? Maybe you can extract it in one explanatory variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It is correct. If you look inside CallGetRestEndPoint function it can return values on both return params (the response code and the error) so this check must be made in order to return if a request isn't 200 OK.

I tried to extract a variable, but I would get an IDE's linter issue that tells me the err can be nil when logging it. I would leave it as it is

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

@0xmtf 0xmtf left a comment

Choose a reason for hiding this comment

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

system test passed

@bogdan-rosianu bogdan-rosianu merged commit 4f437ed into development Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants