class AccountStateServiceImpl implements AccountStateService {

    @Override
    public synchronized AccountState getAccountState(AccountAddress address, Accounts accounts) {
        logger.traceEntry("params: {} {}", address, accounts);
        if (address == null) {
            logger.trace("address is null");
            return logger.traceExit((AccountState) null);
        }

        PersistenceUnit<AccountAddress, AccountState> unit = accounts.getAccountsPersistenceUnit();
        byte[] bytes = address.getBytes();
        byte[] data = unit.get(bytes);

        return logger.traceExit((data != null) ? convertToAccountStateFromRLP(data) : null);
    }

}