-
Notifications
You must be signed in to change notification settings - Fork 32
feat: check testnet account for funding #33
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
Conversation
|
@ElliotFriend please review. |
ElliotFriend
left a comment
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 for the PR! i think you're pretty close. i'm requesting a couple nitpicky changes. after they're resolved, I think this will be good to go!
src/lib/stellar/horizonQueries.js
Outdated
| if (err.response?.status === 404) { | ||
| throw error(404, 'account not funded on network') | ||
| try { | ||
| fundWithFriendbot(publicKey) |
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 think you'll want to await fundWithFriendbot(...) here
src/lib/stellar/horizonQueries.js
Outdated
|
|
||
| let account = await server.accounts().accountId(publicKey).call() | ||
| return account | ||
| } catch (error) { |
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.
| } catch (error) { | |
| } catch (err) { |
This will be more consistent with the rest of the codebase
|
@ElliotFriend , please review again |
ElliotFriend
left a comment
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.
one more tiny nitpick and this is ready to go! Thanks!!
src/lib/stellar/horizonQueries.js
Outdated
| return account | ||
| } catch (err) { | ||
| throw error(500, { | ||
| message: `Unable to fund account ${publicKey}: ${error.message}`, |
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.
| message: `Unable to fund account ${publicKey}: ${error.message}`, | |
| message: `Unable to fund account ${publicKey}: ${err.message}`, |
this'll need to change to err, as well
|
@ElliotFriend please review again🥲 |
ElliotFriend
left a comment
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.
excellent! Thanks so much for the contribution!
fixes #7