use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method getEmptyStorageBytes.
@Test
public void getEmptyStorageBytes() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
byte[] bytes = repository.getStorageBytes(accAddress, DataWord.ONE);
Assert.assertNull(bytes);
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method flushNoReconnect.
@Test
public void flushNoReconnect() {
TrieStore store = new TrieStoreImpl(new HashMapDB());
RepositoryImpl repository = new RepositoryImpl(config, store);
RskAddress accAddress = randomAccountAddress();
byte[] initialRoot = repository.getRoot();
repository.createAccount(accAddress);
repository.flushNoReconnect();
Assert.assertTrue(repository.isExist(accAddress));
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method isExistReturnsTrueForCreatedAccount.
@Test
public void isExistReturnsTrueForCreatedAccount() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
repository.createAccount(accAddress);
Assert.assertTrue(repository.isExist(accAddress));
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method createAccountInTrackAndRollback.
@Test
public void createAccountInTrackAndRollback() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
Repository track = repository.startTracking();
Assert.assertNotNull(track);
track.createAccount(accAddress);
track.rollback();
Assert.assertFalse(repository.isExist(accAddress));
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method incrementAccountNonceTwiceForAlreadyCreatedAccount.
@Test
public void incrementAccountNonceTwiceForAlreadyCreatedAccount() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
repository.createAccount(accAddress);
repository.increaseNonce(accAddress);
repository.increaseNonce(accAddress);
Assert.assertEquals(2, repository.getNonce(accAddress).longValue());
}
Aggregations