Commit Graph

58 Commits

Author SHA1 Message Date
codegeschrei dd84d4eb6f Problem: There are unnecessary markers (#2522)
* Problem: we have unused and outdated fixtures
Solution: clean up fixtures and tests accordingly

* Problem: there are still unused fixtures
Solution: remove Merlin keys

* Problem: There are unnecessary markers
Solution: remove the tendermint marker for tests
2018-09-10 09:53:18 +02:00
Vanshdeep Singh cbfbfa8fc4 Problem: Public key format not standardized (#2508)
Solution: Add 'type' field to public key so that it can be decoded properly
2018-09-06 16:06:36 +02:00
Lev Berman 699494613f Problem: The commit mode behaves incorrectly. (#2510)
* Problem: The commit mode behaves incorrectly.

Solution: Parse the Tendermint response properly. The functionality was disabled in https://github.com/bigchaindb/bigchaindb/pull/2235/files#diff-c6511560546a7dc577e7e647b5bfdaceL68 and was not fixed since then.

* Add a test case for the sync mode.

* Do not strictly expect deliver_tx in the response.

* Fix post_mock in web/test_transactions.py.

* Check for the error field first.
2018-09-06 15:49:00 +02:00
Vanshdeep Singh 2656302c60 Problem: Bigchaindb crashes when restarted after init chain (#2519)
Solution: Return appropirate height so that Tendermint doesn't execute
init_chain more than once
2018-09-06 11:27:52 +02:00
Lev Berman 230a5b2d69 ABCI chain migration conclusion (#2488)
* Problem: No good way to check for val set absence.

Solution: Make get_validator_set/get_validators return None/[] when there are no validators yet.

* Problem: Incompatible ABCI chain upgrades.

Solution: Record known chains and sync through InitChain. Triggering the migration and adjusting other ABCI endpoints will follow.
2018-09-03 15:41:49 +02:00
Zachary Bowen cfc2c5900b Rework `upsert-validator show status` (#2496)
* Problem: We need to store the `election_id` as part of the `validator_update` so we can efficiently check which election was resposible for the change

Solution: Added the parameter to `store_validator_set` and aligned the tests

* Problem: Logic for `upsert-validator show` is convoluted

Solution: Rewrote the function to be much simpler

* Problem: Need a uniqueness constraint for election_id wrt validator changes

Solution: Added a new key to the db schema
2018-08-31 09:47:47 +02:00
Zachary Bowen 7a0b474d11 Problem: Users want to know upsert-validator election status.
Solution: Introduce the `upsert-validator show` command. Soon to be re-implemented via storing and querying identifiers of concluded elections.
2018-08-30 10:47:37 +02:00
vrde 407b771185 Problem: validating create+transfer might crash the system (#2487)
Solution: if a TRANSFER transaction is validated after a CREATE
transaction, the system crashes with `AttributeError: 'NoneType' object
has no attribute 'txid'`.

This happens because querying `get_spent` checks the attributes `txid`
and `output` of `input.fulfills` for every transaction in the current
buffer (`current_transactions`). For a CREATE, `input.fulfills` is None,
so the check would fail.

The solution is to check if `input.fulfills` is defined. If not, then
the current transaction cannot spend any output, so we can safely skip
it.
2018-08-29 14:13:22 +02:00
codegeschrei 6fdcaf44a7 Problem: we have unused and outdated fixtures (#2476)
* Problem: we have unused and outdated fixtures
Solution: clean up fixtures and tests accordingly
2018-08-27 09:48:20 +02:00
codegeschrei 90f2fdfc23 Problem: several tests are skipped (#2452)
* Problem: several tests are skipped
Solution: activate or remove tests

* Problem: store_transaction is deprecated
Solution: replace it with store_bulk_transaction

* Problem: we don't test the transaction split
Solution: undelete `test_store_transaction`

* Problem: failing tests
Solution: merge master and change deprecated store_transaction
2018-08-22 10:48:43 +02:00
Vanshdeep Singh 01dba7e883 Problem: Cannot conclude validator election (#2445)
Solution: Gather votes and conclude election when supermajority is achieved
2018-08-20 16:57:32 +02:00
Troy McConaghy abdd23f5a6 Problem: Source files contain no license info (#2455)
* Problem: Source files contain no license info

Solution: Add comments with SPDX license info to source files

* Python 3 files don't need # -*- coding: utf-8 -*-
2018-08-16 12:31:32 +02:00
Vanshdeep Singh 2e9a9b1121 Problem: Validator set not tracked by BigchainDB (#2436)
* Problem: Validator set not tracked by BigchainDB

Solution: BigchainDB depends on tendermint's RPC API to get the validator set
which is not avaiable during replay so the validators set should be tracked
inside BigchainDB

* Problem: Unclear code and documentation

Solution: Fix decode_validator and docs strings

* Problem: Doc strings missing

Solution: Add doc string for store_validato_set
2018-08-06 11:37:43 +02:00
Vanshdeep Singh 533030cdae Problem: No test to validate duplicate inputs (#2425)
Solution: Update tests
2018-07-31 14:33:28 +02:00
Zachary Bowen 2386ca9d71 Refactor tendermint directory to project root (#2401)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Problem: BigchainDB class should be part of project root

Solution: Removed the /tendermint directory and moved its contents to project root

* Problem: Flake8 complained that imports were not at the top of the file

Solution: Had to play around with the order of imports to avoid cyclic dependencies, but its working and style compliant now

* Problem: Stale reference to /tendermint directory in the index

Solution: Removed the references to /tendermint

* Problem: Flake8 complaining of unused import in __init__.py

Solution: The import is there so I can import App directly from bigchaindb, rather than from bigchaindb.core (which I think improves code readability. I added a # noqa to silence Flake8.

* Problem: Stale references to `bigchaindb.tendermint.BigchainDB` in the rst files cause Sphinx to fail

Solution: Updated the autodoc files to use `bigchaindb.BigchainDB` instead

* Problem: Stale reference to the `tendermint` directory in an @patch in a disabled test

Solution: Updated the @patch for completeness

* Problem: BigchainDB class should be part of project root

Solution: Removed the /tendermint directory and moved its contents to project root

* Problem: Flake8 complained that imports were not at the top of the file

Solution: Had to play around with the order of imports to avoid cyclic dependencies, but its working and style compliant now

* Problem: Stale reference to /tendermint directory in the index

Solution: Removed the references to /tendermint

* Problem: Flake8 complaining of unused import in __init__.py

Solution: The import is there so I can import App directly from bigchaindb, rather than from bigchaindb.core (which I think improves code readability. I added a # noqa to silence Flake8.

* Problem: Stale references to `bigchaindb.tendermint.BigchainDB` in the rst files cause Sphinx to fail

Solution: Updated the autodoc files to use `bigchaindb.BigchainDB` instead

* Problem: Stale reference to the `tendermint` directory in an @patch in a disabled test

Solution: Updated the @patch for completeness
2018-07-25 16:59:25 +02:00
Vanshdeep Singh c7503f5689 Problem: Support for latest Tendermint missing (#2375)
Solution: Upgrade to py-abci 0.5.1 to use latest Tendermint
2018-07-10 14:16:02 +02:00
Lev Berman 744ab3d5ef Problem: 2 implementations of fastquery exist. (#2365)
* Problem: 2 implementations of fastquery exist.

Solution: Remove the old deprecated implementation. Update the tests.

* Problem: There are still 3 outdated fastquery tests.

Solution: Fix the tests.
2018-06-29 15:48:58 +02:00
Shahbaz Nazir 2da720e542 Problem: There is no logging for benchmark stats (#2349)
* add log level for benchmarking

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* Bug fixes and code re-factor

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* remove un-necessary imports

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix failing tests

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* update docs

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix typo

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix flake8

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* fix flake8 issues

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>

* nitpic fixes

Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
2018-06-14 15:19:26 +02:00
vrde 357c3ee8eb Problem: API returns 404 for existing empty blocks (#2321)
* Problem: API returns 404 for existing empty blocks

Solution: Empty blocks are not store in MongoDB because Tendermint does
not notify BigchainDB about them. In case a user requests a block that
is not in our MongoDB, we check if the requested height is less than or
equal to latest_block_height. If that's the case, we return an empty
block. If the requested height is greater than latest_block_height, then
we return 404.

* Address Lev's comment

* address Lev and Vansh comment
2018-05-31 17:15:17 +02:00
Vanshdeep Singh a2aa4554c0 Problem: Spending transaction doesn't return properly (#2318)
Solution: Differentiate between stored spent txns and current spending txns
2018-05-29 17:43:42 +02:00
Vanshdeep Singh 7384a49d9a Problem: Invalid transaction posted to Tendermint (#2270)
* Problem: Amount error is not tested on the HTTP level.

Solution: A failed web test to reproduce the problem.

* Problem: Invalid transaction posted to Tendermint

Solution: Pass the exception to HTTP POST handler function

* Problem: DoubleSpend and CriticalDoubleSpend not differentiated

Solution: Handle these exceptions differently in `get_spent`

* Problem: No test for checking exception DoubleSpend and CriticalDoubleSpend

Solution: Add necessary tests

* Problem: find doesn't raise IndexError

Solution: Remove exception handling for IndexError
2018-05-09 13:41:22 +02:00
Vanshdeep Singh 63635f12fc Problem: Event stream test failing (#2262)
Solution: Extend the wait time for Tendermint to start
2018-05-03 16:42:43 +02:00
Vanshdeep Singh 920d69b0c4 Problem: Upsert validator not migrated to Tendermint 0.19.0 (#2252)
* Problem: Upsert validator not migrated to Tendermint 0.19.0

Solution: Migrate the same to Tendermint 0.19.0

* Problem: There are no tests for public key encoding/decoding

Solution: Add necessary tests
2018-05-02 16:21:28 +02:00
Vanshdeep Singh 44f19a398c Problem: Tests failing with py-abci 0.4.1 (#2235)
Solution: Fix tests and Migrate to Tendermint 0.19.0
2018-04-26 11:09:38 +02:00
Vanshdeep Singh 65bb6e5c91 Problem: No integration test for upsert-validator (#2212)
Solution: Write necessary test
2018-04-24 16:17:49 +02:00
Vanshdeep Singh 127ee08053 Problem: No crash recovery mechanism (#2207)
Solution: Add crash recovery logic based on BEP#8
2018-04-18 10:46:16 +02:00
Vanshdeep Singh a62cd68f8c Problem: No test for reponses from Tendermint during POST txn (#2210)
Solution: write tests
2018-04-16 15:30:02 +02:00
Vanshdeep Singh 7f6782e31d Problem: ABCI server not run for tests (#2138)
Solution: Create seperate test mark for which the ABCI server will be running
2018-04-10 17:29:25 +02:00
codegeschrei 6f69f39ff4 Problem: there are no f-strings in python 3.5 (#2185)
Solution: change f-strings to a compatible format for Python 3.5
2018-04-09 17:02:59 +02:00
Vanshdeep Singh 25043bc993 Problem: Block height in event stream is string. (#2167) 2018-04-03 12:08:00 +02:00
Vanshdeep Singh e4e528e5c4 Problem: Changing validators requires a network restart (#2070)
Solution: Allow nodes to add, update, or remove validators at runtime using a new command. Implements BEP3.
2018-03-29 18:25:26 +02:00
Vanshdeep Singh 283f685f07 Problem: FastQuery not working (#2153)
Solution: Fix FastQuery Class
2018-03-23 17:16:00 +01:00
Vanshdeep Singh cffd68f7cf Problem: Event stream test incomplete (#2152)
Solution: Complete the test by checking connection status returned in the 'result' field
2018-03-23 15:39:47 +01:00
Vanshdeep Singh 8c32ae798b Problem: UTXO implementation unfinished for release. (#2132)
Solution: Rollback UTXO for the alpha release.
2018-03-14 17:58:05 +01:00
Sylvain Bellemare 56dfd9bab0 Problem: represent utxoset state as a hash
Solution: create a merkle tree out of the utxoset and compute its merkle
root
2018-03-01 17:50:20 +01:00
Sylvain Bellemare 967d5727e2 Problem: store_metadata was renamed
Solution: perform required update

Note: see #2034
2018-03-01 15:11:58 +01:00
Sylvain Bellemare 51d4f0f2d9 Problem: utxoset needs to be updated
Solution: update utxoset via store_transaction
2018-03-01 15:11:58 +01:00
Sylvain Bellemare 6e3f9e8f54 Docker compose for travis (#2039)
* Replace double quotes with single quotes (flake8)

* Test event subscriber to tendermint via ws

* Problem: Tendermint is not part of stack for CI

Solution: Add Tendermint to stack for CI. For simplicity's sake
docker-compose is being used.
2018-02-14 10:19:04 +01:00
Sylvain Bellemare b2584dd0fa Order imports as per pep 8 2018-02-08 15:19:47 +01:00
Vanshdeep Singh a7ed8cf4cb Write transactions on commit (#2017)
* Write transacitons on commit

* Fix docs strings, lazy check for duplicates
2018-02-02 14:40:24 +01:00
Vanshdeep Singh e25d365828 Integrate blocks API (#1970)
* Integrate blocks api

* Update docs

* Fix docs

* Fixed mismatch between code and documentation

* Fixed docs
2018-01-31 14:42:41 +01:00
codegeschrei 1d99d6e8a8 requested changes 2018-01-15 17:12:17 +01:00
codegeschrei 06a091e215 add mode parameter to transaction endpoint, fixes #1995 2018-01-11 13:26:06 +01:00
kansi f5b887ac59 Integrate events api 2017-12-06 15:42:45 +05:30
kansi 2b3a9fa6f6 Integrate output search api 2017-11-30 23:59:42 +05:30
Katha 9d38d3d405
add tests to improve codecov (#1871)
* add tests to improve codecov
2017-11-30 15:07:45 +01:00
kansi 6c3f176122 Integrate asset search 2017-11-23 21:28:51 +05:30
kansi 00dd16840f Added backend tests, configure app fixture 2017-11-23 16:27:35 +01:00
kansi 95c0f267e0 Integrate api GET "/transactions?asset_id={asset_id}&operation=" 2017-11-23 16:27:35 +01:00
vrde f4a6b863fe
Merge branch 'tendermint' into write-transfer-test 2017-11-23 15:55:32 +01:00