mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-04 00:37:51 +00:00
Refactored to standard Maven layout: src/main/java src/main/resources src/test/java etc. New translation code that uses locale-specific ResourceBundles to load translations on demand. Reworked API error/exceptions code to a shorter, simpler @ApiErrors annotation. Processing of @ApiErrors annotations produces an example for each possible API error and includes API error string in HTTP response code, e.g. 400 INVALID_SIGNATURE Missing API error cases added to each API call. Translation of openAPI.json removed (for now). block-explorer.html and BIP39 wordlists now read as resources instead of direct from disk. Java compile warnings fixed. Some runtime warnings remain: WARNING: A provider api.resource.ApiDefinition registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. WARNING: A provider api.resource.AnnotationPostProcessor registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. WARN org.reflections.Reflections - given scan urls are empty. set urls in the configuration
74 lines
1.7 KiB
Java
74 lines
1.7 KiB
Java
package data.at;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
public class ATStateData {
|
|
|
|
// Properties
|
|
private String ATAddress;
|
|
private Integer height;
|
|
private Long creation;
|
|
private byte[] stateData;
|
|
private byte[] stateHash;
|
|
private BigDecimal fees;
|
|
|
|
// Constructors
|
|
|
|
/** Create new ATStateData */
|
|
public ATStateData(String ATAddress, Integer height, Long creation, byte[] stateData, byte[] stateHash, BigDecimal fees) {
|
|
this.ATAddress = ATAddress;
|
|
this.height = height;
|
|
this.creation = creation;
|
|
this.stateData = stateData;
|
|
this.stateHash = stateHash;
|
|
this.fees = fees;
|
|
}
|
|
|
|
/** For recreating per-block ATStateData from repository where not all info is needed */
|
|
public ATStateData(String ATAddress, int height, byte[] stateHash, BigDecimal fees) {
|
|
this(ATAddress, height, null, null, stateHash, fees);
|
|
}
|
|
|
|
/** For creating ATStateData from serialized bytes when we don't have all the info */
|
|
public ATStateData(String ATAddress, byte[] stateHash) {
|
|
this(ATAddress, null, null, null, stateHash, null);
|
|
}
|
|
|
|
/** For creating ATStateData from serialized bytes when we don't have all the info */
|
|
public ATStateData(String ATAddress, byte[] stateHash, BigDecimal fees) {
|
|
this(ATAddress, null, null, null, stateHash, fees);
|
|
}
|
|
|
|
// Getters / setters
|
|
|
|
public String getATAddress() {
|
|
return this.ATAddress;
|
|
}
|
|
|
|
public Integer getHeight() {
|
|
return this.height;
|
|
}
|
|
|
|
// Likely to be used when block received over network is attached to blockchain
|
|
public void setHeight(Integer height) {
|
|
this.height = height;
|
|
}
|
|
|
|
public Long getCreation() {
|
|
return this.creation;
|
|
}
|
|
|
|
public byte[] getStateData() {
|
|
return this.stateData;
|
|
}
|
|
|
|
public byte[] getStateHash() {
|
|
return this.stateHash;
|
|
}
|
|
|
|
public BigDecimal getFees() {
|
|
return this.fees;
|
|
}
|
|
|
|
}
|