qortal/src/repository/BlockRepository.java
catbref c5a32ffa1c Block/Transaction processing
* Add implementation for Account.getBalance(assetId, numberOfConfirmations)

* Added orphan() code to Block (CIYAM AT not yet supported)

* Added getOrder() 'navigation' method to CreateOrderTransaction

* Added missing transaction-type cases to various switches in Transaction, transformers, repositories, etc.

* Various repository delete() methods added

* Added save/delete support for transaction types that include payments, like multipayment and arbitrary

* Changed "recipient" in HSQLDB SharedTransactionPayments from QoraPublicKey to QoraAddress
2018-06-19 09:50:58 +01:00

52 lines
1.4 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 repository.
*
* @return height, or 0 if there are no blocks in DB (not very likely).
*/
public int getBlockchainHeight() throws DataException;
/**
* Return highest block in blockchain.
*
* @return highest block's data
* @throws DataException
*/
public BlockData getLastBlock() throws DataException;
public List<TransactionData> getTransactionsFromSignature(byte[] signature) throws DataException;
public void save(BlockData blockData) throws DataException;
public void delete(BlockData blockData) throws DataException;
public void save(BlockTransactionData blockTransactionData) throws DataException;
public void delete(BlockTransactionData blockTransactionData) throws DataException;
}