-
Notifications
You must be signed in to change notification settings - Fork 105
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
bug: governance and unbonding fixes #1044
Conversation
68e8fa9
to
f4e5002
Compare
export const lastBlockHeightAtom = atom( | ||
(get) => get(controlRoutineAtom).shouldUpdateAmount, | ||
(get) => get(controlRoutineAtom).lastBlockHeight, |
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.
Actually not sure if this is correct, just seemed wrong :D
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.
Code LGTM! I'm having a hard time testing atm, but everything looks in order!
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.
Looks good to me! I am just waiting for my proposal to become active on the testnet in order to test this.
@@ -257,16 +258,16 @@ const fromIndexerStatus = ( | |||
|
|||
const toIndexerStatus = ( | |||
proposalStatus: ProposalStatus | |||
): IndexerProposalStatusEnum => { | |||
): ApiIndexerProposalStatusEnum => { |
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.
What does this change do? It looks we are using ProposalStatusEnum
in some cases but ApiV1GovProposalGetStatusEnum
in others and I'm not sure what the difference is.
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.
So there are two enums specified in swagger file. One is for status used in query params and other is used as a part of proposal response type. I think they should always be the same(kind of), but in rust we have two, because query params and response are two separate things.
FIrst:
status:
type: string
enum: [pending, voting, passed, rejected]
Second:
schema:
type: string
enum: [pending, votingPeriod, passed, rejected]
It's a bit confusing :D We can potentially leave two enums in rust but have only one described in swagger 🤔
queryFn: async () => { | ||
const all_bonds = await api.apiV1PosBondAddressGet(account.data!.address); | ||
return { | ||
queryKey: ["can-vote"], |
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.
Not introduced in this PR, but queryKey
is missing the dependencies (definitely account
and I think possibly api
too), so this doesn't react when the default account is changed in the extension.
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.
Cool! I will fix that
@@ -19,4 +21,27 @@ export const useTransactionCallback = (): void => { | |||
useTransactionEventListener("Bond.Success", onBalanceUpdate); | |||
useTransactionEventListener("Unbond.Success", onBalanceUpdate); | |||
useTransactionEventListener("Withdraw.Success", onBalanceUpdate); | |||
|
|||
const store = createStore(); |
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.
It might be better to use getDefaultStore
here in case you get the same problems as in #1007.
const { refetch: refetchProposalFamily } = store.get( | ||
proposalFamily(proposalId) | ||
); | ||
refetchProposalFamily(); |
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.
Just to double check: Is this needed because setting refetchInterval
on the atom will mean we need to wait 1 second before the first refetch?
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.
Hmm I kind of copied it mindlessly from the example above :D but I think you are right. I think in this case we can just remove it, there is no chance we get proposal status right away. I will double check this
EDIT: removed!
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 just finished testing now that my proposal is live. The voting seems to work well and the times look good, but Namadillo seems to get stuck polling for the proposal data forever even after I refresh. I'm not sure exactly where that's happening though.
89eacfd
to
7b11581
Compare
Test it with 0.43.0 and this indexer