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

Fix: show relays even when 0 relays left #2789

Merged
merged 5 commits into from
Nov 13, 2023
Merged

Fix: show relays even when 0 relays left #2789

merged 5 commits into from
Nov 13, 2023

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Nov 10, 2023

What it solves

The relay function disappearing when there are 0 relays is not intutive. It's better to show that the quota is over and that it will reset in an hour.

Plus, I've added a warning that the connected wallet should have enough funds (steps on the toes of #2678, but it's just a quick fix until that PR is merged).

Relay:
Screenshot 2023-11-10 at 13 50 41

Wallet:
Screenshot 2023-11-10 at 13 50 46

Copy link

github-actions bot commented Nov 10, 2023

Branch preview

✅ Deploy successful!

https://--walletweb.review-wallet-web.5afe.dev

Copy link

github-actions bot commented Nov 10, 2023

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

Comment on lines +61 to +65
{relays && !relays.remaining && (
<Box component="span" sx={{ color: 'error.main' }}>
{' '}
&mdash; will reset in the next hour
</Box>
Copy link
Member

Choose a reason for hiding this comment

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

I think this is slightly redundant since the label already says "Transactions per hour". Maybe we could instead make the "0 of 5" a red color?

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 added this based on Liliya's feedback. It might be redundant, but it's definitely clearer. IMO we should err on the safe side.

Copy link

github-actions bot commented Nov 10, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.05% (-0.01% 🔻)
10106/13466
🔴 Branches
49.54% (-0.05% 🔻)
2055/4148
🔴 Functions 57.48% 1498/2606
🟡 Lines
76.62% (-0.01% 🔻)
9142/11932
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / ExecuteForm.tsx
40.98% (-0.95% 🔻)
0% 0%
41.67% (-0.96% 🔻)

Test suite run success

1105 tests passing in 155 suites.

Report generated by 🧪jest coverage report action from 93e9e88

@@ -57,11 +56,10 @@ const ExecuteForm = ({
const [executionMethod, setExecutionMethod] = useState(ExecutionMethod.RELAY)

// SC wallets can relay fully signed transactions
const [walletCanRelay] = useWalletCanRelay(safeTx)

const [canRelay] = useWalletCanRelay(safeTx)
Copy link
Member

Choose a reason for hiding this comment

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

I think this naming is more confusing now since its not about if the user can relay but if their wallet supports relaying.

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed it to canWalletRelay.

@francovenica
Copy link
Contributor

francovenica commented Nov 13, 2023

I noticed that now executing with the connected wallet is the default option, it used to be the relayer. Is this an intentional change?

Beyond this the PR looks good to me

@katspaugh katspaugh merged commit 8359c8d into dev Nov 13, 2023
1 check passed
@katspaugh katspaugh deleted the relays branch November 13, 2023 10:00
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2023
@katspaugh katspaugh restored the relays branch November 13, 2023 10:03
@katspaugh katspaugh deleted the relays branch November 13, 2023 10:03
@katspaugh katspaugh restored the relays branch November 13, 2023 10:03
@katspaugh katspaugh deleted the relays branch November 13, 2023 10:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants