-
Notifications
You must be signed in to change notification settings - Fork 8
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
Introduce Polkassembly API integration #79
Conversation
if (!loginBody.token) { | ||
throw new Error("Login unsuccessful, the authentication token is missing."); | ||
} | ||
this.token = loginBody.token; |
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.
may be worth adding some debug logs to login and signup?
void (async () => { | ||
const condition = async (): Promise<boolean> => { | ||
const lastReferendum = await polkassembly.getLastReferendumNumber(track.track.trackNo); | ||
return lastReferendum !== undefined && lastReferendum >= referendumId.toNumber(); |
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.
this could be vague and there's a chance that someone else right in the same moment posts a referendum to the same track, so we can endup with editing wrong post.
Small chance but exists
I'm curious if there would be more direct way to get a sense of referendum ID once we created 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.
Agree, there is a small chance it goes wrong.
I don't (yet) know if we can get the ID from the transaction callbacks.
Note: I have listed some follow-up improvements here. |
This introduces a
Polkassembly
class that integrates with the Polkassembly API.It works in two modes - with a Polkadot signer, and an Ethereum signer.
The Polkadot signer is to be used in production, and Ethereum signer was used to test it with the Moonbase Alpha.
Once we have another testnet with OpenGov and Polkassembly, we can remove the Ethereum portion.
For now I used Moonbase Alpha EMV chain to semi-manually test it.