* Write unit test for SpendingInfoDAO.upsert(), match on outpoint rather than id
* Add more explicit error message for failing to clear utxos and addresses
* Add unit test we can handle spending funds and receiving funds in the same transaction inside the wallet
* Use fundRawTranaction() to make sure the utxo is reserved
* Add mark as spent optimization to batch writes rather than write inside the method
* Scaladoc refactor
* Refactor received spendingInfoDbs to be cached outside of processTransactionImpl()
* Implement processBlockCachedUtxos() to improve performance
* Fix typo
* Make TransactionProcessing.processTransactionImpl() a bit more parallel, fetch all relevant received and spent txos in parallel
* More refactors, make sure return types are Vector rather than Seq to make sure we don't have any pathlogical surprises with scala collections
* Fix type annoation to be Vector
* Fix remaining usage of Seq in TransactionProcessing
* Fix pattern match on Vector on 2.12.x
* Change input to Vector rather than Seq in processSpentUtxos()
* Removed ExecutionContext from ECKey
* Refactored ECPublicKey to remove compression state and introduced ECPublicKeyBytes to handle cases where serialization of input is important
* Fixed the rest of bitcoin-s so that it passes all tests
* Made all ECKeys into case classes
* Successfully added isFullyValid invariant to ECPublicKey!
* Fixed docs
* Added scaladocs and fixed a RpcPsbtResult bug
* Reject private keys of length < 32 and fix WIF parsing bug
* Refactor MultiWalletTest to actually shutdown the walletAppConfigs
* Remove 'implicit' modifier from getFreshWalletConfig. This is a problem as it can be used implicitly to bind resources (threads, files etc) that need to be cleaned up. Since it is implicitly passed, it is very hard to remember to clean up these resources
* Cleanup TrezorAddressTest
* Remove unecessary BitcoinSWalletTest.afterAll()
* Fix docs
* Removal of datadir race condition
* Cleanup nodeTest to shutdown the transitive chainAppConfig required by NodeAppConfig
* remove experimental tag on NeutrinoNodeTest
* Remove extra line
* Cleanup after BitcoindChainhandlerViaZmqTest
* Push to github to force re-run of CI 2
* Fix bug introduced in PR 2597, we need to explicitly call WalletAppConfig.stop() now rather than transitively calling it via Wallet.stop()
* Fix calls to wallet.stop() -> wallet.walletAppConfig.stop() in BitcoindBlockPolling,BitcoindBackend. Also add some explicit type annotations
* Get FilterSync test working with cached bitcoind in chainTest project
* Small refactor to be DRY
* Fix docs
* Refactor ChainSyncTest to use 1 cached bitcoind, as a by product add ChainWithBitcoindNewestCachedUnitTest
* Remove unecessary mixin trait
* Fix missing ChainWithBitcoindNewestCachedUnitTest.afterAll()
* Reduce thread pool size for akka's internal dispatcher in unit tests from 2 -> 1. Same with the blocking dispatcher
* Add comment
* Fix missing database shutdown on WalletAppConfig.stop()
* Cleanup BitcoindBlockPollingTest
* Cleanup ProcessBlockTest and all tests that use CachedBitcoind
* Cleanup BitcoindBackendTest
* Cache rescan thread pool rather than creating a new one everytime
* Add invariant to spendingInfoDb to that requires if the spendinginfodb is in a TxoState.spentStates, the SpendingInfoDb.spendingTxIdOpt is defined
* Remove unused SpendingInfoDAO.updateTxoState()
* Remove comment
* Make TxoState and explicit parameter for test methods. Most test methods depend on a sample utxo state, so make the caller of the method specify what state they want the txo to be in
* Fix github actions config
* Fix RoutesSpec test
* Wallet Rebroadcast Logic
* Use wallet scheduler for address queue rather than it's own thread
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Bump default
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Create CachedBitcoind, implement it in FundTransactionHandlingTest
* Add BaseWalletTest, extend it with BitcoinSWalletTest & BitcoinSWalletTestCachedBitcoind, add CachedBitcoinV19 and use it RescanHandlingTest
* Make ProcessBlockTest work with cached bitcoind
* Make trait for CachedBitcoindNewest for the newest version of bitcoind
* Make UTXOLifeCycleTest use cached bitcoind
* Add WalletBloom, WalletSyncTest to use cached bitcoinds
* Add WalletIntegrationTest
* Rework beforeAll() and afterAll() into the super trait like BaseWalletTest
* Add standlone BitcoindFixtures, use it in BitcoindBackendTest
* Use new BitcoindFixtures in BitcoindBlockPollingTest
* Introduce BaseNodeTest, start implementing the usage of cached bitcoinds in the nodeTest project
* Use cached bitcoind's with SpvNodeTest & SpvNodeWithWalletTest
* Fix bug on postgres with reusing database, upsert the genesis header rather than create it
* Get NeutrinoNode tests workign with cached bitcoinds
* Fix NeutrinoNodeWithWallet by destroying wallet state for Postgres
* Add teardown helper method for bitcoind
* Teardown chain project when using node fixtures since node is dependent upon the chain project.
* Turn off parallelExecution again
* Switch the parallelExecution flag to only be set on CI, so we can get better performance when running locally
* Start implementing BitcoindFixtures, use BitcoindFixturesCachedTriple on TestUtilRpcTest
* Fix compiler errors, begin implementing NodePair
* Refactor TestRpcUtilTest to use 2 bitcoinds rather than 2
* Reduce the number of bitcoinds that MultiWalletRpcTest needs from 3 -> 1
* Reduce number of bitcoinds used in WalletRpcTest from 3 -> 2
* Add some documentation
* Try to re-add parallelExecution
* Reduce the number of bitcoinds used in PsbtRpcTest from 3 -> 2
* Disable parallelExecution in Test again
* Make BitcoindV21RpcClientTest & BitcoindV20RpcClientTest reduce bitcoind usage from 2 -> 1
* Make BitcoindV19RpcClienttest reduce bitcoind usage from 2 -> 1
* Rework MempoolRpcTest to use fixtures, add BitcoindVersion to CachedBitcoindCollection
* Make sure clientAccumm has to be specified as a paramter now rather than filling in by default
* Begin parameterizing NodePair/NodeTriple to retain type information for the specific version of bitcoind that was used
* Don't implement version in super trait
* Fix docs
* Fix async issue in V21 test suite
* Append to vectors in CachedBitcoinCollection rather than replace
* Fix rebase issues
* Add scaladocs
* Fix BitcoindV18RpcClient address info test
* Implement fixtures in BitcoindV17RpcClientTest fixtures
* Cleanup v17 PsbtRpcTest
* Reduce bitcoind usage from 3 -> 1 in BitcoindV18RpcClientTest
* Remove abandon transaction test, this allows us to reduce the number of bitcoind's used in MempoolRpcTest from 3 -> 2
* Remove the requirement to inject BitcoinSAsyncFixtureTest, add it in the test traits explicitly to make things easier. Also add explicit afterAll() method to tear down both the CachedBitcoind & BitcoinSAsyncFixtureTest
* Fix missing Await.result() in BitcoindRpcTest.afterAll()
* Rework MultiWalletRpcTest to use a NodePair
* Rework BlockchainRpcTest to use fixtures
* Rework Client start()/stop() methods. Now use an AtomicBoolean to indicate when a user has requested a client to start/stop rather than sending pings to bitcoind that can fail because the conneciton pool has been shutdown in test cases
* Try my luck with turning on parallelExecution in CI again
* Revert parallelExecution, now testes do not run in parallel on CI
* Only turn off parallelExecution for bitcoindRpcTest
* Adjust build to only have bitcoindRpcTest NOT in run parallel on mac, reduce number of blocks used in BitcoindRpcTestUtil.createNodeSequence
* Run less tests in the rpc test suite as that takes the longest, move them over to node/wallet/dlc test suite on mac osx CI
* Don't run eclair tests in parallel either
* Remove CachedBitcoind from BitcoinSWalletTest
* Fix async bug in test case
* Push to github to force re-run of CI
* Push to github to force re-run of CI
* Push to github to force re-run of CI
* Move blockhash to tx table from spending info table
* Add test, fix spending tx id col name
* Scaladocs, add test
* Add more unit test
* Make id not comparable in process tx test
* Fix tests
* attempt to fix
* Add mempool comment to scaladoc
* Deparallelize process inputs & outputs
* Refactor AsyncUtil to just use an execution context rather than an actor system
* Create testkit-core, start moving data structures over to testkit-core
* WIP, getting rid of the hard dependency on BitcoinSAsyncTest and akka
* Rework test traits to not be dependnent on akka, move BaseAsyncTest into testkitCore, add a test trait that just uses the default scala executionContext
* Get everything compiling
* Move logback-test.xml to testkit-core so it applies to coreTest,cryptoTest as well
* Cleanup rebase issues
* Fix Deps.scala
* Address ben's code review
* Segregate jvm settings and compiler settings
* Filter out -Xfatal-warning for scalajs for now since there is a ton of errors
* Move maintainer settings into CommonSettings.settings
* Refactor AsyncUtil to just use an execution context rather than an actor system
* Create async util project, use it in various projects that depend on it
* Reduce usage of .findAll() (doesn't scale for large dbs). Now pass in the specific things we are searching for
* Add timestamps for checking how long it takes to processBlock()
* Rename NodeUnitTest.confg -> NodeUnitTest.getFreshConfig()
* Rename CachedBitcoinSAppConfig.config -> CachedBitcoinSAppConfig.cachedConfig
* Make CachedChainAppConfig extend CachedBitcoinSAppConfig
* use cached configs in both wallet/chain project as well taking ben's suggestion to fix those
* WIP
* Get neutrino node with wallet 'receive information about received payments' working again
* Fix compile
* Remove initial sync logic from test case
* Remove sync logic in NeutrinoNodeWithWallet test cases
* Improve logging and rename a few things
* WIP2
* WIP3
* Get NeutrinoNodeWithWallet tests working
* Implement WalletSync, which allows you to sync a wallet from a arbitrary data source
* Get all tests passing again
* Use spv.appConfig in DataMessageHandlerTest rather than caching the config
* Modify cleanup to hopefully get CI passing
* Fix postgres tests by cleaning the table during the destroy phase of the test fixture. This is needed because the same postgres database is shared between tests in the same test suite
* Revert logback-test.xml
* Get sqlite/postgres tests passing pt 2
* syncHeight -> syncDescriptorOpt()
* Add case for genesis block hash in WalletSync
* Fix SpvNodeWithWallet test case to actually test spv functionality
* Remove nodeCallbacks parameters, callbacks should be registered on nodeAppConfig
* Fix bug where test compiler opts were not enabled
* Fix all exsting compiler warnings in test project
* Add scalaCollectionCompat dependency to bitcoindRpcTest so we can use @nowarn annotation on scala 2.12
* Multi Wallet support
* Fix Oracle tests
* Fix some CI errors
* Increase KeyManagerAppConfig code coverage
* Add test for multiple seeds in seed folder
* Move things in reference.conf files
* Lower key manager coverage requirement
* Fix postgres test issues
* Create DbAppConfig
* Add some docs, fix hardcoded postgres db name
* Clarify db vs schema
* Add character types
* Fix chaindb in conf
* Always copy default seed
* Remove need for driverName config
* Make aesPassword option for wallet config
* Add to docs
* Make AesPassword optional
* Small touchups
* Fix for oracle server
* Fix docs
* Increase code coverage
* Cleanup a bunch of imports in test
* Use @nowarn annotation for testing things that are deprecated
* Fix base58 test
* Cleanup crypto-test
* Use scala collection compat dependency to get access to the @nowarn annotation on scala 2.12.x
* Rework more scala 2.13.x compile failures in chain-test and key-manager-test
* Optimize imports for entire project
* Fix nits
* Add Wallet State Descriptors
* Sync blocks while offline w/ bitcoind backend
* Add to WalletDbManagement
* Update db management test
* Respond to review
* Rename function
* Remove requirement for ZMQ with bitcoind backend
* Add test, move poller to BitcoindRpcBackendUtil
* Add docs & logs, fix niche case
* Use AtomicReference, reset prevCount on failure
* Apply string factory to a bunch of easy things
* Refactor HDPath, ExtKey, and LnTagPrefix to use StringFactory
* Implemen StringFactory on LnHumanReadablePart, ScriptType, ServiceIdentifier
* Implement StringFactory on AesCrypt, NodeUri, AddressTag, PSBT, TxoState
* Fix failing tests, fix website compile
* Apply StringFactory to all ScriptOperations, ChannelState, Script Parsing
* Update scalafmt-core to 2.6.0
* Upgrade scalafmt, fix all formatting errors
* Scalafmt on 2.12
* fix test
* More fixes
Co-authored-by: Ben Carman <benthecarman@live.com>
* Implement unit test cases for initializing a wallet twice, and failing with an exception when we initialize a wallet with a different key-manager
* Use bip39PasswordOpt cached in the WalletUnitTest suite
* Turn off logging
* Run scalafmt
* Turn log level back to WARN
* Run scalafmt
* Added crypto project and decoupled BitcoinSLogger from NetworkElement
Decoupled BitcoinSLogger from Factory
Moved NetworkElement into crypto project
Moved Factory and BitcoinSUtil (renamed to BytesUtil) to crypto project
Moved MaskedToString to crypto project
Added BytesUtil to imports and cleaned up CryptoUtil.recoverPoint
Moved the rest of crypto stuff to the crypto project
Moved crypto tests to crypto-test project
* Added documentation for crypto project
* Add wallet creation time for rescans
* Fix docs
* Clean up and add test
* Remove account bday
* Fix compile issue and docs
* Add more chain handler tests
* Use Instant over Long, add docs
* Fix docs
* Implement Slick's multi database support via our DAOs
WIP2 work on chain project
WIP make JdbcProfieComponent so we have a common JdbcProfile
WIP2
Clean up a few things
WIP got CRUDAutoInc compiling
Get closer to everything compiling in the chain project
Begin moving database code into JdbcProfileComponent
WIP source compiling
Get dbCommonsTest/ test cases passing
Get rest of tests compiling and passing
* Rebase onto master, fix conflicts
* Run scalafmt
* Run scalafmt again
* Cleanup a few compiler warnings by adding type annotations to thigns
* Explicitly cast tables where they are needed in the wallet project where we need TableQuery for foreignkey / joins in slick
* Redo definition of 'table' to use the profile.api.TableQuery in scope
* Rename all *Table.scala files to *Db.scala
* First crack at address ben's code review
* Fix docs compile issue
* Fixed casting (#30)
* Fixed AppConfig casting
* Fixed TableQuery casting in DbManagement subtypes
* Fixed casts in DAOs relating to internal types
* Address nadav's code review, move JdbcProfileComponent into it's own file
* Remove unused listTables() method
Co-authored-by: Nadav Kohen <nadavk25@gmail.com>
* WIP: Build queue for getnewaddress
* Implement background thread to process requests to getNewAddress so that we fix issue 1009 with it's async issues
* Run scalafmt
* Replace the mutable.ArrayBuffer in AddressHandling with ConcurrentLinkedQueue
* Put FundTransactionhandling.fundRawTransactionInternal's call to getNewChangeAddress() into the for expression so we don't generate an address when the funding of the transaction fails when selecting utxos
* Move thread initialization out of method
* Switch to using ArrayBlockingQueue, which will block thread with .take() so we don't need to loop constantly, add 'addressQueueSize' and 'addressQueueTimeout' configurations
* Update wallet-test/src/test/scala/org/bitcoins/wallet/AddressHandlingTest.scala
Co-Authored-By: rorp <rorp@users.noreply.github.com>
* Add error handling to return the failed future if the queue is full, add a unit test for when the queue is full
* Run scalafmt
* Rebase
* Add scaladoc for throwing an exception
* Run scalafmt again
Co-authored-by: rorp <rorp@users.noreply.github.com>
* GetAddress Wallet API call
* Add ability to get unfunded address
* Generate new address if no unfunded addresses
* Add test
* Add wallet get address documentation
* Incoming and Outgoing Transaction Tables
* Remove script sigs for witness txs
* Create parent tx_table for incoming and outgoing txs
* Response to review
* Use isCloseEnough
* Fix test
* Fix rebase error
* Test that tx is tracking all sats correctly
* Add wallet rescan tests
* Create FilterSync, which gives us an API inside of the chain project to sync filters with
Add another unit test to filter sync
Add more unit tests for ChainSync and FilterSync
Clean up some docs, remove some extra lines of code
Run scalafmt
Add filter-sync.md
Cleanup some nits
Add more information of how FilterSync.syncFilters() works
Add 'FilterWithHeaderHash' type so that we can actually validate/verify block headers that are being fed into the chain project
Run scalafmt, hide imports in filter-sync.md so code appears cleaner
Move implicits out of invisible block as it seems to cause errors
Make it so FilterSync processes filters in batches rather than fetching them all at once
Fix compile error
* WIP bitcoind implement ChainQueryApi
* rework fixtures to be able to support injecting ChainQueryApi implemented by bitcoind into our fixture infrastructure for creating wallets
* Fix rebase problem
* Implement getFiltersBetweenHeight() with ben's solution
* WIP Start implementing NodeApi against bitcoind
* Actually inject the bitcoind backed nodeApi into our fixture
* Get first rescan test working for rescanning the entire blockchain
* Implement test case for rescanning from a specific height
* Fix NeutrinoNodeWalletTest test case that uses a experimental version of bitcoind, for now i believe our experimental binary is on v18
* Add wallet-rescan.md, add helper method to WalletApi that allows you to clear out the wallet's utxos/addresses
* Add another log to try to debug CI
* Address code review
* Fix wrong ordering of deletion of tables in clearUtxosAndAddresses()
* reset logging level
* Create 'fundRawTransaction' and 'fundRawTransactionInternal'
* Move TransactionTestUtil to testkit, begin writing tests for fundrawtransaction
* Add FundTransactionTests
* Move things to 'FundTransactionHandling' trait
* Start segregating things by HDAccount in the wallet, this gives us the ability to query for balances based on account, fund a transaction based on an account, generate a new address based on an account etc. All old api calls are now based on the default account, i.e. getBalance() returns the balance for account 0, fundRawTransaction funds the transaction from account 0 etc.
* Fix compile issue with 2.11.x
* Bump address generation Thread.sleep() to 500ms
* Address ben code review
* Address code review
* Create 'fundRawTransaction' and 'fundRawTransactionInternal'
* Move TransactionTestUtil to testkit, begin writing tests for fundrawtransaction
* Add FundTransactionTests
* Move things to 'FundTransactionHandling' trait
* Address code review
* Run scalafmt
* Add more expressive txo states for the wallet
* Rename 'PendingReceived/PendingSpent' -> 'UnconfirmedReceived/UnconfirmedSent'
* Address code review
* Fix posInt implementation to work with older scala versions
* Rename to PendingConfirmationReceived/PendingConfirmationSpent
* Implement abililty to use BIP39 password. This means this password needs to be password through our various projects to be able to correctly generate the key that controls the wallet. This also renames 'CreateKeyManagerApi' -> 'BIP39CreateKeymanagerApi' as the bip39 password is needed when creating the KeyManager
* Add bip39 password to BIP39KeyManager.fromParams(), fix mdocs
* Fix bug in unit test were whe weren't specifying password
* Fix rebase issues
* This creates a subtype BIP39KeyManager and moves all existing KeyManager functionality to that subtype. We leave a empty 'KeyManager' trait for now
* Fix website docs
* Move initialization of wallet entropy into the key manager
* Enable key-manager in ci, add coverage minimum
* Add coverage minimum for key manager, add KeyManagerParams, start adding KeyManager test harness
* Remove success cases on ADTs, start using Either
* fix import
* Get test coverage to 90%
* Add documentation for key-manager.md, add side bar for key-manager
* Fix wallet.md
* Make seedPath default to baseDatadir, so we don't have a unique seed for every network. Add more documentation
* Address code review
* Address code review from Ben
* Add missing import
* Add more tests for coverage
* Segregate key manager from wallet
* More consistent naming in build.sbt, run scalafmt
* Add test case making sure we don't overwrite a mnemonic seed
* Add key-manager.md
* Fix compile issues with older scala versions
* Address code review
* Update scalafmt to 2.0.1
* Scalafmt
In this commit we
1) Reconfigure the .scalafmt.conf file
2) Add a scalafmt binary (same version as specified in conf file)
3) Use said binary on CI to check that everything is formatted correctly
* Ran scalafmt
* Update scalafmt ignore
* Add scalafmt plugin to project/plugins.sbt, run it
* run scalafmt
* Address issue #673, also refactor fixture stuff to be in companion objects rather than traits so they can be re-used without extending the trait itself. This allows for more modularity with our fixtures
* fix bugs in unit tests, address #675 to make MerkleBufferTests faster
* Refactor test timeout in UpdateBloomFitlerTest
* fix callback logic bug on matching unrelated txs/addresses in UpdateBloomFilterTest, re-order broadcasting of things to avoid async bugs hopefully
* Make a def in NodeUnitTest, this keeps tests in the same suite from using the same config. This allows us to write multiple tests per suite, instead of just one. This also adds implicit parameters to our fixture constructors/destructors to properly create and destroy this config. The long term goal here also should be getting rid of config.initialize() we are calling everywhere as this is a anti-pattern, fixtures should take care of construction and destruction of things
* Broadcast tx earlier in test case for UpdateBloomFilterTest
* Rework NodeWithWalletTest to use the new fixtures we have in the node project, now use SpvNodeFundedWalletBitcoind
* Add functionality for updating SPV node bloom filter
* Add SPV node shutdown to exit hook
* Clean up traits/case classes
* Change fixture in WalletBloomTest
* Fix logging bug in TransactionProcessing
* Add MerkleBuffers
In this commit we add MerkleBuffers, which is an object
that lets us aggreagate merkleblocks with their corresponding
transactions before sending them out. This is global, mutable
state (bad!) but it's a working solution for now;
* Use TestAsyncUtil
* Add MerkleBuffers test
* Send getdata if receiving single header
* Change awaitSync to use block count
* Fix UpdateBloomFilterTest
* Add more logging of chain/headers validation
* Send getdata for all blocks
* Nits: Scaladocs, comments toString
* Add logging to data directory
In this commit we add the ability for the node, chain
and wallet projects (+ the server) to log to the users
data directory instead of whatever directory the
binaries was launched from. This is inherently a bit
more complicated than our previous setup, because
we need to read the user directory before we can create
loggers. As a result of this, some files/methods were
moved around, so the relevant app config could be
found in scope.
We also introduce several logging categories that can be
tuned individually through user configuration. These logggers
are exposed both as traits that give a field `logger`, or
as methods that return the required logger.
* Add datadir configuration to AppConfig
In this commit we add support for AppConfig to pick up
the data directory configuration file. We also add
a section to the contributing guide on how to tune
logging levels.
* Pass data directories explicitly for configuration
In this commit we
1) Add the notion of address types in the wallet, and remove
the emphasis on account types. Users now just request
a segwit/nested-segwit/legacy address, and we take care
of querying for the correct account
2) Fix a bug where a wallet could only get addresses for
its default address type. This was a pretty minor bug,
where a few values that should have been dynamic was
hard coded.
* PoC bitcoin-s-cli
* Add CLI, Server sbt projects, remove Ammonite
In this commit we set up sbt configuration for
CLI, Server (in-work-name) and corresponding
test projects.
We also remove Ammonite shell from sbt, as that
isn't really being used. bloop console offers
the same functionality way more ergonimic.
* Move BitcoinSAppConfig into new server project
Server project depends on node, chain wand wallet
so this is a good time for introducing this class
into main sources. We also introduce
BitcoinSTestAppConfig in testkit, to replace the
functionality in BitcoinSAppConfig related to
tests.
* Type chain in blockchainresult
* MVP server setup for node, chain and wallet
* Extremely dirty CLI for interacting with server
* initial attempt at mimicking Bitcoin Core API
* WalletStorage: add method for checking for seed existance
* Check for seed existance on wallet startup
* Fix bug where MnemonicNotFound was not an error
* Segregate confirmed and unconfirmed balance methods
* Add error handling, improve formatting of CLI output
* Tweak build
Bump Sttp version, downgrade to uPickle 2.11 compat,
skip publish in cli-test and server-test
* Add CLI, server and picklers to root project
* Split wallet functionality into multiple traits
In this commit we refactor LockedWallet into multiple traits
that provide functionality related to a subset of total wallet
functionality. This has the benefit of making it clear which
methods are helper methods that are only intended to be used
in a very specific setting, and which methods are part of the
internal wallet API that other parts of the wallet can use.
* Rework TransactionOutput and TransactionOutPoint to case classes
* Add extension methods for flattening lists of assertions
* Segregate confirmed and unconfirmed balance methods
* Add test for FutureUtil.sequentially
* Add trace logging of balance fetching
* Process outgoing TXOs
Move TX processing into separate trait, add internal API method
Unify DB representation of TXOs
Prior to this commit we stored TXO information
across diferent tables, with joins and tuples
needed a bunch of places to keep track of
everything we needed. In this commit we unify
the tables, leaving us with only one table for
TXOs.