-
Notifications
You must be signed in to change notification settings - Fork 279
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
[feature] #2073: Prefer ConstString over String #2505
[feature] #2073: Prefer ConstString over String #2505
Conversation
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #2505 +/- ##
==============================================
- Coverage 67.61% 67.28% -0.33%
==============================================
Files 140 140
Lines 26173 26428 +255
==============================================
+ Hits 17696 17783 +87
- Misses 8477 8645 +168
Help us with your feedback. Take ten seconds to tell us how you rate us. |
we don't need |
OK, I'll remove it in tests and errors where possible, but somewhere it's updated because of dependencies.
This part of the task is not very clear to me. For example, we initialize an error with string, this string is stored in memory and it's never modified afterwards. Actually, there's a very rare case when we need to modify |
b9b3c8c
to
26c8971
Compare
what you say is true but the benefit is marginal. We need |
26c8971
to
ff74a44
Compare
I got it. Thanks! |
708e548
to
131ffce
Compare
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 good
I see you dropped implementation on Peer::address
. I support this revert.
Cargo.toml
Outdated
"data_model", | ||
"data_model/primitives", | ||
"data_primitives", |
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 consider naming it primitives
. Let's see what the other reviewer would have to say
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 rename it into primitives
as well. Just kept existing name. Should I rename it?
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.
Will revert PeerId::address
, ok
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.
Will revert
PeerId::address
, ok
I don't think there is anything to change now. All is good
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.
What about renaming data_primitives
into primitives
?
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.
What about renaming data_primitives into primitives?
Now I see data_model/primitives
was already a separate crate. I think you could have referenced it directly from iroha_crypto
without moving it outside of data_model
?
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.
Well, anyway it had a strange design. It was re-exported from data_model
, but still used somewhere directly. I don't recall why I didn't (or couldn't) use it directly, but then I already knew that it's a separate crate. Anyway, it's better to make it shared only or private only to omit confusions and inconsistency.
UPD
I've just checked it on iroha2-dev
branch and actually yes, I could use it directly. Well, maybe because it was a deep night or something alike, I don't know how I skipped it 😅
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.
then just rename to primitives
and all is good
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.
also don't mind renaming it to just primitives
Cargo.toml
Outdated
"data_model", | ||
"data_model/primitives", | ||
"data_primitives", |
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.
also don't mind renaming it to just primitives
2769069
to
5b9788e
Compare
fb892eb
to
546de44
Compare
546de44
to
b3775aa
Compare
…data_model Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
…nto shared crate Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
…rimitives Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
b3775aa
to
892eb81
Compare
Description of the Change
Replaces
String
withConstString
for types stored in the blockchain. It also encapsulatesiroha_data_primitives
into a shared crate.Issue
Closes #2073
Benefits
Possible Drawbacks
Usage Examples or Tests [optional]
Alternate Designs [optional]