13 Commits

Author SHA1 Message Date
catbref
f2d7a3d0cd Converted Message Transactions 2018-06-13 15:40:58 +01:00
catbref
16a92305d2 Conversion of Payment Transactions
+ some fixes spotted en route
2018-06-13 15:01:26 +01:00
catbref
a0824b21d4 Converted most of CreateOrderTransaction
Some tidying up of other transaction-related repositories and transformers.
2018-06-13 14:29:15 +01:00
catbref
519331f823 Work on Assets conversion
* Added AssetData transfer object
* Added IssueAssetTransactionData transfer object

* Reworked qora.assets.Asset into business layer object
* Reworked qora.transaction.IssueAssetTransaction into business layer object

* Added corresponding AssetRepository and support in TransactionRepository et al

* Fixed BlockChain in line with asset changes

* Some renaming inside GenesisTransaction to reflect use of transfer object, not business object

* Business transaction objects now take Repository param

* Moved HSQLDB transaction repositories into a sub-package
* Changed HSQLDBSaver.execute(Connection connection) to .execute(Repository repository) to fix visibility issues
and allow repository more control in the future if need be

* Changed from "return null" statements in HSQLDB repositories to throw DataException when an error occurs.
Better to throw than to silently return null?

* Added static version of PublicKeyAccount.verify() for when a repository-backed PublicKeyAccount is not needed

* Fixed getter/setter code template incorrectly producing "this.this.field = param"
2018-06-13 11:46:33 +01:00
catbref
698c4b6cc9 More repository work
Moved more repository-like methods from qora.* classes to repository.

Removed qora.block.BlockTransaction as it's pretty much internal to the HSQLDB repository.

Fixing qora.account.*

Fixing genesis-related classes: block, account, transaction...
2018-06-12 14:54:06 +01:00
catbref
37d9bcbb53 Repository work
Rolled BlockTransactionRepository into BlockRepository.

Added AccountRepository for general account info and account balances.

BlockTransformer now takes Block as param instead of BlockData as it needs Block's transactions.
2018-06-12 12:15:38 +01:00
catbref
d45c33fe90 More work on repository
No need for database.DB class as the code is specific to HSQLDB so moved into relevant repository.hsqldb classes.

Top-level Repository instance (e.g. HSQLDBRepository) is used within subclasses, e.g. HSQLDBBlockRepository, so they
can share the same repository state, like underlying SQL Connection for easier transactional support.

HSQLDBRepository subclasses now call checkedExecute() on top-level repository instance, instead of passing Connection
to obsolete DB.checkedExecute.

No need for qora.block.BlockFactory any more as those methods are now in repository.

More work on Blocks and Transactions in general.
2018-06-12 10:21:03 +01:00
catbref
8220113613 WORK IN PROGRESS
Still converting to repository layout.
This commit is just in case my dev computer blows up and also for interim code review.

Removed data.block.BlockData as an interface (with data.block.Block as implementation) for now.
2018-06-11 12:09:16 +01:00
Kc
0f16b1588c more refactoring 2018-06-09 00:29:21 +02:00
Kc
749baf8843 *** NOT FINAL, NOT TESTED ***
added data access class for block
added HSQLDB repository with reader methods for block data
started usage of repository and data objects in BlockFactory
2018-06-08 21:31:31 +02:00
catbref
3d78d5dad9 More refactoring - DOES NOT COMPILE
qora.* packages are business logic/handler/processing
data.* packages are "value objects" or are they "business objects"?

toBytes(), fromBytes() (which used to be called parse()) and toJSON() moved to transform.* packages

new issues:

Lost control of SQL Transactions. Previously, some class "knew" whether to call COMMIT or not.
e.g. simply saving a payment transaction would involve updating Transactions table first, then the PaymentTransactions table after (to satisfy foreign key constraints) then commit.
Processing a block would involve a new transaction, a savepoint, a rollback and then maybe a further commit or rollback.
Not sure how this is going to work with the repository, especially if business logic isn't supposed to be aware of such things.

Growing number of stupid try-catch blocks. Probably best to ditch TransformationException (was ParseException) and throw IllegalStateExceptions instead as they're "unchecked".

What happens if the repository fails to save() to the database? It can't throw SQLException any more as that has no meaning outside the repository. Ditto with delete().
2018-06-08 17:40:27 +01:00
catbref
a0345412e8 first stab at repository interfaces and hsqldb implementations 2018-06-07 09:15:54 +01:00
catbref
2ea6f12b3c First stub files for conversion to data access layer, etc. 2018-06-06 21:16:50 +01:00