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

Feature/use polkadot api #3

Merged
merged 25 commits into from Aug 4, 2022
Merged

Feature/use polkadot api #3

merged 25 commits into from Aug 4, 2022

Conversation

codespool
Copy link
Collaborator

  • replace calls to cargo contract in deploy command in favour of polkadot.js api calls
  • introduce ChainApi class to handle api interaction
    • also DeployApi subclass with methods specific to deployment
  • add listr sequence to deploy command

TODO:

  • Utilise instantiate RPC call to get correct gas cost automatically

src/commands/deploy/index.ts Outdated Show resolved Hide resolved
src/commands/deploy/index.ts Outdated Show resolved Hide resolved
src/commands/deploy/index.ts Show resolved Hide resolved
@codespool
Copy link
Collaborator Author

@hoonsubin
as agreed, I left the api instance in use.
I have added account command with create and list subcommands and the possibility to generate or submit own mnemonic.
Also, the node url is now taken from config.
Some utility functions added as well.

this.log(
`\t${yellowBright("Alias: ")} ${account.alias.padEnd(
12
)} ${yellowBright("Mnemonic: ")} ${account.mnemonic}`
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's a good idea to log the mnemonic to the console

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking about how it shouldn't be in the in the config neither, that's why there's a warning to only store dev accounts, and this is output only with --verbose flag.
It's useful for example when you want to add those to polkadot.js app to transfer some tokens to it.
That being said, I agree, we can't trust the user not to use those in prod. I'll remove the option for now and think about how to actually prevent using stored accounts for prod deployments.

Copy link
Member

@hoonsubin hoonsubin left a comment

Choose a reason for hiding this comment

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

Lgtm

@codespool codespool merged commit ac96fb0 into master Aug 4, 2022
@codespool codespool deleted the feature/use-polkadot-api branch August 4, 2022 06:33
@codespool codespool restored the feature/use-polkadot-api branch September 22, 2022 09:15
@codespool codespool deleted the feature/use-polkadot-api branch September 22, 2022 09:16
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.

None yet

2 participants