From 21f7774b123d87588535e6baf13479868c9f821b Mon Sep 17 00:00:00 2001 From: Julian Len Date: Thu, 12 Dec 2024 10:48:21 -0300 Subject: [PATCH] fix: changed activationConfig to activation --- .../java/co/rsk/peg/RegisterBtcTransactionIT.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java b/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java index c137ee4050..0f2453770d 100644 --- a/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java +++ b/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java @@ -25,7 +25,6 @@ import org.ethereum.core.*; import org.ethereum.vm.PrecompiledContracts; import org.junit.jupiter.api.Test; -import java.io.IOException; import java.math.BigInteger; import java.util.*; @@ -39,7 +38,7 @@ public class RegisterBtcTransactionIT { @Test void whenRegisterALegacyBtcTransaction_shouldRegisterTheNewUtxoAndTransferTheRbtcBalance() throws Exception { // Arrange - ActivationConfig.ForBlock activationConfig = ActivationConfigsForTest.all().forBlock(0); + ActivationConfig.ForBlock activations = ActivationConfigsForTest.all().forBlock(0); Repository repository = BridgeSupportTestUtil.createRepository(); Repository track = repository.startTracking(); Block rskExecutionBlock = getRskExecutionBlock(); @@ -49,7 +48,7 @@ void whenRegisterALegacyBtcTransaction_shouldRegisterTheNewUtxoAndTransferTheRbt Federation federation = P2shErpFederationBuilder.builder().build(); FederationStorageProvider federationStorageProvider = getFederationStorageProvider(track, federation); - FederationSupport federationSupport = getFederationSupport(federationStorageProvider, activationConfig, bridgeConstants.getFederationConstants()); + FederationSupport federationSupport = getFederationSupport(federationStorageProvider, activations, bridgeConstants.getFederationConstants()); BtcECKey btcPublicKey = new BtcECKey(); Coin btcTransferred = Coin.COIN; @@ -58,9 +57,9 @@ void whenRegisterALegacyBtcTransaction_shouldRegisterTheNewUtxoAndTransferTheRbt UTXO utxo = getUtxo(bitcoinTransaction, output); List expectedFederationUtxos = Collections.singletonList(utxo); - BridgeStorageProvider bridgeStorageProvider = new BridgeStorageProvider(track, PrecompiledContracts.BRIDGE_ADDR, bridgeConstants.getBtcParams(), activationConfig); + BridgeStorageProvider bridgeStorageProvider = new BridgeStorageProvider(track, PrecompiledContracts.BRIDGE_ADDR, bridgeConstants.getBtcParams(), activations); BtcBlockStoreWithCache.Factory btcBlockStoreFactory = new RepositoryBtcBlockStoreWithCache.Factory(bridgeConstants.getBtcParams(), 100, 100); - BtcBlockStoreWithCache btcBlockStoreWithCache = btcBlockStoreFactory.newInstance(track, bridgeConstants, bridgeStorageProvider, activationConfig); + BtcBlockStoreWithCache btcBlockStoreWithCache = btcBlockStoreFactory.newInstance(track, bridgeConstants, bridgeStorageProvider, activations); PartialMerkleTree pmtWithTransactions = createValidPmtForTransactions(Collections.singletonList(bitcoinTransaction.getHash()), bridgeConstants.getBtcParams()); int btcBlockWithPmtHeight = bridgeConstants.getBtcHeightWhenPegoutTxIndexActivates() + bridgeConstants.getPegoutTxIndexGracePeriodInBtcBlocks(); @@ -70,7 +69,7 @@ void whenRegisterALegacyBtcTransaction_shouldRegisterTheNewUtxoAndTransferTheRbt bridgeStorageProvider.save(); - BridgeSupport bridgeSupport = getBridgeSupport(bridgeStorageProvider, activationConfig, federationSupport, feePerKbSupport, rskExecutionBlock, btcBlockStoreFactory, track, btcLockSenderProvider); + BridgeSupport bridgeSupport = getBridgeSupport(bridgeStorageProvider, activations, federationSupport, feePerKbSupport, rskExecutionBlock, btcBlockStoreFactory, track, btcLockSenderProvider); Transaction rskTx = TransactionUtils.createTransaction(); org.ethereum.crypto.ECKey key = org.ethereum.crypto.ECKey.fromPublicOnly(btcPublicKey.getPubKey()); @@ -107,11 +106,11 @@ private static UTXO getUtxo(BtcTransaction bitcoinTransaction, TransactionOutput ); } - private static FederationSupport getFederationSupport(FederationStorageProvider federationStorageProvider, ActivationConfig.ForBlock activationsBeforeForks, FederationConstants federationConstants) { + private static FederationSupport getFederationSupport(FederationStorageProvider federationStorageProvider, ActivationConfig.ForBlock activationConfig, FederationConstants federationConstants) { return FederationSupportBuilder.builder() .withFederationConstants(federationConstants) .withFederationStorageProvider(federationStorageProvider) - .withActivations(activationsBeforeForks) + .withActivations(activationConfig) .build(); }