Extend `CalculateNetworkFee` with contract verification
Description
Close https://github.com/neo-project/neo/issues/2805
Type of change
- [ ] Optimization (the change is only an optimization)
- [ ] Style (the change is only a code style for better maintenance or standard purpose)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How Has This Been Tested?
- [ ] We don't have a unit test system that allow us to deploy a dummy contract for verify methods... I think that it should be tested locally
Test Configuration:
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
@neo-project/core anything else?
@shargon how about roman's comment: https://github.com/neo-project/neo/pull/3385#discussion_r1696377899
@shargon how about roman's comment: #3385 (comment)
Map was before, and was removed because a review https://github.com/neo-project/neo/pull/3385#discussion_r1665156066
merge?
is it possible to add some tests to demonstrate that your change achieves what you intended to? i will reapprove immediately if you can do it.
merge?
https://github.com/neo-project/neo/pull/3385#discussion_r1696381840
Non-standard verification scripts are still not supported.
merge?
Non-standard verification scripts are still not supported.
You mean without a contract?
Yes. Like in #3209.
Yes. Like in #3209.
It's done in neo-go? i can't find it
It's done in neo-go? i can't find it
Take a look at https://github.com/nspcc-dev/neo-go/blob/79e78980c4679e8929ceb509ed56359c5b017279/pkg/services/rpcsrv/server.go#L1001, we take signer's witness, infer invocation script (if needed) and don't change verification script. And hence, verification script is executed by s.chain.VerifyWitness "as is" without any changes even if it's not a contract/sig/multisig script.
It's done in neo-go? i can't find it
Take a look at https://github.com/nspcc-dev/neo-go/blob/79e78980c4679e8929ceb509ed56359c5b017279/pkg/services/rpcsrv/server.go#L1001, we take signer's witness, infer invocation script (if needed) and don't change verification script. And hence, verification script is executed by
s.chain.VerifyWitness"as is" without any changes even if it's not a contract/sig/multisig script.
Any following work?
We may merge #3385 as it is now and move non-standard verification scripts support to another issue. I think it's acceptable way since #3385 contains everything that's required except non-standard verification scripts handling.
https://github.com/neo-project/neo/pull/3434/files#r1725538241
Anyway you can do this https://github.com/neo-project/neo/issues/3481#issue-2511922347
@shargon you have conflict