-
Notifications
You must be signed in to change notification settings - Fork 39
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
New Tool: Build a Flow SDK - milestone 2-3-4 #101
Conversation
Thanks for the submission @nduplessis . |
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.
Good work on the implementation, however, I have some comments.
I think you should implement your own models for resources like blocks, collections, transactions etc so you can return an instance of such a model instead of returning raw access API responses. There are many benefits in doing so.
Examples:
https://github.com/glucode/flow_client/blob/b9713462681119c15d8a914dc3fd7252722b3078/lib/flow_client/client.rb#L239
https://github.com/glucode/flow_client/blob/b9713462681119c15d8a914dc3fd7252722b3078/lib/flow_client/client.rb#L262
Not doing so causes weird unpacking syntaxes like seen here:
https://github.com/glucode/flow_client/blob/b9713462681119c15d8a914dc3fd7252722b3078/lib/flow_client/client.rb#L213
You could implement cadence models, so instead of passing raw cadence arguments, you could use native implemented cadence types.
Examples:
https://github.com/glucode/flow_client/blob/b9713462681119c15d8a914dc3fd7252722b3078/spec/lib/flow_client/transaction_spec.rb#L277
As mentioned please follow our documentation template and provide it in a file md/mdx in the repository.
Supporting contracts with account creation might be a good idea. Are there good reasons as to why you avoided that?
https://github.com/glucode/flow_client/blob/main/lib/flow_client/client.rb#L62
Thanks @sideninja I've started on many of these items already and will merge them asap |
Great. You have by the end of this week to provide improvements based on the feedback. Let me know if you will have any questions. |
@nduplessis Let us know when you have updates for review! |
Thanks for the heads up @kerrywei. Can you give me an idea which timezone the engineers are in as well by any chance? |
@kerrywei @sideninja I've pushed my latest changes with the models as suggested. If you want to take a look you can do so on master branch. I'm working on the Cadence params and will add the ability to add contracts upon new account creation and will have that merge by Sunday |
Great, looking good. I will keep an eye on upcoming changes. |
I'm having a bit of hard time running some things due to M1 I guess, any suggestions there? Looks like grpc issue.
|
Hey @sideninja, yeah that's probably M1 related. I'm looking into this for you and will revert soonest |
@sideninja this does indeed appear to be a pretty widespread issue: grpc/grpc#24846 (comment) Sorry for not catching this, but unfortunately Apple Silicon is not available on most CI services yet. I'm quickly trying to see if I can rent an M1 in the cloud and will look for a solution |
No worries, you can ping me when you want to test. |
@sideninja OK so the grpc gem isn't in a great state for Apple Silicon at this point. I will need to do some more work to get the published gem to work correctly. In the meantime you should be able to use it locally if you clone the repo, but you'll need to use Ruby 2.7.2 as a minimum. brew install rbenv ruby-build
rbenv install 2.7.2
rbenv local 2.7.2 Install the dependencies bundle install Run the unit tests docker-compose up
bundle exec rspec Use the gem in interactive ruby irb -Ilib -rflow_client Let me know if this works for you please? |
merge in the PR as milestones have been achieved |
New Tool: Build a Flow SDK - Milestone 4
Description
This PR is for issue #20.
This version of the Ruby SDK provides gRPC communication and a number of the SDK user stories, including script execution and single sig transaction signing and sending.
Usage documentation is available at https://github.com/glucode/flow_client
Milestone 4
All user stories from the SDK guidelines have been completed and tests have been added that execute against the emulator.
Usages documentation can be found at https://github.com/glucode/flow_client
Features
Blocks:
Collections:
Events:
Scripts:
Accounts:
Transactions: