From 133b20a12afc2fa6664c6f3687ab9a1486833ff0 Mon Sep 17 00:00:00 2001 From: julia-zack Date: Fri, 10 Jan 2025 16:43:20 -0300 Subject: [PATCH] Add witness related constants that were removed --- src/test/java/co/rsk/federate/BtcToRskClientTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/co/rsk/federate/BtcToRskClientTest.java b/src/test/java/co/rsk/federate/BtcToRskClientTest.java index 560754087..c735db2e3 100644 --- a/src/test/java/co/rsk/federate/BtcToRskClientTest.java +++ b/src/test/java/co/rsk/federate/BtcToRskClientTest.java @@ -51,6 +51,8 @@ * Created by ajlopez on 6/1/2016. */ class BtcToRskClientTest { + private static final Sha256Hash WITNESS_RESERVED_VALUE = Sha256Hash.ZERO_HASH; + private static final int WITNESS_COMMITMENT_LENGTH = 36; // 4 bytes for header, 32 for hash private int nhash = 0; private ActivationConfig activationConfig; private BridgeConstants bridgeRegTestConstants; @@ -2774,7 +2776,7 @@ private Transaction getCoinbaseTransactionWithWrongWitnessCommitment() { coinbaseTx.verify(); TransactionWitness txWitness = new TransactionWitness(1); - txWitness.setPush(0, BitcoinUtils.WITNESS_RESERVED_VALUE.getBytes()); + txWitness.setPush(0, WITNESS_RESERVED_VALUE.getBytes()); coinbaseTx.getInput(0).setWitness(txWitness); Sha256Hash witnessCommitment = Sha256Hash.wrap("0011223344556677889900112233445566778899001122334455667788990011"); @@ -2782,7 +2784,7 @@ private Transaction getCoinbaseTransactionWithWrongWitnessCommitment() { byte[] wrongWitnessCommitmentWithHeader = ByteUtil.merge( new byte[]{ScriptOpCodes.OP_RETURN}, new byte[]{ScriptOpCodes.OP_PUSHDATA1}, - new byte[]{BitcoinUtils.WITNESS_COMMITMENT_LENGTH}, + new byte[]{WITNESS_COMMITMENT_LENGTH}, Hex.decode(witnessCommitmentHeader), witnessCommitment.getBytes() );