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

Move code generation from rpcclient to smartcontract #2610

Merged
merged 4 commits into from
Jul 26, 2022
Merged

Conversation

roman-khimov
Copy link
Member

Moving on with #2597.

RPC client shouldn't build scripts and this function can be useful as a
reusable building block.
@roman-khimov roman-khimov added the rpc RPC server and client label Jul 25, 2022
@roman-khimov roman-khimov added this to the v0.99.1 milestone Jul 25, 2022
@roman-khimov roman-khimov requested a review from fyrchik July 25, 2022 19:46
Move the last remaining script-related things out of the rpcclient.
@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #2610 (c8ff489) into master (68b5260) will increase coverage by 0.07%.
The diff coverage is 83.17%.

@@            Coverage Diff             @@
##           master    #2610      +/-   ##
==========================================
+ Coverage   84.52%   84.59%   +0.07%     
==========================================
  Files         297      299       +2     
  Lines       37865    37882      +17     
==========================================
+ Hits        32005    32048      +43     
+ Misses       4454     4424      -30     
- Partials     1406     1410       +4     
Impacted Files Coverage Δ
cli/wallet/validator.go 72.15% <40.00%> (-3.27%) ⬇️
pkg/core/native/oracle.go 72.19% <50.00%> (-0.08%) ⬇️
pkg/rpcclient/nep11.go 51.66% <50.00%> (-0.54%) ⬇️
pkg/rpcclient/nep17.go 68.83% <66.66%> (ø)
pkg/smartcontract/entry.go 90.47% <90.47%> (ø)
pkg/neotest/basic.go 94.02% <100.00%> (-0.08%) ⬇️
pkg/rpcclient/helper.go 47.97% <100.00%> (-11.15%) ⬇️
pkg/smartcontract/builder.go 100.00% <100.00%> (ø)
pkg/network/message_string.go 70.96% <0.00%> (-6.46%) ⬇️
pkg/services/oracle/request.go 63.01% <0.00%> (+5.02%) ⬆️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

res, err := c.SignAndPushInvocationTx(w.Bytes(), acc, sysGas, gas, []rpcclient.SignerAccount{{
script, err := smartcontract.CreateCallWithAssertScript(neoContractHash, method, acc.PrivateKey().PublicKey().Bytes())
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

cli.NewExitError?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I've noticed this also, but for some reason thought that it's an internal function the result of which is wrapped outside if needed. But that's not the case, so NewExitError is appropriate here. Fixed.

It wasn't possible way back when this test was written
(CreateOracleResponseScript was a method), now we can simplify things.
@roman-khimov roman-khimov merged commit 1ff588a into master Jul 26, 2022
@roman-khimov roman-khimov deleted the sc-code-emit branch July 26, 2022 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rpc RPC server and client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants