-
Notifications
You must be signed in to change notification settings - Fork 76
Conversation
src/nile/commands/proxy.py
Outdated
signer_data = next(accounts.load(str(signer.public_key), network)) | ||
signer.account = signer_data["address"] | ||
signer.index = signer_data["index"] | ||
else: #doesn't exist, havbe to deploy |
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.
There should be a space between #
and doesn't
. There's a typo (havbe
should be have
).
src/nile/commands/proxy.py
Outdated
signer.index = accounts.current_index(network) | ||
subprocess.run(f"nile deploy Account {signer.public_key} --alias account-{signer.index}", shell=True) | ||
address, _ = next(deployments.load(f"account-{signer.index}", network)) | ||
#initialize account |
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.
Space between #
and initialize
I like this! I added a couple of nitpicky comments. |
Fixed it! |
Ok there are a couple of linting issues. My advice is to run |
This looks very nice! A few comments:
Future work could be:
|
src/nile/commands/proxy.py
Outdated
signer.index = signer_data["index"] | ||
else: # doesn't exist, have to deploy | ||
signer.index = accounts.current_index(network) | ||
subprocess.run(f"nile deploy Account {signer.public_key} --alias account-{signer.index}", shell=True) |
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.
why not importing the module?
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.
I didn't even think about it when prototyping initially. Good catch, fixed it!
I renamed them to |
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.
Looks good to me. All issues have been addressed, thanks!
src/nile/signer.py
Outdated
"""Utility for sending signed transactions to an Account on Starknet.""" | ||
import subprocess | ||
|
||
from starkware.cairo.common.hash_state import compute_hash_on_elements |
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.
These should be be wrapped in a try catch to avoid throwing when users don't have cairo installed yet (and want to use nile to install it).
One last thing before I'm ready to merge. Sorry for letting you wait so long to review this PR! |
README.md
Outdated
|
||
A few things to notice here: | ||
|
||
1. `nile set <env_var>` looks for an environement variable with the same name whose value is a private key |
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.
there's no nile set
command :)
@@ -88,6 +88,56 @@ A few things to notice here: | |||
3. The `--alias` parameter lets me create an unique identifier for future interactions, if no alias is set then the contract's address can be used as identifier | |||
4. By default Nile works on local, but you can pass `--network mainnet` to deploy directly to a public chain! Notice that `mainnet` refers to StarkNet main chain, that's settled on Goerli testnet of Ethereum ([mainnet deployment this month!](https://medium.com/starkware/starknet-alpha-is-coming-to-mainnet-b825829eaf32)) | |||
|
|||
### `setup` | |||
You can find an exemple `.env` file in `example.env`. These are private keys only to be used for testing and never in production. |
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.
exemple
-> example
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.
Looks like it works well on a local network but does not work on mainnet because the network argument is missing in the call to get the nonce.
src/nile/signer.py
Outdated
def get_nonce(self): | ||
"""Get the nonce for the next transaction.""" | ||
nonce = subprocess.check_output( | ||
f"nile call account-{self.index} get_nonce", shell=True, encoding="utf-8" |
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.
Here it's missing a --network
argument so when using a non-default network this call fails
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.
I run this in a fresh venv and everything is working as expected
Thanks all 🎉 |
* Signer support * stringified all command items * loading pkeys from .env * added accounts.json management * updated readme' * Added nile send * fixed comments spacing * passing tox linting * renamed the proxy commands and added examples * import module instead of cli commands * fixed README typo * fixed another readme typo * fixed import path issues + functions arguments * shipping Account artifacts + fixed setup file * try/catch starkware import + readme typo fixed * forgot to run tox format * passing network to signer
No description provided.