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.
- 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
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.