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

Use wallet in smartcontract deploy/invoke commands and calculate GAS properly #747

Merged
merged 2 commits into from
Mar 12, 2020

Conversation

roman-khimov
Copy link
Member

Problem

Real GAS needed to deploy smartcontract was not calculated, so one could only try different GAS values to see which one fits. Wallets were also not integrated properly into this part of the CLI.

That's how it was intended to behave originally. One thing questionable here
is contract price (policy thing, basically) being moved to smartcontract
package, but it's probably fine for NEO 2.0 (as it won't change) and we'll
make something better for NEO 3.0.
@roman-khimov roman-khimov added the smartcontract Smart contracts and associated package label Mar 11, 2020
@roman-khimov roman-khimov added this to the v0.74.0 milestone Mar 11, 2020
@roman-khimov roman-khimov added the wallet NEP-6 wallet and accounts label Mar 11, 2020
@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #747 into master will decrease coverage by 0.09%.
The diff coverage is 3.12%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #747     +/-   ##
=========================================
- Coverage   66.12%   66.02%   -0.1%     
=========================================
  Files         138      139      +1     
  Lines       12404    12413      +9     
=========================================
- Hits         8202     8196      -6     
- Misses       3807     3822     +15     
  Partials      395      395
Impacted Files Coverage Δ
pkg/rpc/request/txBuilder.go 50.67% <0%> (-0.7%) ⬇️
pkg/smartcontract/deployment_price.go 0% <0%> (ø)
pkg/rpc/client/rpc.go 0% <0%> (ø) ⬆️
pkg/core/gas_price.go 66.66% <100%> (-2.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 695c4dd...25da5a3. Read the comment docs.

cli/smartcontract/smart_contract.go Outdated Show resolved Hide resolved
Passing WIF directly in the command line is not something we should be doing.

Also split netfee and sysfee in the RPC as they're different (and add a script
attribute for free transactions).
@roman-khimov roman-khimov merged commit 734778c into master Mar 12, 2020
@roman-khimov roman-khimov deleted the fix-contract-deploy-gas-parameter branch March 12, 2020 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smartcontract Smart contracts and associated package wallet NEP-6 wallet and accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants