Commit Graph

260 Commits

Author SHA1 Message Date
catbref
e5a32bb7e4
Merge pull request #4 from KaaCee/master
API
2018-09-28 12:32:53 +01:00
catbref
6fa874bc77 Modified Maven pom.xml to use HSQLDB jar in lib/ rather than from repo,
as it has bug fixes we need, applied since HSQLDB v2.4.1.

Modified Eclipse Java formatting settings for better enum layout.
2018-09-28 12:31:02 +01:00
Kc
646462942c ADDED: globalization.Translator - basic globalization support (implementation needed)
ADDED: api.Security (implementation needed)
ADDED: api.APIErrorFactory
CHANGED: added command execution to ApiClient
2018-09-24 00:21:47 +02:00
Kc
19a9a3a98b CHANGED: integrated Swagger/OpenApi
CHANGED: added method stubs and describing annotations to BlocksResource
2018-09-20 23:48:20 +02:00
Kc
d63ff02b97 CHANGED: added first API resources with jetty and jersey 2018-09-16 23:24:20 +02:00
Kc
9fb434cdd6 CHANGED: fixed ApiService 2018-09-02 10:35:13 +02:00
Kc
2fc74ac583 Added reference to Jersey for RESTful services.
Added Api package.
Added BlocksResource as first candidate for API implementation.
2018-08-30 07:01:28 +02:00
catbref
e56d8f5e02 HSQLDB issue, resource leak prevention, v1 differences
HSQLDB v2.4.0 had some issue with non-padded, case-insensitive string comparisons.
This is fixed in svn r5836-ish of HSQLDB but yet to be pushed out to new HSQLDB release.
So this commit includes hsqldb-r5836.jar and modified pom.xml/.classpath for now.

No need for duplicate, hidden creatorPublicKey in CancelOrderTransactionData,
CreateOrderTransactionData and CreatePollTransactionData.

Various changes to use more try-with-resources, especially with JDBC objects like
Connection, Statement, PreparedStatement, ResultSet.

Added loads of missing @Override annotations.

Fixed bug in Asset exchange order matching where the matching logic loop
would incorrectly adjust temporary amount fulfilled
by the "want" asset amount (in matchedAmount)
instead of the "have" asset amount (in tradePrice).

Disabled check for duplicate asset name in IssueAssetTransactions for old v1 transactions.

In HSQLDB repository we now use ResultSet.getTimestamp(index, UTC-calendar) to make sure we
only store/fetch UTC timestamps. The UTC-calendar is made using static final TimeZone called
HSQLDBRepository.UTC.

To keep asset IDs in line with v1, Assets.asset_id values are generated on-the-fly in HSQLDB
using a "before insert" trigger on Assets table. Corresponding code
calling HSQLDBRepository.callIdentity() replaced with SELECT statement instead.

Moved most of the HSQLDB connection properties from the connection URL to explicit code in
HSQLDBRepositoryFactory.

Fixed incorrect 'amount' lengths in PaymentTransformer, as used by MultiPayment and Arbitrary
transaction types.

Added support for mangled arbitrary transaction bytes when generating/verifying a v1 transaction signature.
In v1 Arbitrary transactions, bytes-for-signing are lost prior to final payment (but only if there are any payments).
Added corresponding code for multi-payment transactions in the same vein.
2018-08-07 15:44:41 +01:00
catbref
948bc95644 More work on transactions/blocks
Added Apache commons-net as maven dependency for NTP support.

Added SAVEPOINT and ROLLBACK TO SAVEPOINT support to DB class.
Added exists() test to DB class.

Add MessageTransactions, with V1/V3 code in one class instead of very similar code
split across two classes. Update DB schema to add version.

More fleshing out of Assets class.

Fleshing out Block class with parse(), generating balance and signature-related methods.

More javadoc. More tests.
2018-06-04 11:45:40 +01:00
catbref
a2b5fa140b Initial stab at migrating to HSQLDB for Qora gen2
Most SQL tables defined but only payment transactions actually implemented.
Maven support added.

Some code imported from 'old' Qora:

RIPEMD160 renamed as BrokenMD160 and deprecated.
whispersystem's Ed25519 implementation (to be replaced with bouncycastle).
Basic Account/PublicKeyAccount/PrivateKeyAccount code.
Some utils like Base58 and Pair.

To use:

Use maven to fetch dependencies.
Build project.
Fire up an old-gen Qora node.
Run src/test/update.java as a JUnit test to build DB structure.
Run src/test/migrate.java as a JUnit test to migrate old Qora blocks to DB.

You should now be able to run src/test/load.java and src/test/save.java
as JUnit tests demonstrating loading/saving Transactions from/to database.

This commit done while halfway through adding Block support!
2018-05-16 11:46:44 +01:00