Commit Graph

124 Commits

Author SHA1 Message Date
Adrian Brink 782a836db0 Cleanup of code and code docs
This cleans up some of the code in the state package
2017-10-23 11:04:45 -04:00
Anton Kaliaev 716364182d
[state] expose ChainID and Params
```
jaekwon
Yeah we should definitely expose ChainID.
ConsensusParams is small enough, we can just write it.
```
https://github.com/tendermint/tendermint/pull/676#discussion_r144123203
2017-10-16 10:34:02 +04:00
Anton Kaliaev 1971e149fb
ChainID() and Params() do not return errors
- remove state#GenesisDoc() method
2017-10-16 10:34:02 +04:00
Emmanuel Odeke 7939d62ef0
all, state: unexpose GenesisDoc, ChainID fields make them accessor methods
Fixes #671

Unexpose GenesisDoc and ChainID fields to avoid them being
serialized to the DB on every block write/state.Save()

A GenesisDoc can now be alternatively written to the state's
database, by serializing its JSON as a value of key "genesis-doc".

There are now accessors and a setter for these attributes:
- state.GenesisDoc() (*types.GenesisDoc, error)
- state.ChainID() (string, error)
- state.SetGenesisDoc(*types.GenesisDoc)

This is a breaking change since it changes how the state's
serialization and requires that if loading the GenesisDoc entirely
from the database, you'll need to set its value in the database
as the GenesisDoc's JSON marshaled bytes.
2017-10-16 10:34:01 +04:00
Zach Ramsay d56b44f3a5 all: no more anonymous imports 2017-10-04 16:40:45 -04:00
Ethan Buchman 779c2a22d0 node: NewNode takes DBProvider and GenDocProvider 2017-09-21 15:54:33 -04:00
Adrian Brink 870a98ccc3
Last fixes 2017-09-12 17:12:19 +02:00
Adrian Brink 8eda3efa28
Cleanup lines to fit within 72 characters 2017-09-12 17:08:30 +02:00
Adrian Brink 2a6e71a753
Reformat tests to extract common setup 2017-09-12 16:57:10 +02:00
Ethan Buchman fae0603413 more fixes from review 2017-09-06 01:25:57 -04:00
Ethan Buchman 9deb647303 fixes from review 2017-09-04 18:29:51 -04:00
Ethan Buchman 78446fd99c state: persist validators 2017-09-03 16:07:37 -04:00
Anton Kaliaev f803544195
new logging 2017-05-13 10:24:58 +02:00
Ethan Buchman 46151720f8 fix tests 2017-05-04 22:46:41 -04:00
Ethan Buchman 4982cb4d1f fix tests for state and mempool 2017-05-04 22:43:55 -04:00
Ethan Buchman d1926bcad1 use tmlibs 2017-04-21 18:12:54 -04:00
Ethan Buchman 5109746b1c Handshake uses ApplyBlock, no ConsensuState 2017-04-18 21:28:10 -04:00
Ethan Buchman 4360c360a4 move handshake to state, use Handshaker, more tests 2016-11-16 13:29:22 -05:00
Jae Kwon e12f9d10e7 Bare consensus refactor 2015-11-01 11:34:08 -08:00
Ethan Buchman e4f0e2b399 update namereg with longer names, more allowed chars 2015-09-15 19:43:22 -04:00
Ethan Buchman 586498331b fix suicide 2015-08-26 18:02:13 -04:00
Jae Kwon 5bf0040f14 Parts -> PartsHeader; *_parts -> *_parts_header in sign_bytes 2015-08-12 22:36:43 -07:00
Jae Kwon b96fd8a031 Beginning of complete merkle proofs 2015-08-11 14:12:30 -07:00
Jae Kwon 9965dd5de6 uint* to int* whereever appropriate; https://www.reddit.com/r/golang/comments/2q5vdu/int_vs_uint/ 2015-06-25 20:28:34 -07:00
Jae Kwon 9e1794eaea Fixed tests 2015-06-24 14:04:40 -07:00
Jae Kwon 01b5540ffe consensus/state is 2-step asynchronous 2015-06-19 15:30:21 -07:00
Ethan Buchman 6eb8386c7c fixes for chain id in nametx sign functions 2015-05-30 01:54:25 -04:00
Ethan Buchman 37a8a6cd65 remove name fix 2015-05-30 01:20:42 -04:00
Ethan Buchman 77ff09e173 namereg cleanup, tests 2015-05-30 01:20:42 -04:00
Ethan Buchman cff6bcfb31 copy entry on get, use strings for name/data, uint64 for expires 2015-05-30 01:19:03 -04:00
Ethan Buchman 8631d5085e name reg 2015-05-30 01:19:02 -04:00
Ethan Buchman 2045aee9cd pass chainID through sign interfaces 2015-05-29 18:14:19 -04:00
Ethan Buchman 8a2d9525f0 network > chain_id, put in genesis.json 2015-05-29 18:14:19 -04:00
Ethan Buchman d43c776e84 add bonder's signature to BondTx 2015-05-20 19:36:55 -04:00
Jae Kwon 489bf767cb importing tendermint/config/tendermint_test applies the test config 2015-05-17 16:19:58 -07:00
Jae Kwon 75ef479547 Config is passed into each module. Remove tendermint/confer 2015-05-17 16:19:57 -07:00
Jae Kwon 85c8850ac2 Config names have no dots, are under_scored. 2015-05-12 17:40:29 -07:00
Ethan Buchman 65f669160f more fixes from review 2015-04-17 13:18:50 -07:00
Ethan Buchman 34098edb93 state: fireEvents flag on ExecTx and fixes for GetAccount 2015-04-14 19:26:55 -07:00
Jae Kwon 13b6508ecd Package import path change 2015-04-01 17:30:16 -07:00
Ethan Buchman 60f166e823 tendermint2 2015-03-31 15:33:31 -07:00
Jae Kwon 79304b0dd3 Create BlockCache and TxCache for performance. 2015-03-28 23:44:07 -07:00
Jae Kwon 08a83aa9fb Reactors can be stopped or started at any time. 2015-03-25 00:15:18 -07:00
Jae Kwon 0237d284cc Channel bytes are spelled fully, "XXXChannel" 2015-03-24 12:00:27 -07:00
Jae Kwon 87e1f76324 tendermint/block -> tendermint/types and tendermint/blockchain 2015-03-22 19:00:08 -07:00
Ethan Buchman 9c4692c071 remove gas price and dont run txs before they come in a block 2015-03-18 23:27:27 -07:00
Ethan Buchman f384d10a05 block/state: gas price for block and tx 2015-03-18 23:27:27 -07:00
Matthew Wampler-Doty f03547007a App -> App() 2015-03-18 23:27:26 -07:00
Jae Kwon 249ae38068 test bondTx 2015-01-17 01:56:55 -08:00
Jae Kwon 135894ea88 Dot import -> named import
Changed modulename_ to short module names
Also removed Unreader, replaced with PrefixdReader in select locations
2015-01-14 20:34:53 -08:00
Jae Kwon 7afb75049f API to list accounts 2015-01-11 14:27:46 -08:00
Jae Kwon fe566739fd rpc/account; fixed mempool tx filter bug; fixed iavl_tree persistence
bug
2015-01-10 05:41:50 -08:00
Jae Kwon 05c642a84c Changed config to confer, TOML format. 2015-01-08 16:40:23 -08:00
Jae Kwon 1d5a6065c5 Fix state_test bug -- include PubKey in TxInput 2014-12-28 03:06:47 -08:00
Jae Kwon 70eb75dca7 Refactor consensus/vote_set_test.go 2014-12-23 23:20:49 -08:00
Jae Kwon 62ff48c02b Documented Block, some renames 2014-12-23 01:35:54 -08:00
Jae Kwon 61d1635085 Fixed tests 2014-12-21 21:47:38 -08:00
Jae Kwon 6cacf6f09b RebondTx and more efficient IncrementAccum() 2014-12-16 05:45:40 -08:00
Jae Kwon 8718bd52a4 made ValidatorSet.Hash deterministic; fix off-by-1 bugs 2014-11-05 03:12:07 -08:00
Jae Kwon 5f794d14fb nil bugs 2014-11-05 03:12:06 -08:00
Jae Kwon da8e25343c Added LastBlockParts to state, and also validates. 2014-11-05 03:12:05 -08:00
Jae Kwon e42771e36f fix tests 2014-11-05 03:11:39 -08:00
Jae Kwon 89418ee7af Added CommitTimeWait step, the state machine model changed a bit. 2014-11-05 03:11:36 -08:00
Jae Kwon ac147e2353 everything but binary, common, and blocks are explicitly imported. 2014-10-16 16:00:48 -07:00
Jae Kwon b34988332f test bondTx. State.accountDetails unexported. 2014-10-14 01:18:06 -07:00
Jae Kwon 227cb0bee9 GetAccountDetail() returns a copy. More tests. 2014-10-13 23:34:23 -07:00
Jae Kwon c8f996f345 prettyprint block, unified state hash, test block mutation. 2014-10-13 20:07:26 -07:00
Jae Kwon 810aeb7bcb fix tests 2014-10-12 21:14:10 -07:00
Jae Kwon 7652c5d0de fix tests 2014-10-11 21:27:58 -07:00
Jae Kwon 349e3743df time in nanoseconds 2014-10-07 13:39:21 -07:00
Jae Kwon 31c1a1bbf7 remove mutex from state. 2014-10-07 01:05:54 -07:00
Jae Kwon 08f86176fc state save/load test. 2014-10-07 00:43:34 -07:00
Jae Kwon b73b7a54c7 ... 2014-10-06 21:28:49 -07:00
Jae Kwon 1ae9ecd2a9 fix basic tests. 2014-10-04 19:16:49 -07:00