From 762b49d0d850728db83fb7502d00f2ba62ffb762 Mon Sep 17 00:00:00 2001 From: nathanieliov Date: Fri, 13 Oct 2023 00:06:37 -0400 Subject: [PATCH] Rename getTransactionType to getTransactionTypeUsingPegoutIndex --- .../src/main/java/co/rsk/peg/PegUtils.java | 2 +- .../main/java/co/rsk/peg/PegUtilsLegacy.java | 12 +++--- .../test/java/co/rsk/peg/PegUtilsTest.java | 40 +++++++++---------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/rskj-core/src/main/java/co/rsk/peg/PegUtils.java b/rskj-core/src/main/java/co/rsk/peg/PegUtils.java index 105660e4819..53152f8efb8 100644 --- a/rskj-core/src/main/java/co/rsk/peg/PegUtils.java +++ b/rskj-core/src/main/java/co/rsk/peg/PegUtils.java @@ -15,7 +15,7 @@ public class PegUtils { private PegUtils() { } - public static PegTxType getTransactionType( + public static PegTxType getTransactionTypeUsingPegoutIndex( ActivationConfig.ForBlock activations, BridgeStorageProvider provider, Wallet liveFederationsWallet, diff --git a/rskj-core/src/main/java/co/rsk/peg/PegUtilsLegacy.java b/rskj-core/src/main/java/co/rsk/peg/PegUtilsLegacy.java index 08c53907a09..fd9796983cb 100644 --- a/rskj-core/src/main/java/co/rsk/peg/PegUtilsLegacy.java +++ b/rskj-core/src/main/java/co/rsk/peg/PegUtilsLegacy.java @@ -43,7 +43,7 @@ private PegUtilsLegacy() {} /** * Legacy version for identifying if a tx is a pegout - * Use instead {@link co.rsk.peg.PegUtils#getTransactionType} + * Use instead {@link co.rsk.peg.PegUtils#getTransactionTypeUsingPegoutIndex} * * @param tx * @param federations @@ -57,7 +57,7 @@ public static boolean isPegOutTx(BtcTransaction tx, List federations /** * Legacy version for identifying if a tx is a pegout - * Use instead {@link co.rsk.peg.PegUtils#getTransactionType} + * Use instead {@link co.rsk.peg.PegUtils#getTransactionTypeUsingPegoutIndex} * * @param btcTx * @param activations @@ -119,7 +119,7 @@ protected static boolean scriptCorrectlySpendsTx(BtcTransaction tx, int index, S /** * Legacy version for identifying if a tx is a pegout - * Use instead {@link co.rsk.peg.PegUtils#getTransactionType} + * Use instead {@link co.rsk.peg.PegUtils#getTransactionTypeUsingPegoutIndex} * * @param btcTx * @param oldFederationAddress @@ -139,7 +139,7 @@ protected static boolean txIsFromOldFederation(BtcTransaction btcTx, Address old } /** - * Legacy version to identify if a btc tx is a pegin. Use instead {@link co.rsk.peg.PegUtils#getTransactionType} + * Legacy version to identify if a btc tx is a pegin. Use instead {@link co.rsk.peg.PegUtils#getTransactionTypeUsingPegoutIndex} * * @param tx the BTC transaction to check * @param federation @@ -167,7 +167,7 @@ public static boolean isValidPegInTx( } /** - * Legacy version to identify if a btc tx is a pegin. Use instead {@link co.rsk.peg.PegUtils#getTransactionType} + * Legacy version to identify if a btc tx is a pegin. Use instead {@link co.rsk.peg.PegUtils#getTransactionTypeUsingPegoutIndex} * * @param tx the BTC transaction to check * @param activeFederations the active federations @@ -285,7 +285,7 @@ protected static boolean isMigrationTx( /** * Legacy version for identifying transaction peg type - * Use instead {@link co.rsk.peg.PegUtils#getTransactionType} + * Use instead {@link co.rsk.peg.PegUtils#getTransactionTypeUsingPegoutIndex} * * @param btcTx * @param activeFederation diff --git a/rskj-core/src/test/java/co/rsk/peg/PegUtilsTest.java b/rskj-core/src/test/java/co/rsk/peg/PegUtilsTest.java index 0a89797b563..23fdc3cbfd4 100644 --- a/rskj-core/src/test/java/co/rsk/peg/PegUtilsTest.java +++ b/rskj-core/src/test/java/co/rsk/peg/PegUtilsTest.java @@ -80,7 +80,7 @@ void test_getTransactionType_before_tbd_600() { // Act IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, () -> { - PegUtils.getTransactionType(fingerrootActivations, provider, liveFederationWallet, btcTransaction); + PegUtils.getTransactionTypeUsingPegoutIndex(fingerrootActivations, provider, liveFederationWallet, btcTransaction); }); // Assert @@ -98,7 +98,7 @@ void test_getTransactionType_tx_sending_funds_to_unknown_address() { btcTransaction.addOutput(Coin.COIN, userAddress); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -121,7 +121,7 @@ void test_getTransactionType_pegin_below_minimum_active_fed() { btcTransaction.addOutput(minimumPeginTxValue.minus(Coin.SATOSHI), activeFederation.getAddress()); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -142,7 +142,7 @@ void test_getTransactionType_pegin_active_fed() { btcTransaction.addOutput(Coin.COIN, activeFederation.getAddress()); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -166,7 +166,7 @@ void test_getTransactionType_pegin_output_to_active_fed_and_other_addresses() { btcTransaction.addOutput(Coin.COIN, BitcoinTestUtils.createP2PKHAddress(btcMainnetParams, "unknown2")); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -190,7 +190,7 @@ void test_getTransactionType_pegin_multiple_outputs_to_active_fed() { } // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -227,7 +227,7 @@ void test_getTransactionType_pegin_output_to_retiring_fed_and_other_addresses() btcTransaction.addOutput(Coin.COIN, BitcoinTestUtils.createP2PKHAddress(btcMainnetParams, "unknown2")); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -248,7 +248,7 @@ void test_getTransactionType_pegin_retiring_fed() { btcTransaction.addOutput(Coin.COIN, retiringFederation.getAddress()); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -272,7 +272,7 @@ void test_getTransactionType_pegin_multiple_outputs_to_retiring_fed() { } // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -295,7 +295,7 @@ void test_getTransactionType_pegin_outputs_to_active_and_retiring_fed() { btcTransaction.addOutput(Coin.COIN, retiringFederation.getAddress()); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -320,7 +320,7 @@ void test_getTransactionType_pegin_outputs_to_active_and_retiring_fed_and_other_ btcTransaction.addOutput(Coin.COIN, userAddress); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -355,7 +355,7 @@ void test_getTransactionType_pegout_no_change_output() { when(provider.hasPegoutTxSigHash(firstInputSigHash)).thenReturn(true); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -381,7 +381,7 @@ void test_getTransactionType_pegout_no_change_output_sighash_no_exists_in_provid btcTransaction.getInput(FIRST_INPUT_INDEX).setScriptSig(inputScript); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -417,7 +417,7 @@ void test_getTransactionType_standard_pegout() { when(provider.hasPegoutTxSigHash(firstInputSigHash)).thenReturn(true); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -444,7 +444,7 @@ void test_getTransactionType_standard_pegout_sighash_no_exists_in_provider() { btcTransaction.getInput(FIRST_INPUT_INDEX).setScriptSig(inputScript); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -481,7 +481,7 @@ void test_getTransactionType_migration() { when(provider.hasPegoutTxSigHash(firstInputSigHash)).thenReturn(true); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -510,7 +510,7 @@ void test_getTransactionType_migration_sighash_no_exists_in_provider() { btcTransaction.getInput(FIRST_INPUT_INDEX).setScriptSig(inputScript); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -545,7 +545,7 @@ void test_getTransactionType_migration_from_retired_fed() { when(provider.hasPegoutTxSigHash(firstInputSigHash)).thenReturn(true); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -589,7 +589,7 @@ void test_getTransactionType_flyover() { ); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet, @@ -627,7 +627,7 @@ void test_getTransactionType_flyover_segwit() { BtcTransaction btcTransaction = new BtcTransaction(btcTestNetParams, Hex.decode(segwitTxHex)); // Act - PegTxType pegTxType = PegUtils.getTransactionType( + PegTxType pegTxType = PegUtils.getTransactionTypeUsingPegoutIndex( activations, provider, liveFederationWallet,