use of org.ethereum.core.AccountState in project rskj by rsksmart.
the class RepositoryImpl method saveCode.
@Override
public synchronized void saveCode(RskAddress addr, byte[] code) {
AccountState accountState = getAccountState(addr);
ContractDetails details = getContractDetails(addr);
if (accountState == null) {
accountState = createAccount(addr);
details = getContractDetails(addr);
}
details.setCode(code);
accountState.setCodeHash(Keccak256Helper.keccak256(code));
updateContractDetails(addr, details);
updateAccountState(addr, accountState);
}
Aggregations