-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use client as primary token source #1967
Conversation
validate against entering a duplicate addressThis comment was generated by todo based on a
|
74b5fcd
to
2f02621
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.
Most of what I was able to test was blocked by the TokenInfoDocument
query failing
Just from reading the code it all seems sensible.
So I'll do another pass once you fix that issue with the query
console.warn(`Token with address ${tokenAddress} not found on server`); | ||
} | ||
|
||
const serverData: TokenInfo = serverDataResult |
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.
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.
Fixed! Thanks!
return ( | ||
<div className={styles.main}> | ||
<div className={styles.tokenChoice}> | ||
<TokenIcon token={token} name={token.name || undefined} /> |
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.
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.
Yeah, I honestly have no idea what causes this. $$typeof
comes from react so it should be OK
@@ -190,17 +183,6 @@ const StepCreateToken = ({ | |||
help={MSG.helpTokenSymbol} | |||
/> | |||
</div> | |||
<div className={styles.inputFieldWrapper}> | |||
<ActionFileUpload | |||
name="tokenIcon" |
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 we removed the Token info from the native token creation screen, shouldn't we also remove it from the external token "creation" page?:
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.
Also, I think we need to make @JoinColony/product aware of this change
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.
Yes, we should remove that, good catch!
|
||
let serverDataResult; | ||
try { | ||
const { data } = await client.query({ |
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.
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.
Thanks, this is a good find!
26694d0
to
3758e62
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.
After adding those two fixes everything seems to be working fine, so congrats Chris!
This was a lot of work, both on the dapp and the server side, and you've done an amazing job.
I've tested every interaction I could think of: native tokens, external tokens, send in, claiming, minting, etc.
Everything works well, but again, I do worry about the Ethplorer API key limitation.
I did find a UX issue we can improve on in the future:
- You send in an external token
- You claim it for your colony
- It won't show up in your colony's tokens, until you manually add it via it's address
This all works as expected now, but an improvement here would be to automatically add that token to the user's colony when claiming the funds, as we already have all the data we need for that.
But again, this is a minor improvement, and it's nowhere near a priority right now.
* Update colony tokens after mutation
3758e62
to
2003676
Compare
Description
This PR adds local resolvers for token data which query the token contracts directly instead of relying on the server. The colony and user tokens are still stored on the server but just as addresses. Furthermore we changed the way the tokens are added to colonies and users (via entering a token address in the edit tokens dialog).
New stuff ✨
Changes 🏗
Resolves #1959
Resolves #1971
Resolves #1978