-
Notifications
You must be signed in to change notification settings - Fork 17
Make Web4Write available in the repl #183
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
Those should read as sentences like "describe something" and "it should have this property"
ethanfrey
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.
This works quite nice, what I was looking for :)
One problem is it seems to die on errors (not just show them, but kill ts-node). This can be fixed in another PR, but I will document in the comments.
| throw new Error("Recipient count starts at 1"); | ||
| } | ||
| while (profile.getIdentities(0).length < n + 1) { | ||
| // will make identities if needed. |
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.
nice cleanup
| const faucet = faucetId(profile); | ||
| const rcpt = await recipient(profile, 4); | ||
| const rcptAddr = writer.keyToAddress(chainId, rcpt.pubkey); | ||
| const faucet = await getOrCreateIdentity(profile, 0); |
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, this is clearer here
| # this assumes it was run after bov_init.sh and this exists | ||
| DIR="${HOME}/bovtest/${TM_VERSION}" | ||
| if [ ! -d "${DIR}" ]; then | ||
| if [ ! -d "${BOV_DIR}" ]; then |
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.
ahh... nice that you pull this into travis.sh, but maybe we can provide a default here for local testing (so I don't have to always type this).
like BOV_DIR=${BOV_DIR:-/tmp/bovtest}
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.
Having a static default brings back the problem of re-using the directory that contains files owned by root.
The local way to go is probably to automatically set BOV_DIR and TM_DIR to a new dir when you open a session. Or when booting the machine. I don't know. But I guess it is better to handle this outside of the repo.
|
It works great until I have a typo, then ts-node dies rather than show the error :( The weird thing is that I tried to reproduce this with a normal error, and it wouldn't die. Note that |
|
|
|
Okay, will merge this, works in positive case... what is left to do is make it more robust:
Simple hack to fix wait issue (need to refine it a bit): (Ideally this "hack" would throw the original error, not print and throw another one) |
Fair enough, but we should make it safe when using wait() then, which may expand the scope of the other issue. Basically |
|
Yeah, I consider the missing reject handling a bug in deasync2.await ("Probably an issue of deasync2. Will try to reproduce and report there"). deasync2.await is supposed to work like the |
|
Okay, so we just wait for upstream fix? |
I think I can propose a fix upstream. Should be relatively easy: https://github.com/bluelovers/deasync/blob/master/index.js#L77 |
|
Here you go: bluelovers/deasync#4 I'd wait a couple of days for a merge. But if you think it is critical, we can switch to the fork at any time. |
No description provided.