-
Notifications
You must be signed in to change notification settings - Fork 152
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
Fix an issue where currency does not work correctly in dotnet6 #3880
Conversation
2aa539e
to
ea9808e
Compare
private static IValue SerializeForHash( | ||
IImmutableSet<Address>? minters, | ||
string ticker, | ||
byte decimalPlaces, | ||
(BigInteger Major, BigInteger Minor)? maximumSupply, | ||
bool totalSupplyTrackable) |
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.
Is it necessary?
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 think it's not, That code has been moved into GetHash
.
amended 997922b
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.
Wasn't there a reason why GetHash()
and SerializeForHash()
were separate in the first place? 🤔
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.
Ah, nevermind, it was about SerializeForHash()
and Serialize()
. 🙄
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 might be good to have a simple comment on whether we have a separate serialization scheme. 😐
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 might be good to have a simple comment on whether we have a separate serialization scheme. 😐
3808b22#diff-7975b57b58acd250c0c5fb4f0001c98e298746481661b38ccb8e64c429dda7b5R731
How about this?
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.
The comment doesn't clarify as to why the Dictionary
construction is different from Serialize()
, which I think would be the main point of confusion for those seeing the code without context. I'd say the history regarding GetHash()
is barely relevant and doesn't need mentioning.
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.
The comment doesn't clarify as to why the
Dictionary
construction is different fromSerialize()
, which I think would be the main point of confusion for those seeing the code without context. I'd say the history regardingGetHash()
is barely relevant and doesn't need mentioning.
9a8fd89#diff-7975b57b58acd250c0c5fb4f0001c98e298746481661b38ccb8e64c429dda7b5R731
amended
6b9b285
to
5298df7
Compare
5298df7
to
b9064f8
Compare
b9064f8
to
a9f0615
Compare
In dotnet6, the following error occurs when building.
CS0188, CS8885: The this object cannot be used before all of its fields are assigned to
I tried to change the
Hash
field ofCurrency
to a property, but it was not the correct way to modify it.According to the error message, I just need to avoid calling this method, so I changed the method to static and used it.
The code is less readable, but I was able to solve the problem for now.