Search in sources :

Example 1 with BridgeState

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

the class EthModule method bridgeState.

public Map<String, Object> bridgeState() throws IOException, BlockStoreException {
    Block block = blockchain.getBestBlock();
    Repository repository = blockchain.getRepository().getSnapshotTo(block.getStateRoot()).startTracking();
    BridgeSupport bridgeSupport = new BridgeSupport(config, repository, null, PrecompiledContracts.BRIDGE_ADDR, block);
    byte[] result = bridgeSupport.getStateForDebugging();
    BridgeState state = BridgeState.create(config.getBlockchainConfig().getCommonConstants().getBridgeConstants(), result);
    return state.stateToMap();
}
Also used : Repository(org.ethereum.core.Repository) Block(org.ethereum.core.Block) BridgeState(co.rsk.peg.BridgeState) BridgeSupport(co.rsk.peg.BridgeSupport)

Aggregations

BridgeState (co.rsk.peg.BridgeState)1 BridgeSupport (co.rsk.peg.BridgeSupport)1 Block (org.ethereum.core.Block)1 Repository (org.ethereum.core.Repository)1