Skip to content
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

fixed client docs, added parse #787

Merged
merged 3 commits into from
Jun 4, 2024
Merged

fixed client docs, added parse #787

merged 3 commits into from
Jun 4, 2024

Conversation

brennanjl
Copy link
Collaborator

This PR fixes the core/client docs to correctly reference the parse module, instead of the old kfparser repo. This was noticed by the Truflation team: trufnetwork/node#292

This also makes one small change to the parse submodule, which adds a top-level Parse function. This function is suitable for most usecases, as opposed to the other exposed parsing functions which expose much more information (and don't handle errors intuitively, since they are meant to be used in parsing tools). I have updated most places in our repo where we parse to use the Parse function.

@jchappelow
Copy link
Member

jchappelow commented Jun 3, 2024

@brennanjl Pardon my push. I just update the example app and it's go.mod.

You may still wish to update it to use the function suggested in the revised docs however. It's not quite how I wanted the example app to flow, but it works for docs I think.

Remember that to work on the example app you probably either need to go work use ./core/client/example or do stuff with GOWORK=off.

@brennanjl
Copy link
Collaborator Author

We can get rid of the test.json and the go:embed, right? It seems like you just use a hard-coded schema

@brennanjl
Copy link
Collaborator Author

the unmarshalKf function in the example app now seems a bit useless, right? We create an io.Reader just to read it and parse.

@jchappelow
Copy link
Member

We can get rid of the test.json and the go:embed, right? It seems like you just use a hard-coded schema

Yup, that's funky. Pick whichever seems nicest, embed or literal string.

the unmarshalKf function in the example app now seems a bit useless, right? We create an io.Reader just to read it and parse.

Yes again. That's pretty funny. It definitely started with more purpose, but it's useless now.

@brennanjl brennanjl merged commit 6dc2bc0 into main Jun 4, 2024
2 checks passed
@brennanjl brennanjl deleted the client-docs branch June 4, 2024 18:55
@jchappelow jchappelow added this to the v0.8.0 milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants