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

Adds confirmation code #1

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Adds confirmation code #1

merged 4 commits into from
Sep 26, 2024

Conversation

amhedcb
Copy link
Collaborator

@amhedcb amhedcb commented Sep 25, 2024

  • Adds confirmationCode as part of DB object creation
  • Simplifies the DB Schema to a single table, and uses txParams as the JSON-based column to put all the relay info
  • Simplifies the API controller so it only handles data validation and delegates to a mini service how to format and store

Still Pending

  • Haven't updated the GET. Need info from the team on formatTxDataResponse and formatTxMessageResponse
  • Need confirmation from @rafaelcamara-cb and @justin-lee-cb this is ok:
    CleanShot 2024-09-25 at 16 35 10

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nfc-relayer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 11:16pm

@@ -0,0 +1,28 @@
name: Run Tests
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding some github actions so we can run tests up here as well

package.json Outdated Show resolved Hide resolved
src/FiatTokenAbi.ts Outdated Show resolved Hide resolved
src/helpers/formatTxDataResponse.ts Show resolved Hide resolved
src/helpers/generate-random-string.ts Show resolved Hide resolved
src/pages/api/paymentTxParams/[uuid].ts Outdated Show resolved Hide resolved
Comment on lines -39 to -43
if (!['eip681', 'contractCall', 'eip712'].includes(payloadType)) {
return res.status(400).json({ message: 'Invalid payload type, must be eip681 or contractCall' });
}

const paymentUuid = uuid || uuidv4();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved all these checks to the service, and defined proper types for them. IN case we ever need to deserialize (asked Cursor for help)

dappName: payload.dappName,
payloadType: payload.payloadType,

additionalPayload: payload.additionalPayload,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be thrown into txParams as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I should store this one as it's own column, wdyt

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm yeah I guess its own column makes sense

- Configure tests and simple-git-hooks
- Update jest to latest
- Simplify DB schema
- Refactoring code on API controllers
- Debugging with Postman
- Adds payload types
- Adds additionalPayload column
- Fixes all tests
- Configures github actions for running tests on PRs
- Remove simple-git-hooks. Was causing an error on git pipeline
@justin-lee-cb justin-lee-cb merged commit c5e64fb into main Sep 26, 2024
3 checks passed
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