From e2d333d2095edb349388433c28f4d6a381b1df62 Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Fri, 3 Apr 2015 17:37:59 +0200 Subject: NatSpec contracts in genesis block, end to end test (unfinished) --- core/genesis.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index 8ef1e140f..14ac2ec0f 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -56,7 +56,15 @@ func GenesisBlock(db common.Database) *types.Block { return genesis } +const ( + TestAccount = "e273f01c99144c438695e10f24926dc1f9fbf62d" + TestBalance = "1000000000000000000" +) + var genesisData = []byte(`{ + "` + TestAccount + `": {"balance": "` + TestBalance + `"}, + "` + ContractAddrURLhint + `": {"balance": "` + TestBalance + `", "code": "` + ContractCodeURLhint + `" }, + "` + ContractAddrHashReg + `": {"balance": "` + TestBalance + `", "code": "` + ContractCodeHashReg + `" }, "0000000000000000000000000000000000000001": {"balance": "1"}, "0000000000000000000000000000000000000002": {"balance": "1"}, "0000000000000000000000000000000000000003": {"balance": "1"}, -- cgit From b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6 Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Tue, 7 Apr 2015 11:50:17 +0200 Subject: NatSpec passing end to end test --- core/genesis.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index 14ac2ec0f..c475ca637 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -58,13 +58,12 @@ func GenesisBlock(db common.Database) *types.Block { const ( TestAccount = "e273f01c99144c438695e10f24926dc1f9fbf62d" - TestBalance = "1000000000000000000" + TestBalance = "1000000000000" ) var genesisData = []byte(`{ "` + TestAccount + `": {"balance": "` + TestBalance + `"}, - "` + ContractAddrURLhint + `": {"balance": "` + TestBalance + `", "code": "` + ContractCodeURLhint + `" }, - "` + ContractAddrHashReg + `": {"balance": "` + TestBalance + `", "code": "` + ContractCodeHashReg + `" }, + ` + BuiltInContracts + ` "0000000000000000000000000000000000000001": {"balance": "1"}, "0000000000000000000000000000000000000002": {"balance": "1"}, "0000000000000000000000000000000000000003": {"balance": "1"}, -- cgit From dba2367157fc4ad7947ee1632dbe76d6a110f49f Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Tue, 14 Apr 2015 15:20:52 +0200 Subject: NatSpec contracts are now not in the genesis block but added by the test --- core/genesis.go | 1 - 1 file changed, 1 deletion(-) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index c475ca637..1159a5cec 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -63,7 +63,6 @@ const ( var genesisData = []byte(`{ "` + TestAccount + `": {"balance": "` + TestBalance + `"}, - ` + BuiltInContracts + ` "0000000000000000000000000000000000000001": {"balance": "1"}, "0000000000000000000000000000000000000002": {"balance": "1"}, "0000000000000000000000000000000000000003": {"balance": "1"}, -- cgit From d8fb834386caea0103fad8733f119b87238b75d3 Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Tue, 14 Apr 2015 16:01:25 +0200 Subject: test account is no longer permanently in genesis block, only put there when testing --- core/genesis.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index 1159a5cec..0ce60054e 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -36,7 +36,7 @@ func GenesisBlock(db common.Database) *types.Block { Balance string Code string } - err := json.Unmarshal(genesisData, &accounts) + err := json.Unmarshal(GenesisData, &accounts) if err != nil { fmt.Println("enable to decode genesis json data:", err) os.Exit(1) @@ -56,13 +56,7 @@ func GenesisBlock(db common.Database) *types.Block { return genesis } -const ( - TestAccount = "e273f01c99144c438695e10f24926dc1f9fbf62d" - TestBalance = "1000000000000" -) - -var genesisData = []byte(`{ - "` + TestAccount + `": {"balance": "` + TestBalance + `"}, +var GenesisData = []byte(`{ "0000000000000000000000000000000000000001": {"balance": "1"}, "0000000000000000000000000000000000000002": {"balance": "1"}, "0000000000000000000000000000000000000003": {"balance": "1"}, -- cgit