Commit Graph

15 Commits

Author SHA1 Message Date
Felix Lange 37dd9086ec 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.
2017-03-23 15:58:43 +01:00
bas-vk 6d038e762b accounts/abi/bind: allow client to specify sender address for call (#3782) 2017-03-16 12:24:22 +01:00
Péter Szilágyi 682875adff accounts/abi/bind, internal/ethapi: binary search gas estimation (#3587)
Gas estimation currently mostly works, but can underestimate for more funky
refunds. This is because various ops (e.g. CALL) need more gas to run than they
actually consume (e.g. 2300 stipend that is refunded if not used). With more
intricate contract interplays, it becomes almost impossible to return a proper
value to the user.

This commit swaps out the simplistic gas estimation to a binary search approach,
honing in on the correct gas use. This does mean that gas estimation needs to
rerun the transaction log(max-price) times to measure whether it fails or not,
but it's a price paid by the transaction issuer, and it should be worth it to
support proper estimates.
2017-01-20 23:39:16 +01:00
Péter Szilágyi 178da7c6a9
mobile: initial wrappers for mobile support 2016-11-14 17:56:58 +02:00
Felix Lange 056f15aa53 accounts/abi/bind/backends: remove nil and remote backends
The remote backend is superseded by ethclient.

The nil backend's stated purpose was to enable testing of
accounts/abi/bind. None of its methods actually worked. A much simpler
way to get a crashing backend is to simply pass nil as the backend. With
a one-line change to the generator (removing two explicit interface
assertions), passing nil actually works.

Removing these backends means that less changes are required later.
2016-08-21 17:06:25 +02:00
Péter Szilágyi cc21706c50 accounts/abi/bind: fix multi-value anonymous unmarshalling 2016-05-12 16:28:18 +03:00
Péter Szilágyi cdcbb2f160 accounts/abi/bind, eth: add contract non-existent error 2016-04-27 17:15:23 +03:00
Felix Lange 85e6c40c00 accounts, crypto: move keystore to package accounts
The account management API was originally implemented as a thin layer
around crypto.KeyStore, on the grounds that several kinds of key stores
would be implemented later on. It turns out that this won't happen so
KeyStore is a superflous abstraction.

In this commit crypto.KeyStore and everything related to it moves to
package accounts and is unexported.
2016-04-12 15:56:49 +02:00
Péter Szilágyi fc4fffd5ac accounts/abi/bind: support generating bindings for various arrays 2016-04-05 18:20:50 +03:00
Péter Szilágyi 4097478884 accounts/abi/bind: surface raw wrappers to access low level ops 2016-04-01 13:07:05 +03:00
Péter Szilágyi c2bbff6116 accounts/abi/bind: merge all tests into a single suite 2016-03-31 12:45:50 +03:00
Péter Szilágyi 9b4a45f6e8 accounts/abi/bind: fix double pointer in generated code 2016-03-25 15:09:06 +02:00
Péter Szilágyi 73308dbe0e accounts/abi/bind, cmd/abigen: port to templates, bind to solidity 2016-03-24 17:09:45 +02:00
Péter Szilágyi 86cfc22c79 accounts/abi/bind: constructor, auth utils and various backends 2016-03-24 14:15:32 +02:00
Péter Szilágyi 72826bb5ad accounts/abi/bind, cmd/abigen: Go API generator around an EVM ABI 2016-03-24 14:15:18 +02:00