Use Genesis directly

This commit is contained in:
romanman 2014-06-18 10:18:30 +01:00
parent 3ebeac67ef
commit 18fee1eff8
4 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package org.ethereum.net.message;
import org.ethereum.core.Genesis;
import org.ethereum.crypto.HashUtil;
import org.spongycastle.util.encoders.Hex;
@ -16,7 +17,8 @@ public class StaticMessages {
public static final byte[] GET_TRANSACTIONS = Hex.decode("2240089100000002C116");
public static final byte[] DISCONNECT_08 = Hex.decode("2240089100000003C20108");
public static final byte[] GENESIS_HASH = Hex.decode("56fff6ab5ef6f1ef8dafb7b4571b89a9ae1ab870e54197c59ea10ba6f2c7eb60");
public static final byte[] GENESIS_HASH = Genesis.getInstance().getHash();
public static final byte[] MAGIC_PACKET = Hex.decode("22400891");
static {

View File

@ -11,10 +11,11 @@ import org.junit.Test;
import static org.junit.Assert.*;
public class BlockTest {
// https://ethereum.etherpad.mozilla.org/12
private String CPP_PoC5_GENESIS_HEX_RLP_ENCODED = "f8abf8a7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a011cc4aaa3b2f97cd6c858fcc0903b9b34b071e1798c91645f0e05e267028cb4a80834000008080830f4240808080a004994f67dc55b09e814ab7ffc8df3686b4afb2bb53e60eae97ef043fe03fb829c0c0";
private String CPP_PoC5_GENESIS_HEX_HASH = Hex.toHexString(StaticMessages.GENESIS_HASH);
private String CPP_PoC5_GENESIS_HEX_HASH = "56fff6ab5ef6f1ef8dafb7b4571b89a9ae1ab870e54197c59ea10ba6f2c7eb60";
String block_1 = "f9072df8d3a077ef4fdaf389dca53236bcf7f72698e154eab2828f86fbc4fc6c"
+ "d9225d285c89a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0"

View File

@ -14,6 +14,6 @@ code:
contract.storage[999] = a - 1
// call to myself:
send((tx.gas / 10 * 8), contract.address, 0)
send((tx.gas/10 * 8), contract.address, 0)
else:
stop

View File

@ -1,7 +1,7 @@
// the sample is good example how one can
// save program that manage his own currency
// the sample is good example how one can
// save program that manage his own currency
init: