use of co.rsk.blockchain.utils.BlockGenerator in project rskj by rsksmart.
the class BlockTest method sealedBlockSetExtraData.
@Test
public void sealedBlockSetExtraData() {
Block block = new BlockGenerator().createBlock(10, 0);
block.seal();
try {
block.setExtraData(new byte[32]);
Assert.fail();
} catch (SealedBlockException ex) {
Assert.assertEquals("Sealed block: trying to alter extra data", ex.getMessage());
}
}
use of co.rsk.blockchain.utils.BlockGenerator in project rskj by rsksmart.
the class BlockTest method sealedBlockHeaderSetTransactionsRoot.
@Test
public void sealedBlockHeaderSetTransactionsRoot() {
Block block = new BlockGenerator().createBlock(10, 0);
block.seal();
try {
block.getHeader().setTransactionsRoot(new byte[32]);
Assert.fail();
} catch (SealedBlockHeaderException ex) {
Assert.assertEquals("Sealed block header: trying to alter transactions root", ex.getMessage());
}
}
use of co.rsk.blockchain.utils.BlockGenerator in project rskj by rsksmart.
the class BlockTest method sealedBlockHeaderSetLogsBloom.
@Test
public void sealedBlockHeaderSetLogsBloom() {
Block block = new BlockGenerator().createBlock(10, 0);
block.seal();
try {
block.getHeader().setLogsBloom(new byte[32]);
Assert.fail();
} catch (SealedBlockHeaderException ex) {
Assert.assertEquals("Sealed block header: trying to alter logs bloom", ex.getMessage());
}
}
use of co.rsk.blockchain.utils.BlockGenerator in project rskj by rsksmart.
the class BlockTest method sealedBlockHeaderSetStateRoot.
@Test
public void sealedBlockHeaderSetStateRoot() {
Block block = new BlockGenerator().createBlock(10, 0);
block.seal();
try {
block.getHeader().setStateRoot(new byte[32]);
Assert.fail();
} catch (SealedBlockHeaderException ex) {
Assert.assertEquals("Sealed block header: trying to alter state root", ex.getMessage());
}
}
use of co.rsk.blockchain.utils.BlockGenerator in project rskj by rsksmart.
the class BlockTest method sealedBlockHeaderSetBitcoinMergedMiningCoinbaseTransaction.
@Test
public void sealedBlockHeaderSetBitcoinMergedMiningCoinbaseTransaction() {
Block block = new BlockGenerator().createBlock(10, 0);
block.seal();
try {
block.getHeader().setBitcoinMergedMiningCoinbaseTransaction(new byte[32]);
Assert.fail();
} catch (SealedBlockHeaderException ex) {
Assert.assertEquals("Sealed block header: trying to alter bitcoin merged mining coinbase transaction", ex.getMessage());
}
}
Aggregations