qortal/src/data/block/BlockData.java
catbref 90094be95a CIYAM-ATv2 can be used with any asset, not just QORA.
Some initial BTC cross-chain support. (Needs more work).

Unified timestamp for V2 switchover to block version 4,
applicable to several transaction types.

Qora-specific interface to CIYAM ATv2 library.

Beware: some areas still work-in-progress!
2018-12-03 13:05:38 +00:00

141 lines
3.2 KiB
Java

package data.block;
import java.math.BigDecimal;
import com.google.common.primitives.Bytes;
import java.io.Serializable;
public class BlockData implements Serializable {
private static final long serialVersionUID = -7678329659124664620L;
private byte[] signature;
private int version;
private byte[] reference;
private int transactionCount;
private BigDecimal totalFees;
private byte[] transactionsSignature;
private Integer height;
private long timestamp;
private BigDecimal generatingBalance;
private byte[] generatorPublicKey;
private byte[] generatorSignature;
private int atCount;
private BigDecimal atFees;
// necessary for JAX-RS serialization
@SuppressWarnings("unused")
private BlockData() {
}
public BlockData(int version, byte[] reference, int transactionCount, BigDecimal totalFees, byte[] transactionsSignature, Integer height, long timestamp,
BigDecimal generatingBalance, byte[] generatorPublicKey, byte[] generatorSignature, int atCount, BigDecimal atFees) {
this.version = version;
this.reference = reference;
this.transactionCount = transactionCount;
this.totalFees = totalFees;
this.transactionsSignature = transactionsSignature;
this.height = height;
this.timestamp = timestamp;
this.generatingBalance = generatingBalance;
this.generatorPublicKey = generatorPublicKey;
this.generatorSignature = generatorSignature;
this.atCount = atCount;
this.atFees = atFees;
if (this.generatorSignature != null && this.transactionsSignature != null)
this.signature = Bytes.concat(this.generatorSignature, this.transactionsSignature);
else
this.signature = null;
}
public byte[] getSignature() {
return this.signature;
}
public void setSignature(byte[] signature) {
this.signature = signature;
}
public int getVersion() {
return this.version;
}
public byte[] getReference() {
return this.reference;
}
public void setReference(byte[] reference) {
this.reference = reference;
}
public int getTransactionCount() {
return this.transactionCount;
}
public void setTransactionCount(int transactionCount) {
this.transactionCount = transactionCount;
}
public BigDecimal getTotalFees() {
return this.totalFees;
}
public void setTotalFees(BigDecimal totalFees) {
this.totalFees = totalFees;
}
public byte[] getTransactionsSignature() {
return this.transactionsSignature;
}
public void setTransactionsSignature(byte[] transactionsSignature) {
this.transactionsSignature = transactionsSignature;
}
public Integer getHeight() {
return this.height;
}
public void setHeight(Integer height) {
this.height = height;
}
public long getTimestamp() {
return this.timestamp;
}
public BigDecimal getGeneratingBalance() {
return this.generatingBalance;
}
public byte[] getGeneratorPublicKey() {
return this.generatorPublicKey;
}
public byte[] getGeneratorSignature() {
return this.generatorSignature;
}
public void setGeneratorSignature(byte[] generatorSignature) {
this.generatorSignature = generatorSignature;
}
public int getATCount() {
return this.atCount;
}
public void setATCount(int atCount) {
this.atCount = atCount;
}
public BigDecimal getATFees() {
return this.atFees;
}
public void setATFees(BigDecimal atFees) {
this.atFees = atFees;
}
}