New Repositroy management:

+ VMComplex test 4 fixed
This commit is contained in:
romanman 2014-06-25 00:27:39 +01:00
parent 415f87c727
commit 59ff195854
3 changed files with 8 additions and 9 deletions

View File

@ -238,7 +238,7 @@ public class Repository {
state.setCodeHash(codeHash);
if (logger.isInfoEnabled())
logger.info("Program code saved: account: [ {} ] codeHash: [ {} ] \n code: [ {} ]",
logger.info("Program code saved:\n account: [ {} ]\n codeHash: [ {} ] \n code: [ {} ]",
Hex.toHexString(address),
Hex.toHexString(codeHash),
Hex.toHexString(code));

View File

@ -244,6 +244,7 @@ public class Program {
// 2.2 CREATE THE CONTRACT ADDRESS
byte[] nonce = trackRepository.getNonce(senderAddress).toByteArray();
byte[] newAddress = HashUtil.calcNewAddr(this.getOwnerAddress().getNoLeadZeroesData(), nonce);
trackRepository.createAccount(newAddress);
// 2.3 UPDATE THE NONCE
// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)
@ -251,7 +252,7 @@ public class Program {
// 3. COOK THE INVOKE AND EXECUTE
ProgramInvoke programInvoke =
ProgramInvokeFactory.createProgramInvoke(this, DataWord.ZERO, DataWord.ZERO,
ProgramInvokeFactory.createProgramInvoke(this, new DataWord(newAddress), DataWord.ZERO,
gas, BigInteger.ZERO, null, trackRepository);
VM vm = new VM();

View File

@ -355,11 +355,9 @@ public class VMComplexTest {
program.setRuntimeFailure(e);
}
System.out.println();
System.out.println("============ Results ============");
System.out.println("*** Used gas: " + program.result.getGasUsed());
// todo: check that the value pushed after exec is the new address
repository.close();