-
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 [Rust] - Milestone 1 #37
Conversation
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.
Hey @fee1-dead, thanks for the submission.
I really like your gRPC implementation. The helper macros are really powerful.
I've left one minor comment on the user stories, but otherwise looks good!
@fee1-dead A couple other developers have been working on a Rust library. Would you be open to collaborating? If so, I can make an introduction!
submissions/issue-20/milestone-1/fee1-dead/20210919-milestone-1.md
Outdated
Show resolved
Hide resolved
submissions/issue-20/milestone-1/fee1-dead/20210919-milestone-1.md
Outdated
Show resolved
Hide resolved
Are you talking about https://github.com/MarshallBelles/flow-rust-sdk? If so, then the answer is no. I did take a look at it, but I think my design works best from the ground up. I did see some problems with their code, for example not having generic arguments, or worse, not using the expected type at all. (see MarshallBelles/flow-rust-sdk#2) In this example, the URI string is very likely to be a literal |
&String is necessary for thread safety and usability. You're always welcome to fork my code and adjust for your own needs. The project is both MIT and Apache v2.0 so you can choose how you want to use it. The heap reference is really not a big deal unless you are wanting to run on a very low memory device. |
Also, Arguments are handled in the flow-rust-sdk like this: let keys_arg = process_keys_args(account_keys);
let contracts_arg = Argument::dictionary(vec![]);
let keys_arg = json!(keys_arg);
let contracts_arg = json!(contracts_arg);
let transaction: Transaction = build_transaction(
create_account_template.to_vec(),
vec![
serde_json::to_vec(&keys_arg)?,
serde_json::to_vec(&contracts_arg)?,
],
latest_block.block.unwrap().id,
1000,
proposer,
vec![payer.clone()],
payer.clone(),
)
.await?; |
I see it as a big deal because it makes the API hard to use in a way, and introduces unnecessary overhead.
|
I disagree. I find the String much more useful even at the price of heap allocation, But you are free to do as you like. Best of luck to you good sir! |
Looks good, thanks @fee1-dead |
Description
This PR is for issue #20.
This PR fulfills the requirements for Milestone 1:
Submission Links & Documents
NA
Requirements Check
Other Details
Please see the rendered md and rust sdk repository.
None at the moment.