Skip to content

Commit

Permalink
Reorder imports. Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-zack committed Nov 22, 2024
1 parent d55617b commit 1d0aabe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
10 changes: 4 additions & 6 deletions rskj-core/src/main/java/co/rsk/peg/BridgeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package co.rsk.peg;

import static org.ethereum.config.blockchain.upgrades.ConsensusRule.*;

import co.rsk.bitcoinj.core.*;
import co.rsk.bitcoinj.crypto.TransactionSignature;
import co.rsk.bitcoinj.script.*;
Expand Down Expand Up @@ -53,8 +55,6 @@
import java.util.List;
import java.util.stream.Collectors;

import static org.ethereum.config.blockchain.upgrades.ConsensusRule.*;

/**
* @author Oscar Guindzberg
*/
Expand Down Expand Up @@ -621,17 +621,15 @@ public static int calculatePegoutTxSize(ActivationConfig.ForBlock activations, F
}

public static Script getFederationMembersP2SHScript(ActivationConfig.ForBlock activations, Federation federation) {
// when the federation is a standard multisig,
// the members p2sh script is the p2sh script
// when the federation is a standard multisig, the members p2sh script is the p2sh script
if (!activations.isActive(RSKIP377)) {
return federation.getP2SHScript();
}
if (!(federation instanceof ErpFederation)) {
return federation.getP2SHScript();
}

// when the federation also has erp keys,
// the members p2sh script is the default p2sh script
// when the federation also has erp keys, the members p2sh script is the default p2sh script
return ((ErpFederation) federation).getDefaultP2SHScript();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ private FederationChangeResponseCode legacyCommitPendingFederation(PendingFedera

public void commitProposedFederation() {
Federation proposedFederation = provider.getProposedFederation(constants, activations)
.orElseThrow(IllegalStateException::new);
.orElseThrow(IllegalStateException::new);

handoverToNewFederation(proposedFederation);
clearProposedFederation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.io.IOException;
import java.util.*;
import java.util.stream.IntStream;

import co.rsk.test.builders.FederationSupportBuilder;
import org.ethereum.config.blockchain.upgrades.ActivationConfig;
import org.ethereum.config.blockchain.upgrades.ActivationConfigsForTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package co.rsk.peg.federation;

import static co.rsk.peg.BridgeUtils.getFederationMembersP2SHScript;
import static co.rsk.peg.bitcoin.BitcoinTestUtils.flatKeysAsByteArray;
import static co.rsk.peg.federation.FederationStorageIndexKey.NEW_FEDERATION_BTC_UTXOS_KEY;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;

import co.rsk.bitcoinj.core.BtcECKey;
import co.rsk.bitcoinj.core.UTXO;
import co.rsk.bitcoinj.script.Script;
Expand Down Expand Up @@ -29,18 +35,11 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import java.math.BigInteger;
import java.time.Instant;
import java.util.*;
import java.util.stream.Stream;

import static co.rsk.peg.BridgeUtils.getFederationMembersP2SHScript;
import static co.rsk.peg.bitcoin.BitcoinTestUtils.flatKeysAsByteArray;
import static co.rsk.peg.federation.FederationStorageIndexKey.NEW_FEDERATION_BTC_UTXOS_KEY;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;

class VoteFederationChangeTest {
private static final FederationConstants federationMainnetConstants = FederationMainNetConstants.getInstance();
private static final BtcECKey federatorBtcKey = BtcECKey.fromPrivate(BigInteger.valueOf(100));
Expand Down

0 comments on commit 1d0aabe

Please sign in to comment.