Search in sources :

Example 26 with FastBridgeFederationInformation

use of co.rsk.peg.fastbridge.FastBridgeFederationInformation in project rskj by rsksmart.

the class BridgeSupport method createFastBridgeFederationInformation.

protected FastBridgeFederationInformation createFastBridgeFederationInformation(Keccak256 fastBridgeDerivationHash) {
    Script fastBridgeScript = FastBridgeRedeemScriptParser.createMultiSigFastBridgeRedeemScript(getActiveFederation().getRedeemScript(), Sha256Hash.wrap(fastBridgeDerivationHash.getBytes()));
    Script fastBridgeScriptHash = ScriptBuilder.createP2SHOutputScript(fastBridgeScript);
    return new FastBridgeFederationInformation(fastBridgeDerivationHash, getActiveFederation().getP2SHScript().getPubKeyHash(), fastBridgeScriptHash.getPubKeyHash());
}
Also used : Script(co.rsk.bitcoinj.script.Script) FastBridgeFederationInformation(co.rsk.peg.fastbridge.FastBridgeFederationInformation)

Aggregations

FastBridgeFederationInformation (co.rsk.peg.fastbridge.FastBridgeFederationInformation)26 Test (org.junit.Test)22 Keccak256 (co.rsk.crypto.Keccak256)13 ActivationConfigsForTest (org.ethereum.config.blockchain.upgrades.ActivationConfigsForTest)11 Repository (org.ethereum.core.Repository)11 MutableRepository (org.ethereum.db.MutableRepository)11 ActivationConfig (org.ethereum.config.blockchain.upgrades.ActivationConfig)10 Script (co.rsk.bitcoinj.script.Script)9 ForBlock (org.ethereum.config.blockchain.upgrades.ActivationConfig.ForBlock)8 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)8 Context (co.rsk.bitcoinj.core.Context)7 RedeemData (co.rsk.bitcoinj.wallet.RedeemData)4 PegTestUtils.createBaseInputScriptThatSpendsFromTheFederation (co.rsk.peg.PegTestUtils.createBaseInputScriptThatSpendsFromTheFederation)2 PegTestUtils.createBaseRedeemScriptThatSpendsFromTheFederation (co.rsk.peg.PegTestUtils.createBaseRedeemScriptThatSpendsFromTheFederation)2 BtcLockSenderProvider (co.rsk.peg.btcLockSender.BtcLockSenderProvider)2 PeginInstructionsProvider (co.rsk.peg.pegininstructions.PeginInstructionsProvider)2 Block (org.ethereum.core.Block)2 Address (co.rsk.bitcoinj.core.Address)1 BtcTransaction (co.rsk.bitcoinj.core.BtcTransaction)1 Coin (co.rsk.bitcoinj.core.Coin)1