-
Notifications
You must be signed in to change notification settings - Fork 31
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
ref: Privatize and Rename State Fields #500
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for contracts-stylus canceled.
|
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.
Looks much better!
} | ||
|
||
/// Maximum size of consecutive token's batch. | ||
/// This is designed to limit stress on off-chain indexing services that | ||
/// have to record one entry per token, and have protections against | ||
/// "unreasonably large" batches of tokens. | ||
fn _max_batch_size(&self) -> U96 { | ||
self._max_batch_size.get() | ||
pub fn _max_batch_size(&self) -> U96 { |
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.
Why pub
for private function?
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.
One reason is that after the change the compiler started complaining that this function and the field with the same name were unused.
Another reason is that I looked at the Solidity version, and the only truly private
function is _nextConsecutiveId - all of the other functions are internal
, e.g. see _maxBatchSize
If we are to keep compatibility with Solidity, fn _first_consecutive_id
should be marked as pub
too (see _firstConsecutiveId)
Resolves #447, resolves #386
PR Checklist