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

fix(sdk): invalid error returned when identity create fails #1856

Merged

Conversation

lklimek
Copy link
Contributor

@lklimek lklimek commented May 23, 2024

Issue being fixed or feature implemented

put_to_platform_and_wait_for_response() doesn't return correct error when broadcast_request_for_new_identity fails, but it waits until timeout.

What was done?

Added return when error occurs

How Has This Been Tested?

Using rs-platform explorer, patched to use invalid asset lock private key when creating identity in Wallet > Register identity.

BEFORE the fix, Wallet > Register identity waits until timeout and then errors with:

 |>SDK error: Dapi client error: Transport(Status { code: Cancelled, message: "Timeout expired", source:           │
│ Some(tonic::transport::Error(Transport, TimeoutExpired(()))) }, Address { ban_count: 0, banned_until: None,     │
│ uri: http://127.0.0.1:2643/ })                                                                                  │
│                                     

AFTER the fix Wallet > Register identity immediately errors with:

│>SDK error: Dapi client error: Transport(Status { code: Unauthenticated, message: "ecdsa signing                 │
│ error the signature isn't valid", metadata: MetadataMap { headers: {"drive-error-data-bin":                     │
│ "oW9zZXJpYWxpemVkRXJyb3KYHAMKGBkYdBhoGGUYIBhzGGkYZxhuGGEYdBh1GHIYZRggGGkYcxhuGCcYdBggGHYYYRhsGGkYZA==",         │
│ "code": "20009", "grpc-accept-encoding": "identity", "grpc-encoding": "identity", "content-type": "application/ │
│ grpc+proto", "date": "Fri, 24 May 2024 11:01:15 GMT", "x-envoy-upstream-service-time": "16", "server":          │
│ "envoy"} }, source: None }, Address { ban_count: 0, banned_until: None, uri: http://127.0.0.1:2543/ })          │
│                                                                                                          

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@lklimek lklimek changed the title fix(sdk): put_to_platform_and_wait_for_response returns timeout inste… fix(sdk): invalid error returned when identity create fails May 23, 2024
@lklimek lklimek marked this pull request as ready for review May 24, 2024 11:08
Copy link
Member

@shumkov shumkov left a comment

Choose a reason for hiding this comment

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

👍

@lklimek lklimek merged commit d87f150 into v1.0-dev May 28, 2024
23 of 24 checks passed
@lklimek lklimek deleted the fix/put_to_platform_and_wait_for_response-error-handling branch May 28, 2024 06:44
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