mirror of
https://github.com/Qortal/qortal.git
synced 2025-04-24 20:07:50 +00:00
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...
40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
package repository;
|
|
|
|
import java.util.List;
|
|
|
|
import data.block.BlockData;
|
|
import data.block.BlockTransactionData;
|
|
import data.transaction.TransactionData;
|
|
|
|
public interface BlockRepository {
|
|
|
|
public BlockData fromSignature(byte[] signature) throws DataException;
|
|
|
|
public BlockData fromReference(byte[] reference) throws DataException;
|
|
|
|
public BlockData fromHeight(int height) throws DataException;
|
|
|
|
/**
|
|
* Return height of block in blockchain using block's signature.
|
|
*
|
|
* @param signature
|
|
* @return height, or 0 if not found in blockchain.
|
|
* @throws DataException
|
|
*/
|
|
public int getHeightFromSignature(byte[] signature) throws DataException;
|
|
|
|
/**
|
|
* Return highest block height from DB.
|
|
*
|
|
* @return height, or 0 if there are no blocks in DB (not very likely).
|
|
*/
|
|
public int getBlockchainHeight() throws DataException;
|
|
|
|
public List<TransactionData> getTransactionsFromSignature(byte[] signature) throws DataException;
|
|
|
|
public void save(BlockData blockData) throws DataException;
|
|
|
|
public void save(BlockTransactionData blockTransactionData) throws DataException;
|
|
|
|
}
|