From 37dd9086ec491900311fc39837f4a62ef5fd3a4a Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 2 Mar 2017 14:03:33 +0100 Subject: core: refactor genesis handling This commit solves several issues concerning the genesis block: * Genesis/ChainConfig loading was handled by cmd/geth code. This left library users in the cold. They could specify a JSON-encoded string and overwrite the config, but didn't get any of the additional checks performed by geth. * Decoding and writing of genesis JSON was conflated in WriteGenesisBlock. This made it a lot harder to embed the genesis block into the forthcoming config file loader. This commit changes things so there is a single Genesis type that represents genesis blocks. All uses of Write*Genesis* are changed to use the new type instead. * If the chain config supplied by the user was incompatible with the current chain (i.e. the chain had already advanced beyond a scheduled fork), it got overwritten. This is not an issue in practice because previous forks have always had the highest total difficulty. It might matter in the future though. The new code reverts the local chain to the point of the fork when upgrading configuration. The change to genesis block data removes compression library dependencies from package core. --- contracts/chequebook/cheque_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'contracts/chequebook') diff --git a/contracts/chequebook/cheque_test.go b/contracts/chequebook/cheque_test.go index 4029fd549..d5b343024 100644 --- a/contracts/chequebook/cheque_test.go +++ b/contracts/chequebook/cheque_test.go @@ -42,11 +42,11 @@ var ( ) func newTestBackend() *backends.SimulatedBackend { - return backends.NewSimulatedBackend( - core.GenesisAccount{Address: addr0, Balance: big.NewInt(1000000000)}, - core.GenesisAccount{Address: addr1, Balance: big.NewInt(1000000000)}, - core.GenesisAccount{Address: addr2, Balance: big.NewInt(1000000000)}, - ) + return backends.NewSimulatedBackend(core.GenesisAlloc{ + addr0: {Balance: big.NewInt(1000000000)}, + addr1: {Balance: big.NewInt(1000000000)}, + addr2: {Balance: big.NewInt(1000000000)}, + }) } func deploy(prvKey *ecdsa.PrivateKey, amount *big.Int, backend *backends.SimulatedBackend) (common.Address, error) { -- cgit 2'>dependabot/npm_and_yarn/devel/electron4/files/lodash.merge-4.6.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/x11-wm/pager
Commit message (Expand)AuthorAgeFilesLines
* - Convert USE_BZIP2/XZ to USESmiwi2014-06-02