-
Notifications
You must be signed in to change notification settings - Fork 266
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
Create StateForProposedFederator and Refactor StateForFederator #2738
Create StateForProposedFederator and Refactor StateForFederator #2738
Conversation
3a353a8
to
3057b17
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.
Nice refactor! Very well done
|
||
public class StateForProposedFederator { | ||
|
||
private final Map.Entry<Keccak256, BtcTransaction> rskTxWaitingForSignatures; |
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.
Since this will be for a very specific use case, what do you think about calling it svpSpendTxWaitingForSignatures
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.
Should we also change the other one to pegoutsWaitingForSignatures
? Or too specific?
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.
That one can be pegouts, migrations, fund tx. This one is very specific
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.
Updated
Keccak256 rskTxHash1 = createHash3(1); | ||
Keccak256 rskTxHash2 = createHash3(2); |
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.
Let's use the new method that's in RskTestUtils in favor of this one that is deprecated.
No need to change it everywhere, but at least in the new places and lines we refactor
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.
Updated
|
||
package co.rsk.peg; | ||
|
||
import static co.rsk.peg.PegTestUtils.createHash3; |
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.
same here
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.
Updated
private static final NetworkParameters NETWORK_PARAMETERS = NetworkParameters.fromID(NetworkParameters.ID_MAINNET); | ||
|
||
@Test | ||
void stateForProposedFederator_whenSerializeAndDeserialize_shouldHaveEqualState() { |
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.
a test when there's no tx waiting for signatures?
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.
Updated
|
||
public StateForFederator(byte[] rlpData, NetworkParameters parameters) { |
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.
Careful careful, I believe this is used from the powpeg-node
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.
Okay it makes sense now, will update :) Thanks for the heads up
64d8dae
to
9aff079
Compare
9aff079
to
29b441d
Compare
…ator constructor checks
582f3fe
to
f32735e
Compare
Quality Gate passedIssues Measures |
@@ -1657,7 +1657,7 @@ private void processSigning( | |||
*/ | |||
public byte[] getStateForBtcReleaseClient() throws IOException { |
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.
Not related to this PR, but looks like we are going to need some tests for this method
24f3a93
into
feature/powpeg_validation_protocol-phase2
Description
New DTO class called
StateForProposedFederator
, which would act similar to existingStateForFederator
. It will receive thesvpSpendTxWaitingForSignatures
to notify the pegnatories.Also includes a refactor of
StateForFederator
.Motivation and Context
https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP419.md