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

Only show SendTransaction on your accounts #865

Merged
merged 1 commit into from Jun 23, 2022
Merged

Only show SendTransaction on your accounts #865

merged 1 commit into from Jun 23, 2022

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Jun 17, 2022

Before:

  • user imports oasis1qqug..hsu8 to wallet
  • search oasis1qr9t..gxfl
  • see SendTransaction component to transfer from oasis1qqug..hsu8 to any Recipient
    oasis1qquga66n9mzypsayerxnkp8p343g5ufwny4dhsu8_to_oasis1qr9tkn7cg2rg95ps7td0ar3ghqru8y225s4tgxfl

@lukaw3d lukaw3d requested review from buberdds and pro-wh June 17, 2022 02:15
@github-actions
Copy link

github-actions bot commented Jun 17, 2022

MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 3 0 0.01s
✅ GIT git_diff yes no 0.01s
✅ TSX eslint 3 0 0 4.61s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@codecov
Copy link

codecov bot commented Jun 17, 2022

Codecov Report

Merging #865 (5341f2e) into master (7d07e97) will decrease coverage by 0.02%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master     #865      +/-   ##
==========================================
- Coverage   88.05%   88.02%   -0.03%     
==========================================
  Files          96       96              
  Lines        1599     1604       +5     
  Branches      334      336       +2     
==========================================
+ Hits         1408     1412       +4     
- Misses        191      192       +1     
Flag Coverage Δ
cypress 58.16% <85.71%> (+0.06%) ⬆️
jest 74.57% <28.57%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ges/AccountPage/Features/SendTransaction/index.tsx 92.59% <66.66%> (-3.41%) ⬇️
...ages/AccountPage/Features/AccountDetails/index.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d07e97...5341f2e. Read the comment docs.


export function SendTransaction(props: SendTransactionProps) {
if (!props.isAddressInWallet) {
throw new Error('SendTransaction component should only appear on your accounts')
Copy link
Contributor

@buberdds buberdds Jun 17, 2022

Choose a reason for hiding this comment

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

I get idea that entire app will blow up to catch an error, but I think it's better to cover such scenarios in unit tests than in a component via new Error.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think tests can ensure that we devs don't move SendTransaction outside the condition:

      {isAddressInWallet && (
        ...
          <SendTransaction

Maybe with integration tests of all possible user flows 🤷

@lukaw3d lukaw3d merged commit 1f3cff4 into master Jun 23, 2022
@lukaw3d lukaw3d deleted the lw/send-your branch June 23, 2022 18:41
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.

None yet

3 participants