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)));
}
}
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();
}
Aggregations