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: Add batch execute button and tx highlighting #352

Merged
merged 11 commits into from
Aug 16, 2022
Merged

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Aug 15, 2022

What it solves

  • Adds Execute Batch Button to Queue
  • Highlights batchable transactions when hovering the button

ToDos

  • Implement tests

Screenshots

Screenshot 2022-08-15 at 16 51 29

Screenshot 2022-08-15 at 16 51 23

@github-actions
Copy link

github-actions bot commented Aug 15, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 15, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d318c75
Status: ✅  Deploy successful!
Preview URL: https://bb7cea5d.web-core.pages.dev
Branch Preview URL: https://batch-execute.web-core.pages.dev

View logs

import { styled } from '@mui/material/styles'
import Tooltip, { tooltipClasses, TooltipProps } from '@mui/material/Tooltip'

const CustomTooltip = styled(({ className, ...props }: TooltipProps) => (
Copy link
Member Author

Choose a reason for hiding this comment

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

Only extracted this so it can be reused

@usame-algan usame-algan changed the title WIP: Add batch execute button and tx highlighting feat: Add batch execute button and tx highlighting Aug 15, 2022
@usame-algan usame-algan requested a review from iamacook August 15, 2022 14:52
Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Amazing work dude 💪

batchableTransactions.length < BATCH_LIMIT &&
isMultisigExecutionInfo(tx.transaction.executionInfo) &&
tx.transaction.executionInfo.nonce === currentNonce &&
tx.transaction.executionInfo.confirmationsSubmitted >= tx.transaction.executionInfo.confirmationsRequired
Copy link
Member

Choose a reason for hiding this comment

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

I know its just a minor bug but lets add a condition here that we stop adding txs to the batch if an update safe tx was added.
5afe/safe-react#4014

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed lets tackle this in a separate task as it involves decoding each tx which could blow up the scope

import { selectPendingTxs } from '@/store/pendingTxsSlice'
import CustomTooltip from '@/components/common/CustomTooltip'

const BATCH_LIMIT = 10
Copy link
Member

Choose a reason for hiding this comment

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

I know it was 10 txs before. But I'm not 100% sure where the 10 is coming from. Is it about the block gas limit?
If yes: Some apps like tx builder / csv airdrop can by itself create huge txs. 10 of those would not fit.

Copy link
Member Author

Choose a reason for hiding this comment

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

As far as I remember we chose 10 arbitrarily. By default we get 20 per page now I think so we could increase it to that

Copy link
Member

Choose a reason for hiding this comment

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

Actually now infinite scroll makes more sense. 🤔

@usame-algan usame-algan requested a review from iamacook August 16, 2022 10:43
@usame-algan usame-algan requested a review from schmanu August 16, 2022 11:48
Copy link
Member

@schmanu schmanu left a comment

Choose a reason for hiding this comment

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

Let's go! Nice work! 🚀

@usame-algan usame-algan merged commit 8210a89 into main Aug 16, 2022
@usame-algan usame-algan deleted the batch-execute branch August 16, 2022 13:18
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.

4 participants