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

feat(api): Ethereum transactions API #847

Merged
merged 9 commits into from
Apr 5, 2023

Conversation

jordankzf
Copy link
Contributor

@jordankzf jordankzf commented Mar 28, 2023

What this PR does / why we need it:

Adds /ethereum/transactions?fromDate=YYYY-MM-DD&toDate=YYYY-MM-DD endpoint

Which issue(s) does this PR fixes?:

Fixes #834

Additional comments?:

Developer Checklist:

  • Read your code changes at least once
  • No console errors on web
  • Tested on Light mode and Dark mode*
  • Your UI implementation visually matched the rendered design*
  • Unit tests*
  • Added e2e tests*
  • Added translations*

@jordankzf jordankzf temporarily deployed to AWS ECR March 28, 2023 03:18 — with GitHub Actions Inactive
@netlify
Copy link

netlify bot commented Mar 28, 2023

Deploy Preview for quantumbridge ready!

Name Link
🔨 Latest commit 6b25afe
🔍 Latest deploy log https://app.netlify.com/sites/quantumbridge/deploys/642bef79c45e680008d17ab5
😎 Deploy Preview https://deploy-preview-847--quantumbridge.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the kind/feature New feature request label Mar 28, 2023
@jordankzf jordankzf temporarily deployed to AWS ECR March 28, 2023 07:02 — with GitHub Actions Inactive
@jordankzf jordankzf requested a review from kevzzsk March 28, 2023 07:52
@jordankzf jordankzf force-pushed the jordankzf/eth-transactions-api branch from 52f19d8 to cb710f7 Compare March 28, 2023 07:53
@jordankzf jordankzf marked this pull request as ready for review March 28, 2023 07:53
@jordankzf jordankzf temporarily deployed to AWS ECR March 28, 2023 07:53 — with GitHub Actions Inactive
@jordankzf jordankzf temporarily deployed to AWS ECR March 28, 2023 10:17 — with GitHub Actions Inactive
@jordankzf jordankzf requested a review from kevzzsk March 28, 2023 10:17
@kevzzsk
Copy link
Contributor

kevzzsk commented Mar 29, 2023

LGTM but let's hold this PR for now. Pending adding JWT/security to this API

@kevzzsk kevzzsk temporarily deployed to AWS ECR March 29, 2023 10:03 — with GitHub Actions Inactive
kevzzsk
kevzzsk previously approved these changes Mar 29, 2023
@jordankzf jordankzf force-pushed the jordankzf/eth-transactions-api branch from d7a86ac to 1b96dc5 Compare March 30, 2023 13:11
@jordankzf jordankzf temporarily deployed to AWS ECR March 30, 2023 13:11 — with GitHub Actions Inactive
@jordankzf jordankzf requested a review from thedoublejay March 30, 2023 13:11
@jordankzf jordankzf temporarily deployed to AWS ECR March 31, 2023 03:39 — with GitHub Actions Inactive
Copy link

@pierregee pierregee left a comment

Choose a reason for hiding this comment

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

Can we add tests that it only returns the transactions that are within the specified fromDate and toDate?

@thedoublejay thedoublejay marked this pull request as draft April 3, 2023 05:16
@jordankzf jordankzf temporarily deployed to AWS ECR April 4, 2023 04:41 — with GitHub Actions Inactive
@jordankzf
Copy link
Contributor Author

Added mock transaction database entries

CC: @kevzzsk @pierregee @thedoublejay

@jordankzf jordankzf requested review from pierregee and kevzzsk April 4, 2023 04:42
@kevzzsk kevzzsk marked this pull request as ready for review April 4, 2023 05:12
@jordankzf jordankzf temporarily deployed to AWS ECR April 4, 2023 08:19 — with GitHub Actions Inactive
@jordankzf jordankzf requested a review from pierregee April 4, 2023 08:19
pierregee
pierregee previously approved these changes Apr 4, 2023
Copy link

@pierregee pierregee left a comment

Choose a reason for hiding this comment

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

LGTM

@jordankzf jordankzf requested a review from kyleleow as a code owner April 4, 2023 09:18
@jordankzf jordankzf temporarily deployed to AWS ECR April 4, 2023 09:18 — with GitHub Actions Inactive
@jordankzf jordankzf force-pushed the jordankzf/eth-transactions-api branch from 9d36277 to 6b25afe Compare April 4, 2023 09:35
@jordankzf jordankzf temporarily deployed to AWS ECR April 4, 2023 09:35 — with GitHub Actions Inactive
readonly timestamp: string,
readonly status: string,
readonly sendTransactionHash: string | null,
readonly unconfirmedSendTransactionHash: string | null,
Copy link
Contributor

Choose a reason for hiding this comment

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

@jordankzf Note, if you want to make it optional just add ?. To check on another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed here: #847 (comment)

import { buildTestConfig, TestingModule } from '../TestingModule';

function verifyFormat(parsedPayload: TransactionsDto) {
expect(parsedPayload).toHaveProperty('txHash');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this test can be improved. We need to check if the type is correct. Let's say, we updated the schema. All consumers of this API will break. So we need to know if that happens. Anyway, we can fix it on another PR.

@thedoublejay thedoublejay merged commit 383d1a1 into main Apr 5, 2023
@jordankzf jordankzf deleted the jordankzf/eth-transactions-api branch April 5, 2023 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an API endpoint /ethereum/transactions
4 participants