1046 Commits

Author SHA1 Message Date
z-bowen
9896888e16 Problem: Some unnecessary TODOs
Solution: Removed 'em
2018-08-29 18:41:43 +02:00
z-bowen
ba856c2044 Problem: A dirty test in test_utils is contaminating the test env
Solution: Added a work around to allow testing of `upsert_validator show`
Added TODOs to detail what is wrong with the broken test
Raising it as a GitHub issue to fix the bad test
2018-08-29 17:33:15 +02:00
z-bowen
3de8b7a0db Problem: Missed a debug print
Solution: Removed it
2018-08-29 15:39:01 +02:00
z-bowen
8f01e1c4e8 Problem: caplog not capturing logging statements in a test
Solution: Put the function execution in the `caplog` context
2018-08-29 15:14:17 +02:00
z-bowen
e163547a7e Merge branch 'master' into create-dynamic-upsert-validator-commands 2018-08-29 14:49: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
z-bowen
58a6fb450b Problem: test_upsert_validator_show was moved to the tests/upsert_validator directory, making it redundant
Solution: Removed the redundant test
2018-08-29 13:16:33 +02:00
z-bowen
efa2be26be Problem: test for run_upsert_validator_show made use of run_upsert_validator_new, which was overly complicated
Solution: Moved the test to the `tests/upsert_validator` directory so it could make use of the `election` fixtures.
2018-08-29 13:15:30 +02:00
z-bowen
c9847f9537 Problem: public_key displayed in base58 format, while the input is in base64
Solution: Convert the key back to base64 before displaying it to the user
2018-08-29 11:56:23 +02:00
z-bowen
5f12ee84a3 Problem: show changed to write to logger instead of returning a string
Solution: Aligned tests to check for messages in `logger`, rather than checking for return values
2018-08-29 11:45:53 +02:00
z-bowen
eaff0b1d2d Problem: Left a 'WIP' tag on a finished test
Solution: Removed the tag
2018-08-28 17:33:05 +02:00
z-bowen
163f7dc660 Merge branch 'master' into create-dynamic-upsert-validator-commands 2018-08-28 17:29:13 +02:00
z-bowen
223488e647 Problem: Requested new return value for upsert-validator show, status
Solution: Wrote code and tests to implement the new return value
2018-08-28 16:45:44 +02:00
Vanshdeep Singh
8e97c753eb Problem: upsert-validator 'approve' command does not transfer vote to election public key (#2480)
Solution: Transfer vote to the election public key; generalize implemenation to handle election txn type

* Problem: Upsert valdiator 'new' doesn't accept public in base64 format

Solution: Tendermint stores all keys in base64 format so it would suitable to
abandon base58 encoding in favour of base64 encoding

* Problem: Not test for invalid execution of upsert-validator 'new'

Solution: Write tests to when invalid power or private key path has been supplied

* Problem: Exceptions are not informational when executing upsert-validator

Solution: generate error logs or print statement indicating success
2018-08-28 14:21:59 +02:00
vrde
41a2687b9b Problem: websocket fails with ELECTION transaction (#2482)
Solution: have a more general approach to process transaction types. If
a transaction does *not* contain `asset.id`, then the `id` of the
`asset` is the `id` of the transaction.
2018-08-27 15:00:02 +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
z-bowen
a48e6b7046 Problem: Wrong return value format for upsert-validator show
Solution: Changed the formating to align with BEP-21
2018-08-24 14:29:09 +02:00
z-bowen
b3a0c13da1 Problem: No test covering upsert-validator show
Solution: Wrote a test. Also changed validator node_ids to include the name of the test they're part of, which should prevent `DuplicateTransaction` collisions during testing.
2018-08-24 14:18:54 +02:00
z-bowen
6ca97bd0e5 Merge branch 'master' into create-dynamic-upsert-validator-commands 2018-08-24 10:04:56 +02:00
codegeschrei
d31ab9fb40 Problem: There is no way to vote for an election (#2458)
* Problem: `run_upsert_validator_approve` was getting the voting power in a convoluted way

Solution: Changed it to get the voting power from the election outputs

* Problem: `run_upsert_validator_approve` casts votes for *all* voters, not just the user calling the command

Solution: Filter vote txs by the users public key

* Problem: Docs needed a more specific description of how to input the path to the private-key file

Solution: Changed the wording a bit
2018-08-24 09:52:00 +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
codegeschrei
55a9151c14 Problem: tests in test_bigchain_api are not activated (#2456)
* Problem: tests in test_bigchain_api are not activated
Solution: remove or active tests

* Problem: TransactionNotInValidBlock was removed
Solution: remove TransactionNotInValidBlock from tests
2018-08-22 09:56:44 +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
Zachary Bowen
0b0f10050e
Merge branch 'master' into create-dynamic-upsert-validator-commands 2018-08-13 14:14:45 +02:00
z-bowen
96d39778c5 Problem: upsert-validator needs a command to 'show' election data
Solution: Wrote `upsert-validator show` as specified in BEP-21
2018-08-13 13:57:40 +02:00
Zachary Bowen
3092beb995 Reenable test bigchain api - part 1 (#2415)
* 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!

* 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: Tests in class `TestBigChainAPI` from `tests/db/test_bigchain_api.py` were disabled

Solution: Fixed the tests that still made sense, and deleted the rest.

* Problem: Flake8 style complaints

Solution: Made things prettier

* Problem: Debugging comments were slightly NSFW

Solution: Deleted the debugging comments

* Problem: Stale use of `pytest.mark.genesis` decorator on these tests

Solution: Removed the decorator

* Problem: CriticalDoubleInclusion exception was no longer used anywhere in the code

Solution: Deleted it

* Problem: Unused exception `GenesisBlockAlreadyExistsError`

Solution: Deleted it

* Problem: I removed a test that covered writing to the DB and checking that everything is stored faithfully

Solution: Replaced it and got it working again
2018-08-13 09:54:45 +02:00
Zachary Bowen
3760824261 Create dynamic upsert validator commands (#2446)
* Problem: Need a method to initiate a new upsert-validator election

Solution: Added subcommand `new` to `upsert_validator`

* Problem: Changes to upsert-validator needed to be reflected in the docs

Solution: Wrote a section for `upsert-validator new`
2018-08-09 17:29:21 +02:00
z-bowen
1a1f16b65b Merge branch 'create-dynamic-upsert-validator-commands' of github.com:z-bowen/bigchaindb into create-dynamic-upsert-validator-commands 2018-08-09 14:57:00 +02:00
z-bowen
9fa4518741 Problem: Debug print statements left in test
Solution: Removed the print statements
2018-08-09 11:44:37 +02:00
Zachary Bowen
47305c0f17
Merge branch 'master' into create-dynamic-upsert-validator-commands 2018-08-09 11:39:39 +02:00
z-bowen
cb0dd5ecbe Problem: Removed argparse for upsert-validator-show command, but forgot to remove the test for these args
Solution: Removed the test
2018-08-08 16:10:23 +02:00
z-bowen
6263c6779e Problem: Used @pytest.skip instead of @pytest.mark.skip
Solution: Fixed
2018-08-08 15:16:30 +02:00
codegeschrei
44be8f572f Problem: Block parameters are not required anymore (#2374)
* Problem: all blocks are valid
Solution: remove the status from transactions

* Problem: changed the return type of get_transaction_filtered
Solution: return tx class instead of dict
2018-08-08 15:08:34 +02:00
z-bowen
13d003a71f Problem: WIP test was not explicitly skipped
Solution: Added an @pytest.skip
2018-08-08 15:02:41 +02:00
z-bowen
3fd14ed93a Problem: More Flake8 complaints...
Solution: Made things prettier
2018-08-08 12:20:47 +02:00
codegeschrei
bdfa059046 Problem: some tests are not activated (#2390)
* 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: some tests are not activated
Solution: activate and remove or fix tests

* Problem: accidentally un-skipped test_get_blocks_status_containing_tx during merge

Solution: Replaced the skip
2018-08-08 12:17:44 +02:00
z-bowen
76240613db Problem: Flake8 whining about spaces after comment #
Solution: Made things pretty
2018-08-08 12:16:00 +02:00
z-bowen
7cdc5ea58c Problem: Master has changes since I started work on this branch
Solution: Merge the changes from master
2018-08-08 10:55:44 +02:00
z-bowen
2a3d728d84 Problem: Need a method to initiate a new upsert-validator election
Solution: Added subcommand `new` to `upsert_validator`
2018-08-08 10:48:17 +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
1a74afa9cd Problem: Node operator cannot vote on a ValidatorElection (#2428)
* Problem: Node operator cannot vote on a ValidatorElection

Solution: Implement validator election voting spec

* Problem: Incorrent code comments

Solution: Update comments with correct context

* Problem: Delegated vote not casted back to election

Solution: Update test to cast votes back to election id and assert their validity
2018-08-02 11:49:59 +02:00
Vanshdeep Singh
533030cdae Problem: No test to validate duplicate inputs (#2425)
Solution: Update tests
2018-07-31 14:33:28 +02:00
Vanshdeep Singh
f13c9a9d57 Problem: Stateful validation doesn't raise double spend exception (#2422)
* Problem: Stateful validation doesn't raise double spend exception

Solution: Transaction.validate should raise exception DoubleSpend if the given
transaction is already a part of the database

* Problem: Double spend exception message not accurate

Solution: The exception message should state that the double spend is because of
spending the same input more than once in the transaction
2018-07-31 14:06:21 +02:00
Vanshdeep Singh
7dcdefc58b Problem: There is no way to add new validators (BEP-21) (#2392).
Solution: Start by integrating the new election spec specifed in BEP-21.
2018-07-27 17:38:24 +02:00
Lev Berman
a0670b6d06
Problem: config utils tests are disabled. (#2402)
Solution: enable them back, cleanup no longer relevant parts.
2018-07-27 17:35:44 +02:00
Lev Berman
2f6413fcd0 Problem: Transaction schema tests were disabled. (#2404)
Solution: Re-enable the tests. Remove some no longer relevant parts.
2018-07-26 16:44:56 +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
codegeschrei
d521a00925 Problem: a valid transaction is detected as double spend (#2389)
Solution: query the wanted data per input
2018-07-18 10:52:33 +02:00
codegeschrei
fdf0283508 Problem: consensus and blocks are deprecated (#2384)
Solution: remove test files for consensus and blocks
2018-07-16 19:21:27 +02:00