-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Optimization
]: make some unit tests more readable
#3716
Conversation
UInt256 val256 = UInt256.Zero; | ||
TestUtils.SetupBlockWithValues(null, uut, val256, out var merkRootVal, out _, out var timestampVal, out var nonceVal, out var indexVal, out var scriptVal, out _, 0); | ||
|
||
var uut = TestUtils.MakeBlock(null, UInt256.Zero, 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.
What happen to this unit test? Same for the others.
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 happen to this unit test? Same for the others.
Too many unused out
variables.
It isn't clear.
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.
Ill have to download to it and look at 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.
Ill have to download to it and look at it.
SetupHeaderWithValues
sets these out
variables and header fields to same values.
So these Assert.AreEqual
are meaningless.
InvocationScript = Array.Empty<byte>(), | ||
VerificationScript = Array.Empty<byte>() |
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.
InvocationScript = Array.Empty<byte>(), | |
VerificationScript = Array.Empty<byte>() | |
InvocationScript = [], | |
VerificationScript = [], |
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.
InvocationScript
public ReadOnlyMemory<byte> InvocationScript;
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.
ReadOnlyMemory<byte>.Empty
or Memory<byte>.Empty
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.
Replace the Replace
by Concat
?
83f7862
to
ab4d7f7
Compare
Done |
Description
Make
TestUtils.SetupHeaderWithValues
andTestUtils.SetupBlockWithValues
simpler and clearerType of change
Checklist: