Commit graph

9 commits

Author SHA1 Message Date
Dave Collins
d58ea754f3 Add test and infrastructure for block scripts.
This commit adds a test for checking known good block scripts in a block
are valid.  As a part of this, it adds the infastructure needed to load a
saved transaction store from a file which contains all of the input
transactions needed.

It also contains some changes from running goimports as well as some other
cleanup.
2015-01-08 05:10:54 -06:00
Tomás Senart
4772d4a1a4 goimports -w . 2014-07-02 19:14:27 -05:00
Dave Collins
87bef61b30 Update tests to use btcnet genesis params. 2014-05-28 00:56:57 -05:00
Dave Collins
f37a5e76b5 Update tests for recent API changes. 2014-05-27 10:15:35 -05:00
Dave Collins
4579cfb71b Refactor several network-specific params to btcnet.
This commit refactors the code to make use of the btcnet package for
network-specific parameters instead of switching on the specific network.

For example, the percentage of the network that needs to run version 2
blocks is different between testnet and mainnet.  Previously the code was
using a switch to choose these values.  With this refactor, those
parameters are part of the network parameters provided when creating a new
chain instance.

Another example is checkpoints, which have been moved to btcnet so they
can be specified by the caller instead of hard coded into this package.
As a result, the checkpoints for the standard networks are now specified
in the btcnet package.

This makes it easier to add new networks such as a testnet4 should it
become needed.  It also allows callers to define their own custom network
parameters without having to modify the code of the package to add new
switch cases for the custom network.
2014-05-27 10:11:55 -05:00
Dave Collins
e2dba2a074 Update for recent btcdb API changes. 2014-01-19 20:13:53 -06:00
Dave Collins
18ac5c848a Add 2014 to copyright dates. 2014-01-08 23:52:54 -06:00
Dave Collins
d0bbcacfc0 Modify the tests to use memory database backend.
This commit modifies the tests to setup a chain instance backed by the new
memory database backend for btcdb.  This allows the tests to avoid
creating and cleaning up files and also allows the tests to run faster
since it can all happen in memory.

The chainSetup function has also been changed to provide logic to switch
on the database type to allow for easy changing of the backend to a
different database type as needed.  For example, it could be useful to
provide extra testing against new database backends.
2013-11-08 02:52:50 -06:00
Dave Collins
6d078d8115 Implement chain setup infrastructure in the tests.
This commit implents a basic infrastructure to be used throughout the
tests for creating a new chain instance that is ready to have tests run
against it.  It also returns a teardown function the caller can use to
clean up after it is done testing.  This paves the way for adding more
tests.
2013-10-09 18:29:53 -05:00