-
Notifications
You must be signed in to change notification settings - Fork 79
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
vm: make slots public #3677
base: master
Are you sure you want to change the base?
vm: make slots public #3677
Conversation
this will fail signed off because it doesn't like my format, looking at how to fix the commit :| |
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.
It would be nice to add a link to the reason of this modification to the commit message (#3674 (comment)).
LGTM, but not merging without @roman-khimov's approval.
If you don't like the suggestion, then we can merge with this job failing, it's not critical. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3677 +/- ##
==========================================
+ Coverage 83.09% 83.11% +0.02%
==========================================
Files 334 334
Lines 46573 46612 +39
==========================================
+ Hits 38699 38742 +43
+ Misses 6306 6296 -10
- Partials 1568 1574 +6 ☔ View full report in Codecov by Sentry. |
Whoever is in the "Author" of commit ( |
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.
I'd suggest deprecating DumpXSlot at the same time, it was always questionable.
pkg/vm/slot.go
Outdated
@@ -19,7 +19,7 @@ func (s *slot) init(n int, rc *refCounter) { | |||
} | |||
|
|||
// Set sets i-th storage slot. | |||
func (s slot) Set(i int, item stackitem.Item, refs *refCounter) { | |||
func (s Slot) Set(i int, item stackitem.Item, refs *refCounter) { |
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.
Exported method accepts unexported structure.
Those are in use by the cli Lines 650 to 655 in cb51eeb
You want to remove these CLI commands? |
Of course not, they can grab slots from VM as is and represent them to user in any way they want including JSON. |
…Slot methods Signed-off-by: ixje <erik@coz.io>
@@ -278,22 +278,26 @@ func (c *Context) IsDeployed() bool { | |||
} | |||
|
|||
// DumpStaticSlot returns json formatted representation of the given slot. | |||
// Deprecated: to be removed in next version. |
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.
Here and below, please, add a note that (*Context).*Slot
method should be used to retrieve slot. Also please add an entry to ROADMAP.md (https://github.com/nspcc-dev/neo-go/blob/master/ROADMAP.md#deprecated-functionality) following the document style. Let's schedule deprecation of these methods to 0.108.0 release.
if s == nil { | ||
panic("not initialized") | ||
return 0 |
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.
I'm OK with this change. @roman-khimov do you think it's OK to return 0 for uninitialized slot?
I thought about returning an error, but it will complicate method's signature for nothing. And we don't use this method inside VM anyway, hence it does not affect the node state in any way.
as per #3674 (comment)