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

Various improvements #109

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Various improvements #109

wants to merge 27 commits into from

Conversation

nicolasbrugneaux
Copy link
Contributor

@nicolasbrugneaux nicolasbrugneaux commented Nov 29, 2024

This PR introduces various refactors and features that aim to fix the following tickets:
It also adds a new testing environment (anvil), fairly basic for now but at leat can serve as a good dev base for the future. It also adds supports for custom RPC urls via an environment variable

Closes:

Others:

  • shows the accurate unlocking period, fetched from contract rather than hardcoded 3 days

@nicolasbrugneaux nicolasbrugneaux self-assigned this Nov 29, 2024
Copy link

vercel bot commented Nov 29, 2024

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

Name Status Preview Updated (UTC)
celo-mondo ✅ Ready (Inspect) Visit Preview Dec 19, 2024 3:19pm

Copy link

socket-security bot commented Dec 4, 2024

@nicolasbrugneaux nicolasbrugneaux changed the title WIP Various improvements Various improvements Dec 18, 2024
Copy link
Contributor

@shazarre shazarre left a comment

Choose a reason for hiding this comment

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

amazing stuff! 🚀

how about adding a small how to qa instructions so I can go over them and test for myself?

package.json Show resolved Hide resolved
);
expect(request.twitterUrl).toBe('https://example.com/x');
expect(request.verificationUrl).toBe('https://example.com/verification');
expect(request.websiteUrl).toBe('https://example.com');
Copy link
Contributor

Choose a reason for hiding this comment

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

the reason I'd rather leave the snapshot is that if we add new fields to the form then it has to be added here explicitly

and we're missing checking for the file properties like mime type and size in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the timestamp kept changing that's the reason

Copy link
Contributor

Choose a reason for hiding this comment

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

which timestamp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the file's created at

}),
} as Chain;

// TODO: too complex, refactor this
Copy link
Contributor

Choose a reason for hiding this comment

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

still valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still valid need to do it

src/config/contracts.ts Show resolved Hide resolved
src/config/wagmi.tsx Show resolved Hide resolved
src/utils/runtimeBlockNumber.ts Outdated Show resolved Hide resolved
balance: BigInt(formatEther(TEST_BALANCE)),
gasPrice: TEST_GAS_PRICE,
gasLimit: TEST_GAS_LIMIT,
forkUrl: ANVIL_FORK_URL,
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need to fork at all?

src/test/anvil/setup.ts Show resolved Hide resolved
src/features/locking/useLockedStatus.ts Show resolved Hide resolved
@@ -52,7 +54,7 @@ function DelegatorsTableContent({ delegatee }: { delegatee: Delegatee }) {
{tableData.map((row) => (
<tr key={row.label}>
<td className="py-2 font-mono text-sm text-taupe-600">
<ShortAddress address={row.label as `0x${string}`} />
<ShortAddress address={row.address!} />
Copy link
Member

Choose a reason for hiding this comment

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

what happens when the address has a name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you look at the table data, the object is defined as following:

      label: address,
      value: fromWei(delegatorToAmount[address]),
      address: normalizeAddress(address),

I purely used the .address! to prevent type cast as well as having normalized addresses

@aaronmgdr
Copy link
Member

aaronmgdr commented Dec 18, 2024

i think all my suggestions are either quick fixes or if they turn out not to be not something to block merging for.

@nicolasbrugneaux
Copy link
Contributor Author

With the christmas holiday approaching, we decided to merge this in the new year to prevent deploying when we're off, will work on the prool comment that I decided to table earlier

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.

Increase trust in celo mondo's code by adding coverage and tests
3 participants