Commit Graph

736 Commits

Author SHA1 Message Date
Jude Nelson
39e6ca1023 Verify that a name can be renewed after registration 2015-10-25 00:14:14 -04:00
Jude Nelson
231c5d4a51 Verify that a key can't preorder and register more than $QUOTA names 2015-10-25 00:13:44 -04:00
Jude Nelson
1834be5f7c Verify that colliding namespace reveals and registers don't work, but
updates, transfers, revokes, and renews that happen in the same block
get processed in transaction order
2015-10-25 00:13:08 -04:00
Jude Nelson
951d55619f Verify that preordered names can't be modified 2015-10-25 00:12:52 -04:00
Jude Nelson
e82f75e0b7 Test concurrent name import --> transfer --> revoke 2015-10-25 00:12:18 -04:00
Jude Nelson
b86f878958 Test name import --> transfer --> update 2015-10-25 00:11:58 -04:00
Jude Nelson
435512822c syntax error 2015-10-17 04:44:24 -04:00
Jude Nelson
0e57a1596f Return False when committing a duplicate namespace reveal 2015-10-17 04:44:03 -04:00
Jude Nelson
cb301fa288 Add tests for:
* operations on imported names
* no duplicate namespace reveals
2015-10-17 04:43:32 -04:00
Jude Nelson
4d78ea56dd Return False on failed name commit 2015-10-17 04:36:24 -04:00
Jude Nelson
e32f232f16 Add test that waits 10 blocks between each namespace operation 2015-10-17 04:10:00 -04:00
Jude Nelson
3fe4787fea Explicit array on join 2015-10-17 04:07:22 -04:00
Jude Nelson
02e78be8cf Don't hexlify on parse; hexlify hash when extracting from nameop. 2015-10-17 04:05:54 -04:00
Jude Nelson
503d1234f9 Properly construct NAME_IMPORT so we can recover its recipient and
sender; properly report namespace alterations at a particular block
(i.e. do so exactly once, not more than once).
2015-10-17 04:04:42 -04:00
Jude Nelson
5ed690cf68 Properly reconstruct a NAME_IMPORT when verifying a database; coerce
string more often.
2015-10-17 04:03:59 -04:00
Jude Nelson
03d9c2b62f Test-runner helper script 2015-10-15 20:21:52 -04:00
Jude Nelson
631e9c9434 Bugfixes and features for adding name history and fast bootstrapping:
* all methods: caller can supply its own consensus hash
* add RPC method to get a name's blockchain-derived history
* allow some RPC methods to proceed even while we're indexing
* add method to verify that an untrusted database file is consistent
with a (block id, consensus hash) pair.
2015-10-15 20:20:12 -04:00
Jude Nelson
331c3c8758 remove dead line 2015-10-15 20:19:54 -04:00
Jude Nelson
64c77d8aaf Lots of bug-fixes from testing:
* bugfix: track block_id --> [names] for *expiration*, not renewal
* bugfix: correctly deserialize name and namespace history
* add method to export the current database to a new file
* add method to strip name/namespace history
* add method to get the name as it was at a particular block number
* add method to get the name as it was at a particular block number
* add method to get the history of a name between two block numbers
* add method to get the set of all names and namespaces changed at a block number
* bugfix: only return a preorder hash if the object hasn't expired
* bugfix: off-by-one error when searching for consensus hash on NAME_UPDATE
* add method to get a name preorder by hash
* bugfix: use a name's namespace's 'lifetime' field to determine if it is expired.
* bugfix: on name expire, remember 'txid'
* bugfix: commit expired objects exactly once
* have each commit_() method for expired objects return the list of keys
to expired objects, so we can include them in the consensus hash.
* remember fee, op_fee, opcode, txid, and block_number for each operation.
* on NAME_UPDATE, remember the consensus hash
* bugfix: always remember the history of opcodes
* bugfix: don't store virtualchain fields
* bugfix: correct error message on namespace version mismatch
2015-10-15 20:11:07 -04:00
Jude Nelson
7b1970d4f4 expose consensus hash-covered fields common to all name operations. 2015-10-15 20:10:28 -04:00
Jude Nelson
bda14a3655 Map name operation byte code to name, for "disassembly". 2015-10-15 20:10:06 -04:00
Jude Nelson
542234ad45 Explicit bool 2015-10-15 20:09:49 -04:00
Jude Nelson
8681d9167f Sync with virtualchain API; serialize name operations using their
consensus hash-covered fields; generate a virtual "expire" name
operation on each block that describes the names and namespaces that
expired on that block.
2015-10-15 20:09:01 -04:00
Jude Nelson
44376f9ae5 refactoring: remove serialize() in favor of having each operation
identify the fields in the name operation that the consensus hash must
cover.
2015-10-15 20:08:26 -04:00
Jude Nelson
0a55fd828e Identify consensus hash-covered fields; remove dead serialize() method;
allow the caller to supply the namespace_hash when building a
namespace preorder script
2015-10-15 20:07:53 -04:00
Jude Nelson
e245ff5fba Identify consensus fields; coerce string on serialization 2015-10-15 20:06:10 -04:00
Jude Nelson
852f36608d Verify that namespace preorders will expire in a day. 2015-10-15 20:05:45 -04:00
Jude Nelson
f48b89b29b On each test, verify that we can reconstruct the db at each point in
history and find the same consensus hash as was generated when the test
was running.
2015-10-15 20:04:58 -04:00
Jude Nelson
7803708fd3 Add logic to next_block() to snapshot the db at each block and save its
consensus hash, as well as logic to use these snapshots to verify that
we can reconstruct the database at each block.  These tests will be
applied systemically.
2015-10-15 20:03:59 -04:00
Jude Nelson
ca206d40d8 Be verbose on error 2015-10-15 20:03:39 -04:00
Jude Nelson
1ec7a47293 Be verbose on error 2015-10-15 20:03:17 -04:00
Jude Nelson
5dcb6019a7 small tweaks to accomodate new block numbering in the test library 2015-10-15 20:02:47 -04:00
Jude Nelson
a5e62bb109 Better comments 2015-10-15 20:00:47 -04:00
Jude Nelson
b089e840c6 fix off-by-one error 2015-10-15 20:00:28 -04:00
Jude Nelson
a2ab66476e Add test to ensure we can get history of a namespace record, and get the
namepace record at each point in time.
2015-10-15 19:59:53 -04:00
Jude Nelson
db890a3c6c Add test to verify that we can reconstruct the database at each point in
history for a single name.
2015-10-15 19:59:22 -04:00
Jude Nelson
f4cb18d311 Add test that verifies that we can reconstruct the database at every
point in history, even when there are multiple names being registered, updated,
transferred, and revoked.
2015-10-15 19:58:19 -04:00
Jude Nelson
7cacdf47be Add tests that verify that name preorders and unrenewed names will
expire.
2015-10-15 19:57:52 -04:00
Muneeb Ali
efc0b770a2 bumped up version 2015-10-12 12:01:06 -04:00
Muneeb Ali
6cad38e5a7 Merge pull request #161 from blockstack/jude
Jude
2015-10-12 11:45:53 -04:00
Jude Nelson
e79f596077 Fix virtualchain synchronization upcall logic so the test only needs to
call next_block() once (and doesn't need to call sync_virtualchain())
2015-10-09 21:59:54 -04:00
Jude Nelson
45993efb4a Add a bunch of basic functionality unit tests. The naming is
self-explanatory--for example, name_preorder_register_update_cantforce
will create a namespace, preorder a name, register it, update it, try to
update it with a different key, and verify that the different key can't
force the update.

Each test allows the programmer to define a set of wallets filled with
btc in advance, create a blockchain by describing the order of
operations on a block-by-block basis, and then query the resulting
blockstore database to verify that each operation was processed
correctly.  The 'testlib.py' file serves as a common interface between
blockstore's API and the test logic--it will be stable for all tests, so
blockstore can evolve independently.
2015-10-09 21:57:33 -04:00
Jude Nelson
f2bf2ab756 use make_txid static method 2015-10-09 21:56:50 -04:00
Jude Nelson
d3e3362db9 Simulate decoderawtransaction enough that we don't need to call out to a
remote bitcoind node.
2015-10-09 21:56:26 -04:00
Jude Nelson
d9ea1b0fbf Remove uneeded keyword argument 2015-10-09 21:55:59 -04:00
Jude Nelson
bdab6a5e92 name_hash, not nam_hash 2015-10-09 21:55:44 -04:00
Jude Nelson
0708c1765b Remove unneeded keyword argument 2015-10-09 21:55:28 -04:00
Jude Nelson
42bd0b18a3 Test scenarios for successful namespace preorder, namespace reveal, and
namespace ready.
2015-10-07 02:37:26 -04:00
Jude Nelson
5b37a67221 Test scenarios library for interfacing unit tests with blockstore (in
particular, the mock UTXO provider and mock blockchain).
2015-10-07 02:37:00 -04:00
Jude Nelson
1262f4ce1d Mock blockstore config generator 2015-10-07 02:36:42 -04:00