Search in sources :

Example 1 with BridgeSupport

use of co.rsk.peg.BridgeSupport in project rskj by rsksmart.

the class RemascProcessMinerFeesTest method validateFederatorsBalanceIsCorrect.

private void validateFederatorsBalanceIsCorrect(Repository repository, long federationReward) throws IOException, BlockStoreException {
    BridgeSupport bridgeSupport = new BridgeSupport(config, repository, null, PrecompiledContracts.BRIDGE_ADDR, null);
    RemascFederationProvider provider = new RemascFederationProvider(bridgeSupport);
    int nfederators = provider.getFederationSize();
    Coin federatorBalance = Coin.valueOf(federationReward / nfederators);
    for (int k = 0; k < nfederators; k++) {
        assertEquals(federatorBalance, repository.getBalance(provider.getFederatorAddress(k)));
    }
}
Also used : Coin(co.rsk.core.Coin) BridgeSupport(co.rsk.peg.BridgeSupport)

Example 2 with BridgeSupport

use of co.rsk.peg.BridgeSupport in project rskj by rsksmart.

the class EthModule method bridgeState.

public Map<String, Object> bridgeState() throws IOException, BlockStoreException {
    Block bestBlock = blockchain.getBestBlock();
    Repository track = repositoryLocator.startTrackingAt(bestBlock.getHeader());
    BridgeSupport bridgeSupport = bridgeSupportFactory.newInstance(track, bestBlock, PrecompiledContracts.BRIDGE_ADDR, null);
    byte[] result = bridgeSupport.getStateForDebugging();
    BridgeState state = BridgeState.create(bridgeConstants, result, null);
    return state.stateToMap();
}
Also used : MutableRepository(org.ethereum.db.MutableRepository) BridgeState(co.rsk.peg.BridgeState) BridgeSupport(co.rsk.peg.BridgeSupport)

Aggregations

BridgeSupport (co.rsk.peg.BridgeSupport)2 Coin (co.rsk.core.Coin)1 BridgeState (co.rsk.peg.BridgeState)1 MutableRepository (org.ethereum.db.MutableRepository)1