-
Notifications
You must be signed in to change notification settings - Fork 0
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
(registry) feat: add claiming to unit details #77
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const owners = await contract.methods.getOwners().call(); | ||
|
||
if (Number(threshold) > 0 && owners.length > 0) { | ||
// TODO: check and fix error: Property 'getStorageAt' does not exist on type 'JsonRpcProvider | FallbackProvider'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls take a look at this, ts says that there's getStorageAt
on provider, but didn't have much time to investigate if it's safe to switch to provider.getStorage
or the impact of this. Maybe we should plan the fix 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why I wrote this 🙈, we should definitely plan to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this project uses ethers v6 you need: https://docs.ethers.org/v6/api/providers/#Provider-getStorage
747b25a
to
c44e1cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for refactoring—I've added a few minor comments.
apps/autonolas-registry/common-util/Details/DetailsSubInfo/RewardsSection.tsx
Outdated
Show resolved
Hide resolved
refetch(); | ||
fetchPendingIncentives(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe await?
refetch(); | |
fetchPendingIncentives(); | |
await refetch(); | |
await fetchPendingIncentives(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can run fetchPendingIncentives
at the same time when running refetch
, no need to wait when it's done, the goal is just to re-request the data. and the result will be recalculated in the rewards useMemo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I was concerned that the loader might not be in sync because we're not using await
.
apps/autonolas-registry/common-util/Details/DetailsSubInfo/RewardsSection.tsx
Show resolved
Hide resolved
const owners = await contract.methods.getOwners().call(); | ||
|
||
if (Number(threshold) > 0 && owners.length > 0) { | ||
// TODO: check and fix error: Property 'getStorageAt' does not exist on type 'JsonRpcProvider | FallbackProvider'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why I wrote this 🙈, we should definitely plan to fix this.
apps/autonolas-registry/tests/components/ListAgents/details.test.jsx
Outdated
Show resolved
Hide resolved
apps/autonolas-registry/tests/components/ListComponents/details.test.jsx
Outdated
Show resolved
Hide resolved
70e54e9
to
186b21e
Compare
const owners = await contract.methods.getOwners().call(); | ||
|
||
if (Number(threshold) > 0 && owners.length > 0) { | ||
// TODO: check and fix error: Property 'getStorageAt' does not exist on type 'JsonRpcProvider | FallbackProvider'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this project uses ethers v6 you need: https://docs.ethers.org/v6/api/providers/#Provider-getStorage
@truemiller interesting, thanks! will take a look at it |
288d924
to
da9194c
Compare
da9194c
to
756b7d1
Compare
Proposed changes
getPendingIncentives
logic (there's no need to get mappers for both agents and components since we pass the unitType)Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply