Skip to content

Added SanitizeChecksums to handler package, and similar SanitizeCheck…#81

Merged
auroter merged 3 commits intodevelopfrom
task/sean/str-322
Jan 11, 2023
Merged

Added SanitizeChecksums to handler package, and similar SanitizeCheck…#81
auroter merged 3 commits intodevelopfrom
task/sean/str-322

Conversation

@auroter
Copy link
Copy Markdown
Contributor

@auroter auroter commented Jan 11, 2023

To test:

  1. Comment out the walletAuthenticationPrefix string in pkg/service/auth.go:27 because we need to log in using Insomnia. Uncomment line 25 which makes the string empty.
  2. Get a Wallet Authentication Payload and sign it using sign_test.go.
  3. Log in using the signature
  4. Request a quote, but change some of the letters in the contractAddress to be lowercase
  5. Observe how the JSON output of the quote corrects the checksum of any address

Additionally, we can test the other places which take in addresses such as creating a user or executing a transaction.

@auroter auroter marked this pull request as ready for review January 11, 2023 21:31
@auroter auroter requested a review from saito-sv January 11, 2023 21:31
Comment on lines +32 to +38
SanitizeChecksums(&body.CxAddr, &body.UserAddress)
// Sanitize Checksum for body.CxParams? It might look like this:
var cxParams []*string
for _, p := range body.CxParams {
cxParams = append(cxParams, &p)
}
SanitizeChecksums(cxParams...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Although it looks like we're trying to sanitize body params here... We're definitely failing at this rn.

@auroter auroter merged commit 5f6dcf2 into develop Jan 11, 2023
@auroter auroter deleted the task/sean/str-322 branch January 11, 2023 22:48
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.

3 participants