Skip to content
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/powpeg validation protocol phase3 #2811

Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
918bd81
Move searchForOutput method to BitcoinUtils to reuse it
julia-zack Sep 25, 2024
f1c26ea
Create and process svp spend transaction
julia-zack Sep 25, 2024
fee3e2c
Add tests to spend transaction process. Refactor some methods to avoi…
julia-zack Sep 26, 2024
4138bb4
Create new method in BitcoinUtils to remove duplicated code from Brid…
julia-zack Sep 26, 2024
fc98d8f
Add hsm-needed pegout logging for svp spend tx. Remove duplicated code
julia-zack Sep 26, 2024
eae4bd5
Add assertions to new logged events. Reorder methods to be more organ…
julia-zack Sep 26, 2024
f2319da
Refactor method to avoid throwing exception unnecessary. Rename metho…
julia-zack Sep 26, 2024
ec26c03
Rename method that calculates amount to be sent in svp spend tx. Repl…
julia-zack Sep 26, 2024
676c0d1
Add missing empty p2sh input script to svp spend transaction
julia-zack Sep 30, 2024
f90ddbe
Add tests to check if svp spend tx inputs have expected script sig
julia-zack Oct 1, 2024
fca2457
Refactor BridgeEventLoggerImpl
julia-zack Sep 27, 2024
47fe37e
Refactor BridgeEventLoggerImpl to not receive SignatureCache object
marcos-iov Sep 27, 2024
791922e
Remove unnecessary (since we are unit-testing) arguments from asserti…
julia-zack Sep 27, 2024
7ffc8af
feat(federation): add getProposedFederationAddress method to Federati…
apancorb Oct 2, 2024
aa059f4
feat(federation): add getProposedFederationSize to Federation Support
apancorb Oct 2, 2024
40adac7
Create new commitFederationFailed Bridge event
julia-zack Sep 27, 2024
5cc253f
Add test for logCommitFederationFailure from deprecated logger
julia-zack Oct 1, 2024
10314cd
Move rsk block creation method to RskTestUtils
julia-zack Oct 3, 2024
88914b8
Remove unnecessary suffix from variable name
julia-zack Oct 3, 2024
b9a9190
Create default implementation of createRskBlock util method
marcos-iov Oct 3, 2024
9dbbcd8
feat(federation): add getProposedFederationCreationTime in Federation…
apancorb Oct 2, 2024
89526e1
feat(federation): add getProposedFederationCreationBlockNumber method…
apancorb Oct 2, 2024
bf875b5
feat(peg): add getProposedFederationAddress Bridge method
apancorb Oct 3, 2024
c053e26
feat(peg): Update Bridge
apancorb Oct 4, 2024
2d046b8
feat(federation): add getProposedFederatorPublicKeyOfType method in F…
apancorb Oct 2, 2024
4736674
refactor(federation): tidy up federation builder
apancorb Oct 3, 2024
70d3285
feat(federation): add more unit tests per key type when empty federation
apancorb Oct 4, 2024
09d0cfa
feat(federation): add javadoc for getProposedFederationCreationTime i…
apancorb Oct 7, 2024
3d81fa3
feat(peg): add getProposedFederationCreationTime Bridge method
apancorb Oct 7, 2024
03f37ba
feat(federation): add javadoc for getProposedFederationCreationBlockN…
apancorb Oct 7, 2024
a1594d8
feat(peg): add getProposedFederationCreationBlockNumber Bridge Method
apancorb Oct 7, 2024
424ae5b
feat(federation): add javadoc for getProposedFederationSize in Federa…
apancorb Oct 7, 2024
da0bc60
feat(peg): add getProposedFederationSize Bridge Method
apancorb Oct 7, 2024
a3a2e08
Rename method that calculates amount to be sent in svp spend tx. Repl…
julia-zack Sep 26, 2024
3ecbb9b
feat(federation): add getProposedFederatorPublicKeyOfType method in F…
apancorb Oct 2, 2024
6969b2e
feat(peg): add getProposedFederatorPublicKeyOfType Bridge method
apancorb Oct 8, 2024
5dd1709
Remove duplicated method declaration in FederationSupport
marcos-iov Oct 8, 2024
281433c
feat(peg): update test name in BridgeSupportTest
apancorb Oct 9, 2024
5448b80
Refactor addSignature as previous step to create addSvpSpendTxSignatu…
julia-zack Oct 3, 2024
2dfa9f4
Use getScriptSigWithSignature instead of updateScriptWithSignature
julia-zack Oct 8, 2024
76e9668
Rename boolean method. Replace rskTxHashSerialized argument for the k…
julia-zack Oct 9, 2024
d56d179
Use already existing method to extract redeem script. Remove unnecess…
julia-zack Oct 11, 2024
d2ddef4
Throw exception when trying to serialize a null value. Move tests to …
julia-zack Oct 14, 2024
f749efe
Create addSvpSpendTxSignature method. Add tests. Rename method to mak…
julia-zack Oct 14, 2024
f0929e8
Update release tests
marcos-iov Oct 24, 2024
ad37c1e
Add util method createRepository
marcos-iov Oct 24, 2024
baa8b28
Fix wrong casting to log. Change proposed fed creation time to second…
julia-zack Nov 5, 2024
d9a3005
Add intermediate method to improve svpIsOngoing readability
julia-zack Nov 6, 2024
f0dd65c
Get rid of magic number being used for spend tx sent amount
julia-zack Nov 8, 2024
c235fe0
Merge pull request #2841 from rsksmart/fix/wrong_casting_to_long
marcos-iov Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(federation): tidy up federation builder
apancorb authored and marcos-iov committed Oct 24, 2024
commit 4736674c6b158b462a4e6a83df9ae28deb20a6cc
Original file line number Diff line number Diff line change
@@ -5,11 +5,9 @@
import co.rsk.peg.bitcoin.BitcoinTestUtils;
import co.rsk.peg.federation.constants.FederationMainNetConstants;
import org.ethereum.crypto.ECKey;

import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class P2shErpFederationBuilder {
@@ -96,18 +94,21 @@ public ErpFederation build() {

private List<FederationMember> getFederationMembers() {
if (membersRskPublicKeys.isEmpty()) {
membersRskPublicKeys = membersBtcPublicKeys.stream()
.map(btcKey -> ECKey.fromPublicOnly(btcKey.getPubKey()))
.collect(Collectors.toList());
this.membersRskPublicKeys = membersBtcPublicKeys.stream()
.map(BtcECKey::getPubKey)
.map(ECKey::fromPublicOnly)
.toList();
}

if (membersMstPublicKeys.isEmpty()) {
membersMstPublicKeys = new ArrayList<>(membersRskPublicKeys);
this.membersMstPublicKeys = new ArrayList<>(membersRskPublicKeys);
}

return IntStream.range(0, membersBtcPublicKeys.size()).mapToObj(i -> new FederationMember(
membersBtcPublicKeys.get(i),
membersRskPublicKeys.get(i),
membersMstPublicKeys.get(i)
)).collect(Collectors.toList());
return IntStream.range(0, membersBtcPublicKeys.size())
.mapToObj(i -> new FederationMember(
membersBtcPublicKeys.get(i),
membersRskPublicKeys.get(i),
membersMstPublicKeys.get(i)))
.toList();
}
}