Commit graph

5 commits

Author SHA1 Message Date
Olaoluwa Osuntokun
e0dbb5b535 txsort: Update package for BIP0069 acceptance.
BIPLI01 has been accepted as BIP0069, so update the README, comments,
tests, and testdata files as such.
2016-03-22 12:49:35 -07:00
Dave Collins
d6989ebc71 txsort: Correct the names of the tests. 2015-10-23 14:34:12 -05:00
Dave Collins
0df67ee064 txsort: Add InPlaceSort function.
This adds a new function with loud warnings which allows sorting a
transaction in place by mutating it.  This is more efficient for the
caller if they are the ones creating the transaction and are sure it
will not invalid any cache or containing structures.

The Sort function which makes a copy and is therefore does not mutate
the passed transaction is still available and the default method.
2015-10-23 12:46:06 -05:00
Dave Collins
e0e9257790 txsort: Convert tests, optimize, and cleanup code.
- Move hex for test txns into separate files in the testdata directory
- Convert tests to table-driven tests
- Make comments more consistent with the rest of the codebase
- Optimize the input sorting function to perform the hash equivalence
  check before reversing the bytes so it can be avoided in that case
2015-10-23 12:43:47 -05:00
Dave Collins
98fd0a0661 txsort: Convert to package
This converts the txsort code into a separate package and renames
'TxSort' and 'IsTxSorted' to 'Sort' an `IsSorted`, respectively.

It also adds a 'doc.go' and 'README.md' so it is consistent with the
other packages.
2015-10-23 12:09:28 -05:00
Renamed from txsort_test.go (Browse further)