use of eu.cryptoeuro.accountmapper.error.CannotStoreAccountException in project account-identity by cryptofiat.
the class AccountManagementService method markActivated.
public void markActivated(EthereumAccount account, String txHash) {
try {
account.setActivated(true);
account.setTransactionHash(txHash);
ethereumAccountRepository.save(account);
} catch (Exception e) {
throw new CannotStoreAccountException("Crashed while activating new account", e.getCause());
}
}
use of eu.cryptoeuro.accountmapper.error.CannotStoreAccountException in project account-identity by cryptofiat.
the class AccountManagementService method storeNewAccount.
public EthereumAccount storeNewAccount(String address, String ownerId, AuthorisationType authorisationType) {
address = ethService.without0x(address);
try {
validateAccountStoring(address, ownerId);
EthereumAccount account = EthereumAccount.builder().ownerId(ownerId).address(address).activated(false).authorisationType(authorisationType).build();
ethereumAccountRepository.save(account);
return account;
} catch (CannotStoreAccountException e) {
throw e;
} catch (Exception e) {
throw new CannotStoreAccountException("Crashed while storing new account", e.getCause());
}
}
Aggregations