using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SQLite.Net;
using SQLite.Net.Attributes;
using SQLite.Net.Interop;
using SQLite.Net.Platform.Generic;
using SQLiteNetExtensions.Attributes;
using System.Diagnostics.Contracts;
namespace Novacoin
{
///
/// Block headers table
///
public interface IBlockStorageItem
{
///
/// Item ID in the database
///
long ItemID { get; set; }
///
/// PBKDF2+Salsa20 of block hash
///
byte[] Hash { get; set; }
///
/// Version of block schema
///
uint nVersion { get; set; }
///
/// Previous block hash.
///
byte[] prevHash { get; set; }
///
/// Merkle root hash.
///
byte[] merkleRoot { get; set; }
///
/// Block timestamp.
///
uint nTime { get; set; }
///
/// Compressed difficulty representation.
///
uint nBits { get; set; }
///
/// Nonce counter.
///
uint nNonce { get; set; }
///
/// Next block hash.
///
byte[] nextHash { get; set; }
///
/// Block type flags
///
BlockType BlockTypeFlag { get; set; }
///
/// Stake modifier
///
long nStakeModifier { get; set; }
///
/// Proof-of-Stake hash
///
byte[] hashProofOfStake { get; set; }
///
/// Stake generation outpoint.
///
byte[] prevoutStake { get; set; }
///
/// Stake generation time.
///
uint nStakeTime { get; set; }
///
/// Block height
///
uint nHeight { get; set; }
///
/// Block position in file
///
byte[] BlockPos { get; set; }
///
/// Block size in bytes
///
byte[] BlockSize { get; set; }
};
public interface IMerkleNode
{
///
/// Node identifier
///
long nMerkleNodeID { get; set; }
///
/// Reference to parent block database item.
///
long nParentBlockID { get; set; }
///
/// Transaction type flag
///
TxFlags TransactionFlags { get; set; }
///
/// Transaction hash
///
byte[] TransactionHash { get; set; }
///
/// Transaction offset from the beginning of block header, encoded in VarInt format.
///
byte[] TxOffset { get; set; }
///
/// Transaction size, encoded in VarInt format.
///
byte[] TxSize { get; set; }
}
public interface ITxOutItem
{
///
/// Reference to transaction item.
///
long nMerkleNodeID { get; set; }
///
/// Output flags
///
OutputFlags outputFlags { get; set; }
///
/// Output number in VarInt format.
///
byte[] OutputNumber { get; set; }
///
/// Output value in VarInt format.
///
byte[] OutputValue { get; set; }
///
/// Second half of script which contains spending instructions.
///
byte[] scriptPubKey { get; set; }
///
/// Getter for output number.
///
uint nOut { get; }
///
/// Getter for output value.
///
ulong nValue { get; }
///
/// Getter ans setter for IsSpent flag.
///
bool IsSpent { get; set; }
}
}