Search in sources :

Example 56 with PeginInstructionsProvider

use of co.rsk.peg.pegininstructions.PeginInstructionsProvider in project rskj by rsksmart.

the class BridgeSupportFactory method newInstance.

public BridgeSupport newInstance(Repository repository, Block executionBlock, RskAddress contractAddress, List<LogInfo> logs) {
    ActivationConfig.ForBlock activations = activationConfig.forBlock(executionBlock.getNumber());
    Context btcContext = new Context(bridgeConstants.getBtcParams());
    BridgeStorageProvider provider = new BridgeStorageProvider(repository, contractAddress, bridgeConstants, activations);
    FederationSupport federationSupport = new FederationSupport(bridgeConstants, provider, executionBlock);
    BridgeEventLogger eventLogger;
    if (logs == null) {
        eventLogger = null;
    } else {
        eventLogger = new BridgeEventLoggerImpl(bridgeConstants, activations, logs);
    }
    BtcLockSenderProvider btcLockSenderProvider = new BtcLockSenderProvider();
    PeginInstructionsProvider peginInstructionsProvider = new PeginInstructionsProvider();
    return new BridgeSupport(bridgeConstants, provider, eventLogger, btcLockSenderProvider, peginInstructionsProvider, repository, executionBlock, btcContext, federationSupport, btcBlockStoreFactory, activations);
}
Also used : Context(co.rsk.bitcoinj.core.Context) BridgeEventLoggerImpl(co.rsk.peg.utils.BridgeEventLoggerImpl) BtcLockSenderProvider(co.rsk.peg.btcLockSender.BtcLockSenderProvider) PeginInstructionsProvider(co.rsk.peg.pegininstructions.PeginInstructionsProvider) ActivationConfig(org.ethereum.config.blockchain.upgrades.ActivationConfig) BridgeEventLogger(co.rsk.peg.utils.BridgeEventLogger)

Example 57 with PeginInstructionsProvider

use of co.rsk.peg.pegininstructions.PeginInstructionsProvider in project rskj by rsksmart.

the class BridgeSupportRSKIP220NewMethodsTest method getBridgeSupport.

private BridgeSupport getBridgeSupport(BridgeConstants constants, BtcBlockStoreWithCache.Factory blockStoreFactory, ActivationConfig.ForBlock activations) {
    BridgeStorageProvider provider = mock(BridgeStorageProvider.class);
    Repository track = mock(Repository.class);
    BridgeEventLogger eventLogger = mock(BridgeEventLogger.class);
    BtcLockSenderProvider btcLockSenderProvider = mock(BtcLockSenderProvider.class);
    Block executionBlock = mock(Block.class);
    return new BridgeSupport(constants, provider, eventLogger, btcLockSenderProvider, new PeginInstructionsProvider(), track, executionBlock, new Context(constants.getBtcParams()), new FederationSupport(constants, provider, executionBlock), blockStoreFactory, activations);
}
Also used : BtcLockSenderProvider(co.rsk.peg.btcLockSender.BtcLockSenderProvider) Repository(org.ethereum.core.Repository) PeginInstructionsProvider(co.rsk.peg.pegininstructions.PeginInstructionsProvider) Block(org.ethereum.core.Block) BridgeEventLogger(co.rsk.peg.utils.BridgeEventLogger)

Aggregations

PeginInstructionsProvider (co.rsk.peg.pegininstructions.PeginInstructionsProvider)57 Test (org.junit.Test)51 BtcLockSenderProvider (co.rsk.peg.btcLockSender.BtcLockSenderProvider)50 ActivationConfig (org.ethereum.config.blockchain.upgrades.ActivationConfig)49 RskAddress (co.rsk.core.RskAddress)44 Repository (org.ethereum.core.Repository)43 ActivationConfigsForTest (org.ethereum.config.blockchain.upgrades.ActivationConfigsForTest)42 MutableRepository (org.ethereum.db.MutableRepository)42 Block (org.ethereum.core.Block)40 InternalTransaction (org.ethereum.vm.program.InternalTransaction)37 co.rsk.bitcoinj.core (co.rsk.bitcoinj.core)31 SimpleRskTransaction (co.rsk.peg.simples.SimpleRskTransaction)31 Transaction (org.ethereum.core.Transaction)31 ECKey (org.ethereum.crypto.ECKey)27 PegTestUtils.createBaseInputScriptThatSpendsFromTheFederation (co.rsk.peg.PegTestUtils.createBaseInputScriptThatSpendsFromTheFederation)25 PegTestUtils.createBaseRedeemScriptThatSpendsFromTheFederation (co.rsk.peg.PegTestUtils.createBaseRedeemScriptThatSpendsFromTheFederation)25 Script (co.rsk.bitcoinj.script.Script)16 LockWhitelist (co.rsk.peg.whitelist.LockWhitelist)16 BigInteger (java.math.BigInteger)14 OneOffWhiteListEntry (co.rsk.peg.whitelist.OneOffWhiteListEntry)10