Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Replace subprocess with direct python calls #169

Closed

Conversation

andrew-fleming
Copy link
Contributor

This PR proposes to replace subprocess with direct python calls for StarkNet interaction.

Resolves #161.

if signature is None:
signature = []

tx = Declare(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we sending the transaction at this low level instead of using the declare function directly?

I think we are trying to address two problems at the same time, the first one being replacing subprocess calls with direct python calls (as the name of the PR states), and the second one is obtaining output in a better format than string (from print statements).

To solve the first problem, we can import and use the commands from the starknet.cli module directly, (like declare), we don't need to simulate the implementation of that command (as I think we are trying to do with the current code). The current code solves the second problem though, because sadly starknet doesn't provide a Runtime Environment, so to get the output in a better format, we need to "hack" the cli.

Summarizing I think we could replace subprocess more easily by using the CLI commands where we currently call subprocess (I may be missing the full picture). But I think the second problem of course is still super important (could be separated into a different issue maybe?).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericnordelo I totally agree with the above points^ haha that's why in the new PR (#236), we are using the starknet_cli directly. I'll close this PR to avoid further confusion. Sorry about that!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace subprocess with direct python calls
2 participants