use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method hibernateAccount.
@Test
public void hibernateAccount() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
repository.createAccount(accAddress);
repository.hibernate(accAddress);
AccountState accState = repository.getAccountState(accAddress);
Assert.assertNotNull(accState);
Assert.assertTrue(accState.isHibernated());
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method getAccountsKeys.
@Test
public void getAccountsKeys() {
RskAddress accAddress1 = randomAccountAddress();
RskAddress accAddress2 = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
repository.createAccount(accAddress1);
repository.createAccount(accAddress2);
Set<RskAddress> keys = repository.getAccountsKeys();
Assert.assertNotNull(keys);
Assert.assertFalse(keys.isEmpty());
Assert.assertEquals(2, keys.size());
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method getEmptyStorageValue.
@Test
public void getEmptyStorageValue() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
repository.createAccount(accAddress);
DataWord value = repository.getStorageValue(accAddress, DataWord.ONE);
Assert.assertNull(value);
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method incrementAccountBalanceForNewAccount.
@Test
public void incrementAccountBalanceForNewAccount() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
Assert.assertEquals(BigInteger.ONE, repository.addBalance(accAddress, Coin.valueOf(1L)).asBigInteger());
Assert.assertEquals(BigInteger.ONE, repository.getBalance(accAddress).asBigInteger());
}
use of co.rsk.core.RskAddress in project rskj by rsksmart.
the class RepositoryImplTest method getCodeFromAccountWithoutCode.
@Test
public void getCodeFromAccountWithoutCode() {
RskAddress accAddress = randomAccountAddress();
RepositoryImpl repository = new RepositoryImpl(config);
repository.createAccount(accAddress);
byte[] code = repository.getCode(accAddress);
Assert.assertNotNull(code);
Assert.assertEquals(0, code.length);
}
Aggregations