use of co.rsk.db.RepositoryImpl in project rskj by rsksmart.
the class RemascStorageProviderTest method getDefautRewardBalance.
@Test
public void getDefautRewardBalance() {
RskAddress accountAddress = randomAddress();
Repository repository = new RepositoryImpl(config);
RemascStorageProvider provider = new RemascStorageProvider(repository, accountAddress);
Assert.assertEquals(Coin.ZERO, provider.getRewardBalance());
}
use of co.rsk.db.RepositoryImpl in project rskj by rsksmart.
the class RemascStorageProviderTest method getDefaultSiblings.
@Test
public void getDefaultSiblings() {
RskAddress accountAddress = randomAddress();
Repository repository = new RepositoryImpl(config);
RemascStorageProvider provider = new RemascStorageProvider(repository, accountAddress);
SortedMap<Long, List<Sibling>> map = provider.getSiblings();
Assert.assertNotNull(map);
Assert.assertTrue(map.isEmpty());
}
use of co.rsk.db.RepositoryImpl in project rskj by rsksmart.
the class RemascStorageProviderTest method setAndGetRewardBalance.
@Test
public void setAndGetRewardBalance() {
RskAddress accountAddress = randomAddress();
Repository repository = new RepositoryImpl(config);
RemascStorageProvider provider = new RemascStorageProvider(repository, accountAddress);
provider.setRewardBalance(Coin.valueOf(1));
Assert.assertEquals(Coin.valueOf(1), provider.getRewardBalance());
}
use of co.rsk.db.RepositoryImpl in project rskj by rsksmart.
the class RemascStorageProviderTest method getDefautBurnedBalance.
@Test
public void getDefautBurnedBalance() {
RskAddress accountAddress = randomAddress();
Repository repository = new RepositoryImpl(config);
RemascStorageProvider provider = new RemascStorageProvider(repository, accountAddress);
Assert.assertEquals(Coin.ZERO, provider.getBurnedBalance());
}
use of co.rsk.db.RepositoryImpl in project rskj by rsksmart.
the class RemascStorageProviderTest method setAndGetSiblings.
@Test
public void setAndGetSiblings() {
RskAddress accountAddress = randomAddress();
Repository repository = new RepositoryImpl(config);
RemascStorageProvider provider = new RemascStorageProvider(repository, accountAddress);
BlockGenerator blockGenerator = new BlockGenerator();
Block genesis = blockGenerator.getGenesisBlock();
Block block = blockGenerator.createChildBlock(genesis);
Sibling sibling1 = new Sibling(genesis.getHeader(), genesis.getCoinbase(), 1);
Sibling sibling2 = new Sibling(block.getHeader(), block.getCoinbase(), 2);
List<Sibling> siblings = new ArrayList<>();
siblings.add(sibling1);
siblings.add(sibling2);
provider.getSiblings().put(Long.valueOf(1), siblings);
SortedMap<Long, List<Sibling>> map = provider.getSiblings();
Assert.assertNotNull(map);
Assert.assertFalse(map.isEmpty());
Assert.assertTrue(map.containsKey(Long.valueOf(1)));
Assert.assertEquals(2, map.get(Long.valueOf(1)).size());
}
Aggregations