-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: add jams
support
#55
Conversation
6a41fce
to
4fd2ab3
Compare
4fd2ab3
to
f1d3b2b
Compare
Good now let’s add a test, I know we didn’t have one but that’s no excuse haha |
Yup, that's what I was gonna ask. But current tests aren't working with this change. Still getting |
@dsam82 I cloned your fork and was able to get tests passing locally without any changes. are you still running onto this issue? |
f0b959a
to
32378ac
Compare
Unfortunately, yes. Have still added the tests, but can't remove this stupid error on my system. |
arg = (isCid(arg)) ? await getIpfsJson(arg) : require(arg) | ||
if (isCid(arg)) { | ||
arg = getIpfsJson(arg) | ||
} else if (arg.split('.').pop() === 'jams') { |
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 3-way branch is not right, we have 2x2 options,
- Are we using a CID and fetching it from IPFS, or opening a local file?
- Is it JAMS or JSON?
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.
Does this work?
if (isCid(arg)) {
arg = getIpfsJson(arg)
} else {
arg = (arg.split('.').pop() === 'jams')
? jams(readFileSync(arg))
: require(arg)
}
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 one is missing the case that it is a CID that points to a JAMS file, maybe refactor getIpfsJson
to just getIpfsFile
then branch from there, point is there are 4 cases
@dmfxyz Were you on the feat/jams-support branch when you had tests passing? I get the same failures |
Ignore this -- I was on the wrong branch. |
Motivation
Hopes to Resolve #54 ;)