-
Notifications
You must be signed in to change notification settings - Fork 94
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
Improve generate_faucet_wallet
interface with custom faucet_host
#364
Comments
What if you just removed anything after
Example code, don't use it since most faucet addresses don't end with address = "https://faucet-nft.ripple.com/accounts"
address_len = len(address)
if address[-9:] == "/accounts":
address = address[0:(address_len-9)]
print(address)
if address[0:8] == "https://":
address_len = len(address)
address = address[8:address_len]
print(address)
elif address[0:7] == "http://":
address_len = len(address)
address = address[7:address_len]
print(address) |
Hello, I agree that we need better docs and error messages. I believe extraneous @wojake Your solution works if every faucet has a prefix of I came up with this draft to improve the error message, but I'm not entirely happy with it. Any suggestions/improvements are most welcome. https://github.com/ckeshava/xrpl-py/tree/issue364 |
could you put this in a draft PR and link it? thanks |
For this purpose, those idiosyncrasies don't matter, because we're building the URL and there's only one variable that's a part of it (the main URL). Also, supporting other endpoints that aren't It also should be pretty easy to check for |
Okay. Is it possible to set up faucet hosts on non- |
It's certainly possible, because you can set up a faucet however you want. But I don't know of anyone that does it like that, or why they would.
I don't quite understand what you mean. Do you mean assume it already starts with |
Yeah, suppose a developer provides Should I return If we prepend |
No URL is being returned to the developer, it's all internal to the IMO the dev should be able to provide any of:
|
The current usage of
faucet_host
is mildly confusing.For example, the NFT faucet is hosted at
https://faucet-nft.ripple.com/accounts
. You have to input onlyfaucet-nft.ripple.com
infaucet_host
. If you leave thehttps
or theaccounts
part in, the method fails, with a pretty ambiguous error.A couple of potential fixes:
os.path.join
. Using that would fix the inclusion of thehttps
./accounts
in, or it should still work.generate_faucet_wallet
method, to emphasize what to use as thefaucet_host
.The text was updated successfully, but these errors were encountered: