-
Notifications
You must be signed in to change notification settings - Fork 78
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
state: drop NativeContract, fix #3430 #3439
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3439 +/- ##
==========================================
+ Coverage 86.14% 86.15% +0.01%
==========================================
Files 331 331
Lines 38432 38441 +9
==========================================
+ Hits 33106 33120 +14
+ Misses 3800 3797 -3
+ Partials 1526 1524 -2 ☔ View full report in Codecov by Sentry. |
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.
To be honest, I'm against of ContractBase removal. NativeContract can be removed, but not the ContractBase. ContractBase is a separate type which should not include update counter. It's used by HFSpecificContractMD which should not be aware of the contract's update counter, and update counter is a kind of Management-specific and dao-specific thing that I'd like to keep inside Management.
But the only reason we have it that there was this separation of native/non-native contract state. e1d2a5b. |
But right now it's not the only reason, because ContractBase is used by HFSpecificContractMD, and this entity is update-counter-agnostic. |
I still think we have a lot to improve in HF handling. But OK, I'll simplify this to fix |
I'm not completely against of ContractBase removal, but this code just doesn't work correctly. |
This unifies getnativecontracts RPC API with regular contracts. Signed-off-by: Roman Khimov <roman@nspcc.ru>
9ae5456
to
b1bb12d
Compare
This is somewhat deeper than its C# counterpart, but the essence is the same, we return proper []state.Contract from getnativecontracts RPC and thus many of older types are no longer needed. Some hacks around UpdateCounter are removed as well.
The change can potentially affect third-party apps, but should be easy to adopt.
UPD: simplified.