diff --git a/rskj-core/src/main/java/co/rsk/peg/BridgeStorageProvider.java b/rskj-core/src/main/java/co/rsk/peg/BridgeStorageProvider.java index 256059905fa..cf60e67005c 100644 --- a/rskj-core/src/main/java/co/rsk/peg/BridgeStorageProvider.java +++ b/rskj-core/src/main/java/co/rsk/peg/BridgeStorageProvider.java @@ -956,7 +956,7 @@ public void setPegoutTxSigHash(Sha256Hash sigHash) { pegoutTxSigHashes.add(sigHash); } - private void savePegoutTxSigHashes() { + protected void savePegoutTxSigHashes() { if (!activations.isActive(RSKIP379) || pegoutTxSigHashes == null) { return; } diff --git a/rskj-core/src/test/java/co/rsk/peg/BridgeStorageProviderPegoutTxIndexTests.java b/rskj-core/src/test/java/co/rsk/peg/BridgeStorageProviderPegoutTxIndexTests.java index 35ae28447b7..668bc9427d5 100644 --- a/rskj-core/src/test/java/co/rsk/peg/BridgeStorageProviderPegoutTxIndexTests.java +++ b/rskj-core/src/test/java/co/rsk/peg/BridgeStorageProviderPegoutTxIndexTests.java @@ -287,8 +287,8 @@ void hasPegoutTxSigHash_passing_existing_sigHash() throws IOException { void setPegoutTxSigHash_null(boolean isRskip379HardForkActive) throws IOException { // Arrange ActivationConfig.ForBlock activations = isRskip379HardForkActive ? - getArrowHeadActivationExceptLockingCap() : - getFingerrootActivationsExceptLockingCap(); + ActivationConfigsForTest.arrowhead600().forBlock(0) : + ActivationConfigsForTest.fingerroot500().forBlock(0); Repository repository = mock(Repository.class); @@ -301,7 +301,7 @@ void setPegoutTxSigHash_null(boolean isRskip379HardForkActive) throws IOExceptio // Act provider.setPegoutTxSigHash(null); - provider.save(); + provider.savePegoutTxSigHashes(); // Assert verify(repository, never()).getStorageBytes( @@ -321,8 +321,8 @@ void setPegoutTxSigHash_null(boolean isRskip379HardForkActive) throws IOExceptio void setPegoutTxSigHash_non_null(boolean isRskip379HardForkActive, Sha256Hash sigHash) throws IOException { // Arrange ActivationConfig.ForBlock activations = isRskip379HardForkActive ? - getArrowHeadActivationExceptLockingCap() : - getFingerrootActivationsExceptLockingCap(); + ActivationConfigsForTest.arrowhead600().forBlock(0) : + ActivationConfigsForTest.fingerroot500().forBlock(0); Repository repository = mock(Repository.class); BridgeStorageProvider provider = new BridgeStorageProvider( @@ -334,7 +334,7 @@ void setPegoutTxSigHash_non_null(boolean isRskip379HardForkActive, Sha256Hash si // Act provider.setPegoutTxSigHash(sigHash); - provider.save(); + provider.savePegoutTxSigHashes(); // Assert if (isRskip379HardForkActive) { @@ -362,14 +362,6 @@ void setPegoutTxSigHash_non_null(boolean isRskip379HardForkActive, Sha256Hash si } } - private ActivationConfig.ForBlock getFingerrootActivationsExceptLockingCap() { - return ActivationConfigsForTest.fingerroot500(Collections.singletonList(RSKIP134)).forBlock(0); - } - - private ActivationConfig.ForBlock getArrowHeadActivationExceptLockingCap() { - return ActivationConfigsForTest.arrowhead600(Collections.singletonList(RSKIP134)).forBlock(0); - } - @Test void setPegoutTxSigHash_passing_existing() throws IOException { // Arrange