-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fixing case where signingJobs is empty for non-DERIVE_KEY_AND_SIGN requests. #139
Fixing case where signingJobs is empty for non-DERIVE_KEY_AND_SIGN requests. #139
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
remotesigning/remote_signing.go
Outdated
@@ -58,31 +58,30 @@ func GraphQLResponseForRemoteSigningWebhook( | |||
webhook webhooks.WebhookEvent, | |||
seedBytes []byte, | |||
) (SigningResponse, error) { | |||
// Calculate the xpub for each L1 signing job | |||
// If derive key and sign, calculate the xpub for each L1 signing job | |||
subEventTypeStr := (*webhook.Data)["sub_event_type"].(string) |
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 type assertion could panic if webhook.Data
is nil
or if sub_event_type
isn't a string. Consider using a safer type assertion with error checking:
subEventTypeStr, ok := (*webhook.Data)["sub_event_type"].(string)
if !ok {
return nil, fmt.Errorf("sub_event_type not found or invalid type")
}
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
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.
Should I add this? I think this is the comment that caused the previous failure
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.
no, this one is different, it checks the existence of sub_event_type
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.
you should apply this
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.
gotcha, will do.
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.
well, technically it's fine because we send the webhook. It's up to you.
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.
Guess doesn't hurt to add if someone is debugging this later
00cc9c6
to
f7a633c
Compare
Merge activity
|
No description provided.