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

refactor: add superstruct and validate request/response utils #305

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

stanleyyconsensys
Copy link
Collaborator

@stanleyyconsensys stanleyyconsensys commented Jul 31, 2024

This PR is to add superstruct into the starknet snap, and include a common custom defined struct AddressStruct as an demo

  • AddressStruct process the same logic as validateAndParseAddress in starknet utils

This PR also adding a RPC validator util for future use to validate the request & response with superstruct
possible use case:

sendTransaction(requestParams) {
     validateRequest(requestParams, struct)
     // process logic
     validateResponse(response, struct)
    return response
}

@stanleyyconsensys stanleyyconsensys requested a review from a team as a code owner July 31, 2024 05:47
@stanleyyconsensys stanleyyconsensys requested review from Julink-eth, wantedsystem and khanti42 and removed request for a team July 31, 2024 05:47
@stanleyyconsensys stanleyyconsensys changed the title refactor: add superstruct refactor: add superstruct and validation request/response utils Jul 31, 2024
@stanleyyconsensys stanleyyconsensys changed the title refactor: add superstruct and validation request/response utils refactor: add superstruct and validate request/response utils Jul 31, 2024
Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@stanleyyconsensys stanleyyconsensys merged commit 03bdbec into main Jul 31, 2024
13 checks passed
@stanleyyconsensys stanleyyconsensys deleted the chore/add-superstruct branch July 31, 2024 09:17
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