interim commit after refactoring TransactionData, and subclasses

This commit is contained in:
catbref 2019-06-01 15:13:12 +01:00
parent da1bd82c19
commit 431e15c7ae
37 changed files with 239 additions and 599 deletions

View File

@ -7,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.account.GenesisAccount; import org.qora.account.GenesisAccount;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -36,10 +35,10 @@ public class ATTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public ATTransactionData(long timestamp, int txGroupId, byte[] reference, String atAddress, String recipient, BigDecimal amount, Long assetId, public ATTransactionData(BaseTransactionData baseTransactionData, String atAddress, String recipient, BigDecimal amount, Long assetId, byte[] message) {
byte[] message, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.AT, baseTransactionData);
super(TransactionType.AT, timestamp, txGroupId, reference, GenesisAccount.PUBLIC_KEY, fee, approvalStatus, height, signature);
this.creatorPublicKey = GenesisAccount.PUBLIC_KEY;
this.atAddress = atAddress; this.atAddress = atAddress;
this.recipient = recipient; this.recipient = recipient;
this.amount = amount; this.amount = amount;
@ -47,14 +46,6 @@ public class ATTransactionData extends TransactionData {
this.message = message; this.message = message;
} }
// Never from network/API!
/** New, unsigned */
public ATTransactionData(long timestamp, int txGroupId, byte[] reference, String atAddress, String recipient, BigDecimal amount, Long assetId,
byte[] message, BigDecimal fee) {
this(timestamp, txGroupId, reference, atAddress, recipient, amount, assetId, message, fee, null, null, null);
}
// Getters/Setters // Getters/Setters
public String getATAddress() { public String getATAddress() {

View File

@ -1,7 +1,5 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -10,7 +8,6 @@ import javax.xml.bind.annotation.XmlElement;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.account.GenesisAccount; import org.qora.account.GenesisAccount;
import org.qora.block.GenesisBlock; import org.qora.block.GenesisBlock;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -46,9 +43,9 @@ public class AccountFlagsTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public AccountFlagsTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, String target, int andMask, int orMask, public AccountFlagsTransactionData(BaseTransactionData baseTransactionData,
int xorMask, Integer previousFlags, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { String target, int andMask, int orMask, int xorMask, Integer previousFlags) {
super(TransactionType.ACCOUNT_FLAGS, timestamp, groupId, reference, creatorPublicKey, fee, approvalStatus, height, signature); super(TransactionType.ACCOUNT_FLAGS, baseTransactionData);
this.target = target; this.target = target;
this.andMask = andMask; this.andMask = andMask;
@ -58,15 +55,9 @@ public class AccountFlagsTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public AccountFlagsTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, String target, int andMask, int orMask, public AccountFlagsTransactionData(BaseTransactionData baseTransactionData,
int xorMask, BigDecimal fee, byte[] signature) { String target, int andMask, int orMask, int xorMask) {
this(timestamp, groupId, reference, creatorPublicKey, target, andMask, orMask, xorMask, null, fee, null, null, signature); this(baseTransactionData, target, andMask, orMask, xorMask, null);
}
/** New, unsigned */
public AccountFlagsTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, String target, int andMask, int orMask,
int xorMask, BigDecimal fee) {
this(timestamp, groupId, reference, creatorPublicKey, target, andMask, orMask, xorMask, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -40,25 +37,14 @@ public class AddGroupAdminTransactionData extends TransactionData {
this.creatorPublicKey = this.ownerPublicKey; this.creatorPublicKey = this.ownerPublicKey;
} }
/** From repository */ public AddGroupAdminTransactionData(BaseTransactionData baseTransactionData, int groupId, String member) {
public AddGroupAdminTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, String member, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.ADD_GROUP_ADMIN, baseTransactionData);
super(TransactionType.ADD_GROUP_ADMIN, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature);
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.member = member; this.member = member;
} }
/** From network/API */
public AddGroupAdminTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, String member, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, ownerPublicKey, groupId, member, fee, null, null, signature);
}
/** New, unsigned */
public AddGroupAdminTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, String member, BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, groupId, member, fee, null);
}
// Getters / setters // Getters / setters
public byte[] getOwnerPublicKey() { public byte[] getOwnerPublicKey() {

View File

@ -1,6 +1,5 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
@ -9,7 +8,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.data.PaymentData; import org.qora.data.PaymentData;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -53,12 +51,12 @@ public class ArbitraryTransactionData extends TransactionData {
this.creatorPublicKey = this.senderPublicKey; this.creatorPublicKey = this.senderPublicKey;
} }
/** From repository */ /** V3 */
public ArbitraryTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, int service, public ArbitraryTransactionData(BaseTransactionData baseTransactionData,
byte[] data, DataType dataType, List<PaymentData> payments, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { int version, int service, byte[] data, DataType dataType, List<PaymentData> payments) {
super(TransactionType.ARBITRARY, timestamp, txGroupId, reference, senderPublicKey, fee, approvalStatus, height, signature); super(TransactionType.ARBITRARY, baseTransactionData);
this.senderPublicKey = senderPublicKey; this.senderPublicKey = baseTransactionData.creatorPublicKey;
this.version = version; this.version = version;
this.service = service; this.service = service;
this.data = data; this.data = data;
@ -66,28 +64,10 @@ public class ArbitraryTransactionData extends TransactionData {
this.payments = payments; this.payments = payments;
} }
/** From network/API (V3) */ /** V1 */
public ArbitraryTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, int service, public ArbitraryTransactionData(BaseTransactionData baseTransactionData,
byte[] data, DataType dataType, List<PaymentData> payments, BigDecimal fee, byte[] signature) { int version, int service, byte[] data, DataType dataType) {
this(timestamp, txGroupId, reference, senderPublicKey, version, service, data, dataType, payments, fee, null, null, signature); this(baseTransactionData, version, service, data, dataType, null);
}
/** From network/API (V1) */
public ArbitraryTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, int service, byte[] data,
DataType dataType, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, senderPublicKey, version, service, data, dataType, null, fee, null, null, signature);
}
/** New, unsigned (V3) */
public ArbitraryTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, int service, byte[] data,
DataType dataType, List<PaymentData> payments, BigDecimal fee) {
this(timestamp, txGroupId, reference, senderPublicKey, version, service, data, dataType, payments, fee, null);
}
/** New, unsigned (V1) */
public ArbitraryTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, int service, byte[] data,
DataType dataType, BigDecimal fee) {
this(timestamp, txGroupId, reference, senderPublicKey, version, service, data, dataType, null, fee, null);
} }
// Getters/Setters // Getters/Setters

View File

@ -0,0 +1,28 @@
package org.qora.data.transaction;
import java.math.BigDecimal;
import org.qora.transaction.Transaction.ApprovalStatus;
public class BaseTransactionData extends TransactionData {
/** Constructor for use by repository. */
public BaseTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, BigDecimal fee,
ApprovalStatus approvalStatus, Integer blockHeight, Integer approvalHeight, byte[] signature) {
this.timestamp = timestamp;
this.txGroupId = txGroupId;
this.reference = reference;
this.creatorPublicKey = creatorPublicKey;
this.fee = fee;
this.approvalStatus = approvalStatus;
this.blockHeight = blockHeight;
this.approvalHeight = approvalHeight;
this.signature = signature;
}
/** Constructor for use by transaction transformer. */
public BaseTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, creatorPublicKey, fee, null, null, null, signature);
}
}

View File

@ -8,7 +8,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -31,6 +30,7 @@ public class BuyNameTransactionData extends TransactionData {
private BigDecimal amount; private BigDecimal amount;
@Schema(description = "seller's address", example = "QgV4s3xnzLhVBEJxcYui4u4q11yhUHsd9v") @Schema(description = "seller's address", example = "QgV4s3xnzLhVBEJxcYui4u4q11yhUHsd9v")
private String seller; private String seller;
// For internal use when orphaning // For internal use when orphaning
@XmlTransient @XmlTransient
@Schema(hidden = true) @Schema(hidden = true)
@ -48,11 +48,11 @@ public class BuyNameTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public BuyNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] buyerPublicKey, String name, BigDecimal amount, String seller, public BuyNameTransactionData(BaseTransactionData baseTransactionData,
byte[] nameReference, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { String name, BigDecimal amount, String seller, byte[] nameReference) {
super(TransactionType.BUY_NAME, timestamp, txGroupId, reference, buyerPublicKey, fee, approvalStatus, height, signature); super(TransactionType.BUY_NAME, baseTransactionData);
this.buyerPublicKey = buyerPublicKey; this.buyerPublicKey = baseTransactionData.creatorPublicKey;
this.name = name; this.name = name;
this.amount = amount; this.amount = amount;
this.seller = seller; this.seller = seller;
@ -60,14 +60,8 @@ public class BuyNameTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public BuyNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] buyerPublicKey, String name, BigDecimal amount, String seller, public BuyNameTransactionData(BaseTransactionData baseTransactionData, String name, BigDecimal amount, String seller) {
BigDecimal fee, byte[] signature) { this(baseTransactionData, name, amount, seller, null);
this(timestamp, txGroupId, reference, buyerPublicKey, name, amount, seller, null, fee, null, null, signature);
}
/** New, unsigned */
public BuyNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] buyerPublicKey, String name, BigDecimal amount, String seller, BigDecimal fee) {
this(timestamp, txGroupId, reference, buyerPublicKey, name, amount, seller, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import org.qora.transaction.Transaction; import org.qora.transaction.Transaction;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -28,23 +25,12 @@ public class CancelAssetOrderTransactionData extends TransactionData {
super(TransactionType.CANCEL_ASSET_ORDER); super(TransactionType.CANCEL_ASSET_ORDER);
} }
/** From network/API */ public CancelAssetOrderTransactionData(BaseTransactionData baseTransactionData, byte[] orderId) {
public CancelAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, byte[] orderId, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(Transaction.TransactionType.CANCEL_ASSET_ORDER, baseTransactionData);
super(Transaction.TransactionType.CANCEL_ASSET_ORDER, timestamp, txGroupId, reference, creatorPublicKey, fee, approvalStatus, height, signature);
this.orderId = orderId; this.orderId = orderId;
} }
/** From network/API */
public CancelAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, byte[] orderId, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, creatorPublicKey, orderId, fee, null, null, signature);
}
/** New, unsigned */
public CancelAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, byte[] orderId, BigDecimal fee) {
this(timestamp, txGroupId, reference, creatorPublicKey, orderId, fee, null);
}
// Getters/Setters // Getters/Setters
public byte[] getOrderId() { public byte[] getOrderId() {

View File

@ -1,13 +1,11 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -42,24 +40,18 @@ public class CancelGroupBanTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public CancelGroupBanTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, byte[] banReference, public CancelGroupBanTransactionData(BaseTransactionData baseTransactionData, int groupId, String member, byte[] banReference) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.CANCEL_GROUP_BAN, baseTransactionData);
super(TransactionType.CANCEL_GROUP_BAN, timestamp, txGroupId, reference, adminPublicKey, fee, approvalStatus, height, signature);
this.adminPublicKey = adminPublicKey; this.adminPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.member = member; this.member = member;
this.banReference = banReference; this.banReference = banReference;
} }
/** From network/API */ /** From network/API */
public CancelGroupBanTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, BigDecimal fee, byte[] signature) { public CancelGroupBanTransactionData(BaseTransactionData baseTransactionData, int groupId, String member) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, member, null, fee, null, null, signature); this(baseTransactionData, groupId, member, null);
}
/** New, unsigned */
public CancelGroupBanTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, BigDecimal fee) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, member, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -42,24 +39,18 @@ public class CancelGroupInviteTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public CancelGroupInviteTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String invitee, byte[] inviteReference, public CancelGroupInviteTransactionData(BaseTransactionData baseTransactionData, int groupId, String invitee, byte[] inviteReference) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.CANCEL_GROUP_INVITE, baseTransactionData);
super(TransactionType.CANCEL_GROUP_INVITE, timestamp, txGroupId, reference, adminPublicKey, fee, approvalStatus, height, signature);
this.adminPublicKey = adminPublicKey; this.adminPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.invitee = invitee; this.invitee = invitee;
this.inviteReference = inviteReference; this.inviteReference = inviteReference;
} }
/** From network/API */ /** From network/API */
public CancelGroupInviteTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String invitee, BigDecimal fee, byte[] signature) { public CancelGroupInviteTransactionData(BaseTransactionData baseTransactionData, int groupId, String invitee) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, invitee, null, fee, null, null, signature); this(baseTransactionData, groupId, invitee, null);
}
/** New, unsigned */
public CancelGroupInviteTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String invitee, BigDecimal fee) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, invitee, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,12 +1,9 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -33,25 +30,13 @@ public class CancelSellNameTransactionData extends TransactionData {
this.creatorPublicKey = this.ownerPublicKey; this.creatorPublicKey = this.ownerPublicKey;
} }
/** From repository */ public CancelSellNameTransactionData(BaseTransactionData baseTransactionData, String name) {
public CancelSellNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String name, super(TransactionType.CANCEL_SELL_NAME, baseTransactionData);
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) {
super(TransactionType.CANCEL_SELL_NAME, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature);
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.name = name; this.name = name;
} }
/** From network/API */
public CancelSellNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String name, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, ownerPublicKey, name, fee, null, null, signature);
}
/** New, unsigned */
public CancelSellNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String name, BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, name, fee, null);
}
// Getters / setters // Getters / setters
public byte[] getOwnerPublicKey() { public byte[] getOwnerPublicKey() {

View File

@ -8,7 +8,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import org.qora.block.BlockChain; import org.qora.block.BlockChain;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -80,9 +79,9 @@ public class CreateAssetOrderTransactionData extends TransactionData {
} }
/** Constructs using data from repository, including optional asset names. */ /** Constructs using data from repository, including optional asset names. */
public CreateAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, long haveAssetId, long wantAssetId, public CreateAssetOrderTransactionData(BaseTransactionData baseTransactionData,
BigDecimal amount, BigDecimal price, BigDecimal fee, String haveAssetName, String wantAssetName, ApprovalStatus approvalStatus, Integer height, byte[] signature) { long haveAssetId, long wantAssetId, BigDecimal amount, BigDecimal price, String haveAssetName, String wantAssetName) {
super(TransactionType.CREATE_ASSET_ORDER, timestamp, txGroupId, reference, creatorPublicKey, fee, approvalStatus, height, signature); super(TransactionType.CREATE_ASSET_ORDER, baseTransactionData);
this.haveAssetId = haveAssetId; this.haveAssetId = haveAssetId;
this.wantAssetId = wantAssetId; this.wantAssetId = wantAssetId;
@ -93,22 +92,9 @@ public class CreateAssetOrderTransactionData extends TransactionData {
this.wantAssetName = wantAssetName; this.wantAssetName = wantAssetName;
} }
/** Constructs using data from repository, excluding optional asset names. */ /** Constructor excluding optional asset names. */
public CreateAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, long haveAssetId, long wantAssetId, public CreateAssetOrderTransactionData(BaseTransactionData baseTransactionData, long haveAssetId, long wantAssetId, BigDecimal amount, BigDecimal price) {
BigDecimal amount, BigDecimal price, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { this(baseTransactionData, haveAssetId, wantAssetId, amount, price, null, null);
this(timestamp, txGroupId, reference, creatorPublicKey, haveAssetId, wantAssetId, amount, price, fee, null, null, approvalStatus, height, signature);
}
/** From network/API */
public CreateAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, long haveAssetId, long wantAssetId,
BigDecimal amount, BigDecimal price, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, creatorPublicKey, haveAssetId, wantAssetId, amount, price, fee, null, null, signature);
}
/** New, unsigned */
public CreateAssetOrderTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, long haveAssetId, long wantAssetId,
BigDecimal amount, BigDecimal price, BigDecimal fee) {
this(timestamp, txGroupId, reference, creatorPublicKey, haveAssetId, wantAssetId, amount, price, fee, null);
} }
// Getters/Setters // Getters/Setters

View File

@ -1,14 +1,11 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.group.Group.ApprovalThreshold; import org.qora.group.Group.ApprovalThreshold;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -69,12 +66,11 @@ public class CreateGroupTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public CreateGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String owner, String groupName, String description, public CreateGroupTransactionData(BaseTransactionData baseTransactionData,
boolean isOpen, ApprovalThreshold approvalThreshold, int minimumBlockDelay, int maximumBlockDelay, Integer groupId, String owner, String groupName, String description, boolean isOpen,
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { ApprovalThreshold approvalThreshold, int minimumBlockDelay, int maximumBlockDelay, Integer groupId) {
super(TransactionType.CREATE_GROUP, timestamp, txGroupId, reference, creatorPublicKey, fee, approvalStatus, height, signature); super(TransactionType.CREATE_GROUP, baseTransactionData);
this.creatorPublicKey = creatorPublicKey;
this.owner = owner; this.owner = owner;
this.groupName = groupName; this.groupName = groupName;
this.description = description; this.description = description;
@ -86,15 +82,10 @@ public class CreateGroupTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public CreateGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String owner, String groupName, String description, public CreateGroupTransactionData(BaseTransactionData baseTransactionData,
boolean isOpen, ApprovalThreshold approvalThreshold, int minimumBlockDelay, int maximumBlockDelay, BigDecimal fee, byte[] signature) { String owner, String groupName, String description, boolean isOpen,
this(timestamp, txGroupId, reference, creatorPublicKey, owner, groupName, description, isOpen, approvalThreshold, minimumBlockDelay, maximumBlockDelay, null, fee, null, null, signature); ApprovalThreshold approvalThreshold, int minimumBlockDelay, int maximumBlockDelay) {
} this(baseTransactionData, owner, groupName, description, isOpen, approvalThreshold, minimumBlockDelay, maximumBlockDelay, null);
/** New, unsigned */
public CreateGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String owner, String groupName, String description,
boolean isOpen, ApprovalThreshold approvalThreshold, int minimumBlockDelay, int maximumBlockDelay, BigDecimal fee) {
this(timestamp, txGroupId, reference, creatorPublicKey, owner, groupName, description, isOpen, approvalThreshold, minimumBlockDelay, maximumBlockDelay, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,6 +1,5 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
@ -8,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.data.voting.PollOptionData; import org.qora.data.voting.PollOptionData;
import org.qora.transaction.Transaction; import org.qora.transaction.Transaction;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -31,11 +29,9 @@ public class CreatePollTransactionData extends TransactionData {
super(TransactionType.CREATE_POLL); super(TransactionType.CREATE_POLL);
} }
/** From repository */ public CreatePollTransactionData(BaseTransactionData baseTransactionData,
public CreatePollTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String owner, String owner, String pollName, String description, List<PollOptionData> pollOptions) {
String pollName, String description, List<PollOptionData> pollOptions, super(Transaction.TransactionType.CREATE_POLL, baseTransactionData);
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) {
super(Transaction.TransactionType.CREATE_POLL, timestamp, txGroupId, reference, creatorPublicKey, fee, approvalStatus, height, signature);
this.owner = owner; this.owner = owner;
this.pollName = pollName; this.pollName = pollName;
@ -43,18 +39,6 @@ public class CreatePollTransactionData extends TransactionData {
this.pollOptions = pollOptions; this.pollOptions = pollOptions;
} }
/** From network/API */
public CreatePollTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String owner,
String pollName, String description, List<PollOptionData> pollOptions, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, creatorPublicKey, owner, pollName, description, pollOptions, fee, null, null, signature);
}
/** New, unsigned */
public CreatePollTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String owner,
String pollName, String description, List<PollOptionData> pollOptions, BigDecimal fee) {
this(timestamp, txGroupId, reference, creatorPublicKey, owner, pollName, description, pollOptions, fee, null);
}
// Getters/setters // Getters/setters
public String getOwner() { public String getOwner() {

View File

@ -5,7 +5,6 @@ import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -32,10 +31,9 @@ public class DeployAtTransactionData extends TransactionData {
super(TransactionType.DEPLOY_AT); super(TransactionType.DEPLOY_AT);
} }
/** From repository */ public DeployAtTransactionData(BaseTransactionData baseTransactionData,
public DeployAtTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String aTAddress, String name, String description, String aTAddress, String name, String description, String aTType, String tags, byte[] creationBytes, BigDecimal amount, long assetId) {
String aTType, String tags, byte[] creationBytes, BigDecimal amount, long assetId, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.DEPLOY_AT, baseTransactionData);
super(TransactionType.DEPLOY_AT, timestamp, txGroupId, reference, creatorPublicKey, fee, approvalStatus, height, signature);
this.aTAddress = aTAddress; this.aTAddress = aTAddress;
this.name = name; this.name = name;
@ -47,18 +45,6 @@ public class DeployAtTransactionData extends TransactionData {
this.assetId = assetId; this.assetId = assetId;
} }
/** From network/API */
public DeployAtTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String name, String description,
String aTType, String tags, byte[] creationBytes, BigDecimal amount, long assetId, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, creatorPublicKey, null, name, description, aTType, tags, creationBytes, amount, assetId, fee, null, null, signature);
}
/** New, unsigned */
public DeployAtTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, String name, String description,
String aTType, String tags, byte[] creationBytes, BigDecimal amount, long assetId, BigDecimal fee) {
this(timestamp, txGroupId, reference, creatorPublicKey, name, description, aTType, tags, creationBytes, amount, assetId, fee, null);
}
// Getters/Setters // Getters/Setters
public String getName() { public String getName() {

View File

@ -1,12 +1,9 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -25,24 +22,12 @@ public class EnableForgingTransactionData extends TransactionData {
super(TransactionType.ENABLE_FORGING); super(TransactionType.ENABLE_FORGING);
} }
/** From repository */ public EnableForgingTransactionData(BaseTransactionData baseTransactionData, String target) {
public EnableForgingTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, String target, super(TransactionType.ENABLE_FORGING, baseTransactionData);
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) {
super(TransactionType.ENABLE_FORGING, timestamp, groupId, reference, creatorPublicKey, fee, approvalStatus, height, signature);
this.target = target; this.target = target;
} }
/** From network/API */
public EnableForgingTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, String target, BigDecimal fee, byte[] signature) {
this(timestamp, groupId, reference, creatorPublicKey, target, fee, null, null, signature);
}
/** New, unsigned */
public EnableForgingTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, String target, BigDecimal fee) {
this(timestamp, groupId, reference, creatorPublicKey, target, fee, null);
}
// Getters / setters // Getters / setters
public String getTarget() { public String getTarget() {

View File

@ -6,10 +6,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.account.GenesisAccount;
import org.qora.asset.Asset; import org.qora.asset.Asset;
import org.qora.group.Group;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -38,9 +35,10 @@ public class GenesisTransactionData extends TransactionData {
} }
/** From repository (V2) */ /** From repository (V2) */
public GenesisTransactionData(long timestamp, String recipient, BigDecimal amount, long assetId, byte[] signature) { public GenesisTransactionData(BaseTransactionData baseTransactionData, String recipient, BigDecimal amount, long assetId) {
// No groupID, null reference, zero fee, no approval required, height always 1 // No groupID, null reference, zero fee, no approval required, height always 1
super(TransactionType.GENESIS, timestamp, Group.NO_GROUP, null, GenesisAccount.PUBLIC_KEY, BigDecimal.ZERO, ApprovalStatus.NOT_REQUIRED, 1, signature); // super(TransactionType.GENESIS, timestamp, Group.NO_GROUP, null, GenesisAccount.PUBLIC_KEY, BigDecimal.ZERO, ApprovalStatus.NOT_REQUIRED, 1, signature);
super(TransactionType.GENESIS, baseTransactionData);
this.recipient = recipient; this.recipient = recipient;
this.amount = amount; this.amount = amount;
@ -48,20 +46,8 @@ public class GenesisTransactionData extends TransactionData {
} }
/** From repository (V1, where asset locked to QORA) */ /** From repository (V1, where asset locked to QORA) */
public GenesisTransactionData(long timestamp, String recipient, BigDecimal amount, byte[] signature) { public GenesisTransactionData(BaseTransactionData baseTransactionData, String recipient, BigDecimal amount) {
this(timestamp, recipient, amount, Asset.QORA, signature); this(baseTransactionData, recipient, amount, Asset.QORA);
}
// Never from network/API!
/** New, unsigned (V2) */
public GenesisTransactionData(long timestamp, String recipient, BigDecimal amount, long assetId) {
this(timestamp, recipient, amount, assetId, null);
}
/** New, unsigned (V1) */
public GenesisTransactionData(long timestamp, String recipient, BigDecimal amount) {
this(timestamp, recipient, amount, Asset.QORA, null);
} }
// Getters/Setters // Getters/Setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -57,26 +54,18 @@ public class GroupApprovalTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public GroupApprovalTransactionData(long timestamp, int groupId, byte[] reference, byte[] adminPublicKey, byte[] pendingSignature, boolean approval, public GroupApprovalTransactionData(BaseTransactionData baseTransactionData, byte[] pendingSignature, boolean approval, byte[] priorReference) {
byte[] priorReference, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.GROUP_APPROVAL, baseTransactionData);
super(TransactionType.GROUP_APPROVAL, timestamp, groupId, reference, adminPublicKey, fee, approvalStatus, height, signature);
this.adminPublicKey = adminPublicKey; this.adminPublicKey = baseTransactionData.creatorPublicKey;
this.pendingSignature = pendingSignature; this.pendingSignature = pendingSignature;
this.approval = approval; this.approval = approval;
this.priorReference = priorReference; this.priorReference = priorReference;
} }
/** From network/API */ /** From network/API */
public GroupApprovalTransactionData(long timestamp, int groupId, byte[] reference, byte[] adminPublicKey, byte[] pendingSignature, boolean approval, public GroupApprovalTransactionData(BaseTransactionData baseTransactionData, byte[] pendingSignature, boolean approval) {
BigDecimal fee, byte[] signature) { this(baseTransactionData, pendingSignature, approval, null);
this(timestamp, groupId, reference, adminPublicKey, pendingSignature, approval, null, fee, null, null, signature);
}
/** New, unsigned */
public GroupApprovalTransactionData(long timestamp, int groupId, byte[] reference, byte[] adminPublicKey, byte[] pendingSignature, boolean approval,
BigDecimal fee) {
this(timestamp, groupId, reference, adminPublicKey, pendingSignature, approval, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -77,12 +74,12 @@ public class GroupBanTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public GroupBanTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, public GroupBanTransactionData(BaseTransactionData baseTransactionData,
String reason, int timeToLive, byte[] memberReference, byte[] adminReference, byte[] joinInviteReference, Integer previousGroupId, int groupId, String member, String reason, int timeToLive,
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { byte[] memberReference, byte[] adminReference, byte[] joinInviteReference, Integer previousGroupId) {
super(TransactionType.GROUP_BAN, timestamp, txGroupId, reference, adminPublicKey, fee, approvalStatus, height, signature); super(TransactionType.GROUP_BAN, baseTransactionData);
this.adminPublicKey = adminPublicKey; this.adminPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.offender = member; this.offender = member;
this.reason = reason; this.reason = reason;
@ -94,15 +91,8 @@ public class GroupBanTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public GroupBanTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String offender, String reason, public GroupBanTransactionData(BaseTransactionData baseTransactionData, int groupId, String member, String reason, int timeToLive) {
int timeToLive, BigDecimal fee, byte[] signature) { this(baseTransactionData, groupId, member, reason, timeToLive, null, null, null, null);
this(timestamp, txGroupId, reference, adminPublicKey, groupId, offender, reason, timeToLive, null, null, null, null, fee, null, null, signature);
}
/** New, unsigned */
public GroupBanTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String offender, String reason,
int timeToLive, BigDecimal fee) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, offender, reason, timeToLive, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,14 +1,11 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -52,11 +49,11 @@ public class GroupInviteTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public GroupInviteTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String invitee, int timeToLive, byte[] joinReference, Integer previousGroupId, public GroupInviteTransactionData(BaseTransactionData baseTransactionData,
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { int groupId, String invitee, int timeToLive, byte[] joinReference, Integer previousGroupId) {
super(TransactionType.GROUP_INVITE, timestamp, txGroupId, reference, adminPublicKey, fee, approvalStatus, height, signature); super(TransactionType.GROUP_INVITE, baseTransactionData);
this.adminPublicKey = adminPublicKey; this.adminPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.invitee = invitee; this.invitee = invitee;
this.timeToLive = timeToLive; this.timeToLive = timeToLive;
@ -65,13 +62,8 @@ public class GroupInviteTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public GroupInviteTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String invitee, int timeToLive, BigDecimal fee, byte[] signature) { public GroupInviteTransactionData(BaseTransactionData baseTransactionData, int groupId, String invitee, int timeToLive) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, invitee, timeToLive, null, null, fee, null, null, signature); this(baseTransactionData, groupId, invitee, timeToLive, null, null);
}
/** New, unsigned */
public GroupInviteTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String invitee, int timeToLive, BigDecimal fee) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, invitee, timeToLive, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -74,12 +71,11 @@ public class GroupKickTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public GroupKickTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, public GroupKickTransactionData(BaseTransactionData baseTransactionData,
String reason, byte[] memberReference, byte[] adminReference, byte[] joinReference, Integer previousGroupId, int groupId, String member, String reason, byte[] memberReference, byte[] adminReference, byte[] joinReference, Integer previousGroupId) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.GROUP_KICK, baseTransactionData);
super(TransactionType.GROUP_KICK, timestamp, txGroupId, reference, adminPublicKey, fee, approvalStatus, height, signature);
this.adminPublicKey = adminPublicKey; this.adminPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.member = member; this.member = member;
this.reason = reason; this.reason = reason;
@ -90,14 +86,8 @@ public class GroupKickTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public GroupKickTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, String reason, public GroupKickTransactionData(BaseTransactionData baseTransactionData, int groupId, String member, String reason) {
BigDecimal fee, byte[] signature) { this(baseTransactionData, groupId, member, reason, null, null, null, null);
this(timestamp, txGroupId, reference, adminPublicKey, groupId, member, reason, null, null, null, null, fee, null, null, signature);
}
/** New, unsigned */
public GroupKickTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] adminPublicKey, int groupId, String member, String reason, BigDecimal fee) {
this(timestamp, txGroupId, reference, adminPublicKey, groupId, member, reason, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,7 +1,5 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -9,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.account.GenesisAccount; import org.qora.account.GenesisAccount;
import org.qora.block.GenesisBlock; import org.qora.block.GenesisBlock;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -61,13 +58,12 @@ public class IssueAssetTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public IssueAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] issuerPublicKey, Long assetId, String owner, public IssueAssetTransactionData(BaseTransactionData baseTransactionData,
String assetName, String description, long quantity, boolean isDivisible, String data, Long assetId, String owner, String assetName, String description, long quantity, boolean isDivisible, String data) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.ISSUE_ASSET, baseTransactionData);
super(TransactionType.ISSUE_ASSET, timestamp, txGroupId, reference, issuerPublicKey, fee, approvalStatus, height, signature);
this.assetId = assetId; this.assetId = assetId;
this.issuerPublicKey = issuerPublicKey; this.issuerPublicKey = baseTransactionData.creatorPublicKey;
this.owner = owner; this.owner = owner;
this.assetName = assetName; this.assetName = assetName;
this.description = description; this.description = description;
@ -77,15 +73,8 @@ public class IssueAssetTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public IssueAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] issuerPublicKey, String owner, String assetName, public IssueAssetTransactionData(BaseTransactionData baseTransactionData, String owner, String assetName, String description, long quantity, boolean isDivisible, String data) {
String description, long quantity, boolean isDivisible, String data, BigDecimal fee, byte[] signature) { this(baseTransactionData, null, owner, assetName, description, quantity, isDivisible, data);
this(timestamp, txGroupId, reference, issuerPublicKey, null, owner, assetName, description, quantity, isDivisible, data, fee, null, null, signature);
}
/** New, unsigned */
public IssueAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] issuerPublicKey, String owner, String assetName,
String description, long quantity, boolean isDivisible, String data, BigDecimal fee) {
this(timestamp, txGroupId, reference, issuerPublicKey, owner, assetName, description, quantity, isDivisible, data, fee, null);
} }
// Getters/Setters // Getters/Setters

View File

@ -1,14 +1,11 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -48,24 +45,18 @@ public class JoinGroupTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public JoinGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] joinerPublicKey, int groupId, byte[] inviteReference, Integer previousGroupId, public JoinGroupTransactionData(BaseTransactionData baseTransactionData, int groupId, byte[] inviteReference, Integer previousGroupId) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.JOIN_GROUP, baseTransactionData);
super(TransactionType.JOIN_GROUP, timestamp, txGroupId, reference, joinerPublicKey, fee, approvalStatus, height, signature);
this.joinerPublicKey = joinerPublicKey; this.joinerPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.inviteReference = inviteReference; this.inviteReference = inviteReference;
this.previousGroupId = previousGroupId; this.previousGroupId = previousGroupId;
} }
/** From network/API */ /** From network/API */
public JoinGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] joinerPublicKey, int groupId, BigDecimal fee, byte[] signature) { public JoinGroupTransactionData(BaseTransactionData baseTransactionData, int groupId) {
this(timestamp, txGroupId, reference, joinerPublicKey, groupId, null, null, fee, null, null, signature); this(baseTransactionData, groupId, null, null);
}
/** New, unsigned */
public JoinGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] joinerPublicKey, int groupId, BigDecimal fee) {
this(timestamp, txGroupId, reference, joinerPublicKey, groupId, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -50,11 +47,11 @@ public class LeaveGroupTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public LeaveGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] leaverPublicKey, int groupId, byte[] memberReference, byte[] adminReference, Integer previousGroupId, public LeaveGroupTransactionData(BaseTransactionData baseTransactionData,
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { int groupId, byte[] memberReference, byte[] adminReference, Integer previousGroupId) {
super(TransactionType.LEAVE_GROUP, timestamp, txGroupId, reference, leaverPublicKey, fee, approvalStatus, height, signature); super(TransactionType.LEAVE_GROUP, baseTransactionData);
this.leaverPublicKey = leaverPublicKey; this.leaverPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.memberReference = memberReference; this.memberReference = memberReference;
this.adminReference = adminReference; this.adminReference = adminReference;
@ -62,13 +59,8 @@ public class LeaveGroupTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public LeaveGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] leaverPublicKey, int groupId, BigDecimal fee, byte[] signature) { public LeaveGroupTransactionData(BaseTransactionData baseTransactionData, int groupId) {
this(timestamp, txGroupId, reference, leaverPublicKey, groupId, null, null, null, fee, null, null, signature); this(baseTransactionData, groupId, null, null, null);
}
/** New, unsigned */
public LeaveGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] leaverPublicKey, int groupId, BigDecimal fee) {
this(timestamp, txGroupId, reference, leaverPublicKey, groupId, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -7,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.asset.Asset; import org.qora.asset.Asset;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -38,12 +37,11 @@ public class MessageTransactionData extends TransactionData {
this.creatorPublicKey = this.senderPublicKey; this.creatorPublicKey = this.senderPublicKey;
} }
/** From repository */ public MessageTransactionData(BaseTransactionData baseTransactionData,
public MessageTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, String recipient, Long assetId, int version, String recipient, Long assetId, BigDecimal amount, byte[] data, boolean isText, boolean isEncrypted) {
BigDecimal amount, byte[] data, boolean isText, boolean isEncrypted, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.MESSAGE, baseTransactionData);
super(TransactionType.MESSAGE, timestamp, txGroupId, reference, senderPublicKey, fee, approvalStatus, height, signature);
this.senderPublicKey = senderPublicKey; this.senderPublicKey = baseTransactionData.creatorPublicKey;
this.version = version; this.version = version;
this.recipient = recipient; this.recipient = recipient;
@ -58,18 +56,6 @@ public class MessageTransactionData extends TransactionData {
this.isEncrypted = isEncrypted; this.isEncrypted = isEncrypted;
} }
/** From network/API */
public MessageTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, String recipient, Long assetId,
BigDecimal amount, byte[] data, boolean isText, boolean isEncrypted, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, senderPublicKey, version, recipient, assetId, amount, data, isText, isEncrypted, fee, null, null, signature);
}
/** New, unsigned */
public MessageTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, int version, String recipient, Long assetId,
BigDecimal amount, byte[] data, boolean isText, boolean isEncrypted, BigDecimal fee) {
this(timestamp, txGroupId, reference, senderPublicKey, version, recipient, assetId, amount, data, isText, isEncrypted, fee, null);
}
// Getters/Setters // Getters/Setters
public byte[] getSenderPublicKey() { public byte[] getSenderPublicKey() {

View File

@ -1,6 +1,5 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
@ -9,7 +8,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.data.PaymentData; import org.qora.data.PaymentData;
import org.qora.transaction.Transaction; import org.qora.transaction.Transaction;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -34,25 +32,13 @@ public class MultiPaymentTransactionData extends TransactionData {
this.creatorPublicKey = this.senderPublicKey; this.creatorPublicKey = this.senderPublicKey;
} }
/** From repository */ public MultiPaymentTransactionData(BaseTransactionData baseTransactionData, List<PaymentData> payments) {
public MultiPaymentTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, List<PaymentData> payments, super(Transaction.TransactionType.MULTI_PAYMENT, baseTransactionData);
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) {
super(Transaction.TransactionType.MULTI_PAYMENT, timestamp, txGroupId, reference, senderPublicKey, fee, approvalStatus, height, signature);
this.senderPublicKey = senderPublicKey; this.senderPublicKey = baseTransactionData.creatorPublicKey;
this.payments = payments; this.payments = payments;
} }
/** From network/API */
public MultiPaymentTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, List<PaymentData> payments, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, senderPublicKey, payments, fee, null, null, signature);
}
/** New, unsigned */
public MultiPaymentTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, List<PaymentData> payments, BigDecimal fee) {
this(timestamp, txGroupId, reference, senderPublicKey, payments, fee, null);
}
// Getters/setters // Getters/setters
public byte[] getSenderPublicKey() { public byte[] getSenderPublicKey() {

View File

@ -7,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -41,25 +40,14 @@ public class PaymentTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public PaymentTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount, public PaymentTransactionData(BaseTransactionData baseTransactionData, String recipient, BigDecimal amount) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.PAYMENT, baseTransactionData);
super(TransactionType.PAYMENT, timestamp, txGroupId, reference, senderPublicKey, fee, approvalStatus, height, signature);
this.senderPublicKey = senderPublicKey; this.senderPublicKey = baseTransactionData.creatorPublicKey;
this.recipient = recipient; this.recipient = recipient;
this.amount = amount; this.amount = amount;
} }
/** From network/API */
public PaymentTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, senderPublicKey, recipient, amount, fee, null, null, signature);
}
/** New, unsigned */
public PaymentTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount, BigDecimal fee) {
this(timestamp, txGroupId, reference, senderPublicKey, recipient, amount, fee, null);
}
// Getters/Setters // Getters/Setters
public byte[] getSenderPublicKey() { public byte[] getSenderPublicKey() {

View File

@ -7,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -44,12 +43,11 @@ public class ProxyForgingTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public ProxyForgingTransactionData(long timestamp, int groupId, byte[] reference, byte[] forgerPublicKey, String recipient, public ProxyForgingTransactionData(BaseTransactionData baseTransactionData,
byte[] proxyPublicKey, BigDecimal share, BigDecimal previousShare, String recipient, byte[] proxyPublicKey, BigDecimal share, BigDecimal previousShare) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.PROXY_FORGING, baseTransactionData);
super(TransactionType.PROXY_FORGING, timestamp, groupId, reference, forgerPublicKey, fee, approvalStatus, height, signature);
this.forgerPublicKey = forgerPublicKey; this.forgerPublicKey = baseTransactionData.creatorPublicKey;
this.recipient = recipient; this.recipient = recipient;
this.proxyPublicKey = proxyPublicKey; this.proxyPublicKey = proxyPublicKey;
this.share = share; this.share = share;
@ -57,13 +55,9 @@ public class ProxyForgingTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public ProxyForgingTransactionData(long timestamp, int groupId, byte[] reference, byte[] forgerPublicKey, String recipient, byte[] proxyPublicKey, BigDecimal share, BigDecimal fee, byte[] signature) { public ProxyForgingTransactionData(BaseTransactionData baseTransactionData,
this(timestamp, groupId, reference, forgerPublicKey, recipient, proxyPublicKey, share, null, fee, null, null, signature); String recipient, byte[] proxyPublicKey, BigDecimal share) {
} this(baseTransactionData, recipient, proxyPublicKey, share, null);
/** New, unsigned */
public ProxyForgingTransactionData(long timestamp, int groupId, byte[] reference, byte[] forgerPublicKey, String recipient, byte[] proxyPublicKey, BigDecimal share, BigDecimal fee) {
this(timestamp, groupId, reference, forgerPublicKey, recipient, proxyPublicKey, share, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,12 +1,9 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -38,26 +35,15 @@ public class RegisterNameTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public RegisterNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] registrantPublicKey, String owner, String name, String data, public RegisterNameTransactionData(BaseTransactionData baseTransactionData, String owner, String name, String data) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.REGISTER_NAME, baseTransactionData);
super(TransactionType.REGISTER_NAME, timestamp, txGroupId, reference, registrantPublicKey, fee, approvalStatus, height, signature);
this.registrantPublicKey = registrantPublicKey; this.registrantPublicKey = baseTransactionData.creatorPublicKey;
this.owner = owner; this.owner = owner;
this.name = name; this.name = name;
this.data = data; this.data = data;
} }
/** From network/API */
public RegisterNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] registrantPublicKey, String owner, String name, String data, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, registrantPublicKey, owner, name, data, fee, null, null, signature);
}
/** New, unsigned */
public RegisterNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] registrantPublicKey, String owner, String name, String data, BigDecimal fee) {
this(timestamp, txGroupId, reference, registrantPublicKey, owner, name, data, fee, null);
}
// Getters / setters // Getters / setters
public byte[] getRegistrantPublicKey() { public byte[] getRegistrantPublicKey() {

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -42,24 +39,18 @@ public class RemoveGroupAdminTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public RemoveGroupAdminTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, String admin, byte[] adminReference, public RemoveGroupAdminTransactionData(BaseTransactionData baseTransactionData, int groupId, String admin, byte[] adminReference) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.REMOVE_GROUP_ADMIN, baseTransactionData);
super(TransactionType.REMOVE_GROUP_ADMIN, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature);
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.groupId = groupId; this.groupId = groupId;
this.admin = admin; this.admin = admin;
this.adminReference = adminReference; this.adminReference = adminReference;
} }
/** From network/API */ /** From network/API */
public RemoveGroupAdminTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, String admin, BigDecimal fee, byte[] signature) { public RemoveGroupAdminTransactionData(BaseTransactionData baseTransactionData, int groupId, String admin) {
this(timestamp, txGroupId, reference, ownerPublicKey, groupId, admin, null, fee, null, null, signature); this(baseTransactionData, groupId, admin, null);
}
/** New, unsigned */
public RemoveGroupAdminTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, String admin, BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, groupId, admin, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -7,7 +7,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -40,26 +39,14 @@ public class SellNameTransactionData extends TransactionData {
this.creatorPublicKey = this.ownerPublicKey; this.creatorPublicKey = this.ownerPublicKey;
} }
/** From repository */ public SellNameTransactionData(BaseTransactionData baseTransactionData, String name, BigDecimal amount) {
public SellNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String name, BigDecimal amount, super(TransactionType.SELL_NAME, baseTransactionData);
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) {
super(TransactionType.SELL_NAME, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature);
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.name = name; this.name = name;
this.amount = amount; this.amount = amount;
} }
/** From network/API */
public SellNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String name, BigDecimal amount, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, ownerPublicKey, name, amount, fee, null, null, signature);
}
/** New, unsigned */
public SellNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String name, BigDecimal amount, BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, name, amount, fee, null);
}
// Getters / setters // Getters / setters
public byte[] getOwnerPublicKey() { public byte[] getOwnerPublicKey() {

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -43,22 +40,16 @@ public class SetGroupTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public SetGroupTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, int defaultGroupId, Integer previousDefaultGroupId, public SetGroupTransactionData(BaseTransactionData baseTransactionData, int defaultGroupId, Integer previousDefaultGroupId) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.SET_GROUP, baseTransactionData);
super(TransactionType.SET_GROUP, timestamp, groupId, reference, creatorPublicKey, fee, approvalStatus, height, signature);
this.defaultGroupId = defaultGroupId; this.defaultGroupId = defaultGroupId;
this.previousDefaultGroupId = previousDefaultGroupId; this.previousDefaultGroupId = previousDefaultGroupId;
} }
/** From network/API */ /** From network/API */
public SetGroupTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, int defaultGroupId, BigDecimal fee, byte[] signature) { public SetGroupTransactionData(BaseTransactionData baseTransactionData, int defaultGroupId) {
this(timestamp, groupId, reference, creatorPublicKey, defaultGroupId, null, fee, null, null, signature); this(baseTransactionData, defaultGroupId, null);
}
/** New, unsigned */
public SetGroupTransactionData(long timestamp, int groupId, byte[] reference, byte[] creatorPublicKey, int defaultGroupId, BigDecimal fee) {
this(timestamp, groupId, reference, creatorPublicKey, defaultGroupId, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -63,13 +63,19 @@ public abstract class TransactionData {
protected byte[] signature; protected byte[] signature;
@Schema(description = "groupID for this transaction") @Schema(description = "groupID for this transaction")
protected int txGroupId; protected int txGroupId;
@Schema(description = "group-approval status")
protected ApprovalStatus approvalStatus;
// Not always present // Not always present
@Schema(accessMode = AccessMode.READ_ONLY, hidden = true, description = "height of block containing transaction") @Schema(accessMode = AccessMode.READ_ONLY, hidden = true, description = "height of block containing transaction")
protected Integer blockHeight; protected Integer blockHeight;
// Not always present
@Schema(description = "group-approval status")
protected ApprovalStatus approvalStatus;
// Not always present
@Schema(accessMode = AccessMode.READ_ONLY, hidden = true, description = "block height when transaction approved")
protected Integer approvalHeight;
// Constructors // Constructors
// For JAXB // For JAXB
@ -81,20 +87,19 @@ public abstract class TransactionData {
this.type = type; this.type = type;
} }
public TransactionData(TransactionType type, long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, BigDecimal fee, ApprovalStatus approvalStatus, Integer blockHeight, byte[] signature) { /** Constructor for use by transaction subclasses. */
protected TransactionData(TransactionType type, BaseTransactionData baseTransactionData) {
this.type = type; this.type = type;
this.timestamp = timestamp;
this.txGroupId = txGroupId;
this.reference = reference;
this.creatorPublicKey = creatorPublicKey;
this.fee = fee;
this.approvalStatus = approvalStatus;
this.blockHeight = blockHeight;
this.signature = signature;
}
public TransactionData(TransactionType type, long timestamp, int txGroupId, byte[] reference, byte[] creatorPublicKey, BigDecimal fee) { this.timestamp = baseTransactionData.timestamp;
this(type, timestamp, txGroupId, reference, creatorPublicKey, fee, null, null, null); this.txGroupId = baseTransactionData.txGroupId;
this.reference = baseTransactionData.reference;
this.creatorPublicKey = baseTransactionData.creatorPublicKey;
this.fee = baseTransactionData.fee;
this.signature = baseTransactionData.signature;
this.blockHeight = baseTransactionData.blockHeight;
this.approvalStatus = baseTransactionData.approvalStatus;
this.approvalHeight = baseTransactionData.approvalHeight;
} }
// Getters/setters // Getters/setters
@ -140,14 +145,6 @@ public abstract class TransactionData {
this.fee = fee; this.fee = fee;
} }
public ApprovalStatus getApprovalStatus() {
return approvalStatus;
}
public void setApprovalStatus(ApprovalStatus approvalStatus) {
this.approvalStatus = approvalStatus;
}
public byte[] getSignature() { public byte[] getSignature() {
return this.signature; return this.signature;
} }
@ -165,6 +162,24 @@ public abstract class TransactionData {
this.blockHeight = blockHeight; this.blockHeight = blockHeight;
} }
public ApprovalStatus getApprovalStatus() {
return approvalStatus;
}
@XmlTransient
public void setApprovalStatus(ApprovalStatus approvalStatus) {
this.approvalStatus = approvalStatus;
}
public Integer getApprovalHeight() {
return this.approvalHeight;
}
@XmlTransient
public void setApprovalHeight(Integer approvalHeight) {
this.approvalHeight = approvalHeight;
}
// JAXB special // JAXB special
@XmlElement(name = "creatorAddress") @XmlElement(name = "creatorAddress")

View File

@ -6,7 +6,6 @@ import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -41,33 +40,19 @@ public class TransferAssetTransactionData extends TransactionData {
} }
/** Constructs using data from repository, including optional assetName. */ /** Constructs using data from repository, including optional assetName. */
public TransferAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount, public TransferAssetTransactionData(BaseTransactionData baseTransactionData, String recipient, BigDecimal amount, long assetId, String assetName) {
long assetId, BigDecimal fee, String assetName, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.TRANSFER_ASSET, baseTransactionData);
super(TransactionType.TRANSFER_ASSET, timestamp, txGroupId, reference, senderPublicKey, fee, approvalStatus, height, signature);
this.senderPublicKey = senderPublicKey; this.senderPublicKey = baseTransactionData.creatorPublicKey;
this.recipient = recipient; this.recipient = recipient;
this.amount = amount; this.amount = amount;
this.assetId = assetId; this.assetId = assetId;
this.assetName = assetName; this.assetName = assetName;
} }
/** Constructs using data from repository, excluding optional assetName. */ /** Constructor excluding optional assetName. */
public TransferAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount, public TransferAssetTransactionData(BaseTransactionData baseTransactionData, String recipient, BigDecimal amount, long assetId) {
long assetId, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { this(baseTransactionData, recipient, amount, assetId, null);
this(timestamp, txGroupId, reference, senderPublicKey, recipient, amount, assetId, fee, null, null, null, signature);
}
/** From network/API */
public TransferAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount,
long assetId, BigDecimal fee, byte[] signature) {
this(timestamp, txGroupId, reference, senderPublicKey, recipient, amount, assetId, fee, null, null, null, signature);
}
/** New, unsigned */
public TransferAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] senderPublicKey, String recipient, BigDecimal amount,
long assetId, BigDecimal fee) {
this(timestamp, txGroupId, reference, senderPublicKey, recipient, amount, assetId, fee, null);
} }
// Getters/setters // Getters/setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -44,12 +41,12 @@ public class UpdateAssetTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public UpdateAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, long assetId, String newOwner, public UpdateAssetTransactionData(BaseTransactionData baseTransactionData,
String newDescription, String newData, BigDecimal fee, byte[] orphanReference, ApprovalStatus approvalStatus, Integer height, byte[] signature) { long assetId, String newOwner, String newDescription, String newData, byte[] orphanReference) {
super(TransactionType.UPDATE_ASSET, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature); super(TransactionType.UPDATE_ASSET, baseTransactionData);
this.assetId = assetId; this.assetId = assetId;
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.newOwner = newOwner; this.newOwner = newOwner;
this.newDescription = newDescription; this.newDescription = newDescription;
this.newData = newData; this.newData = newData;
@ -57,15 +54,8 @@ public class UpdateAssetTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public UpdateAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, long assetId, String newOwner, public UpdateAssetTransactionData(BaseTransactionData baseTransactionData, long assetId, String newOwner, String newDescription, String newData) {
String newDescription, String newData, BigDecimal fee, byte[] signature) { this(baseTransactionData, assetId, newOwner, newDescription, newData, null);
this(timestamp, txGroupId, reference, ownerPublicKey, assetId, newOwner, newDescription, newData, fee, null, null, null, signature);
}
/** New, unsigned */
public UpdateAssetTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, long assetId, String newOwner,
String newDescription, String newData, BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, assetId, newOwner, newDescription, newData, fee, null);
} }
// Getters/Setters // Getters/Setters

View File

@ -1,7 +1,5 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -9,7 +7,6 @@ import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
import org.qora.group.Group.ApprovalThreshold; import org.qora.group.Group.ApprovalThreshold;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -83,13 +80,12 @@ public class UpdateGroupTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public UpdateGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, public UpdateGroupTransactionData(BaseTransactionData baseTransactionData,
String newOwner, String newDescription, boolean newIsOpen, ApprovalThreshold newApprovalThreshold, int groupId, String newOwner, String newDescription, boolean newIsOpen, ApprovalThreshold newApprovalThreshold,
int newMinimumBlockDelay, int newMaximumBlockDelay, byte[] groupReference, int newMinimumBlockDelay, int newMaximumBlockDelay, byte[] groupReference) {
BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.UPDATE_GROUP, baseTransactionData);
super(TransactionType.UPDATE_GROUP, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature);
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.newOwner = newOwner; this.newOwner = newOwner;
this.groupId = groupId; this.groupId = groupId;
this.newDescription = newDescription; this.newDescription = newDescription;
@ -101,19 +97,10 @@ public class UpdateGroupTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public UpdateGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId, public UpdateGroupTransactionData(BaseTransactionData baseTransactionData,
String newOwner, String newDescription, boolean newIsOpen, ApprovalThreshold newApprovalThreshold, int groupId, String newOwner, String newDescription, boolean newIsOpen, ApprovalThreshold newApprovalThreshold,
int newMinimumBlockDelay, int newMaximumBlockDelay, BigDecimal fee, byte[] signature) { int newMinimumBlockDelay, int newMaximumBlockDelay) {
this(timestamp, txGroupId, reference, ownerPublicKey, groupId, newOwner, newDescription, newIsOpen, newApprovalThreshold, this(baseTransactionData, groupId, newOwner, newDescription, newIsOpen, newApprovalThreshold, newMinimumBlockDelay, newMaximumBlockDelay, null);
newMinimumBlockDelay, newMaximumBlockDelay, null, fee, null, null, signature);
}
/** New, unsigned */
public UpdateGroupTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, int groupId,
String newOwner, String newDescription, boolean newIsOpen, ApprovalThreshold newApprovalThreshold,
int newMinimumBlockDelay, int newMaximumBlockDelay, BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, groupId, newOwner, newDescription, newIsOpen, newApprovalThreshold,
newMinimumBlockDelay, newMaximumBlockDelay, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,13 +1,10 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -43,11 +40,10 @@ public class UpdateNameTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public UpdateNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String newOwner, String name, String newData, public UpdateNameTransactionData(BaseTransactionData baseTransactionData, String newOwner, String name, String newData, byte[] nameReference) {
byte[] nameReference, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.UPDATE_NAME, baseTransactionData);
super(TransactionType.UPDATE_NAME, timestamp, txGroupId, reference, ownerPublicKey, fee, approvalStatus, height, signature);
this.ownerPublicKey = ownerPublicKey; this.ownerPublicKey = baseTransactionData.creatorPublicKey;
this.newOwner = newOwner; this.newOwner = newOwner;
this.name = name; this.name = name;
this.newData = newData; this.newData = newData;
@ -55,15 +51,8 @@ public class UpdateNameTransactionData extends TransactionData {
} }
/** From network/API */ /** From network/API */
public UpdateNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String newOwner, String name, String newData, public UpdateNameTransactionData(BaseTransactionData baseTransactionData, String newOwner, String name, String newData) {
BigDecimal fee, byte[] signature) { this(baseTransactionData, newOwner, name, newData, null);
this(timestamp, txGroupId, reference, ownerPublicKey, newOwner, name, newData, null, fee, null, null, signature);
}
/** New, unsigned */
public UpdateNameTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] ownerPublicKey, String newOwner, String name, String newData,
BigDecimal fee) {
this(timestamp, txGroupId, reference, ownerPublicKey, newOwner, name, newData, fee, null);
} }
// Getters / setters // Getters / setters

View File

@ -1,12 +1,9 @@
package org.qora.data.transaction; package org.qora.data.transaction;
import java.math.BigDecimal;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.qora.transaction.Transaction.ApprovalStatus;
import org.qora.transaction.Transaction.TransactionType; import org.qora.transaction.Transaction.TransactionType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -34,25 +31,18 @@ public class VoteOnPollTransactionData extends TransactionData {
} }
/** From repository */ /** From repository */
public VoteOnPollTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] voterPublicKey, String pollName, int optionIndex, public VoteOnPollTransactionData(BaseTransactionData baseTransactionData, String pollName, int optionIndex, Integer previousOptionIndex) {
Integer previousOptionIndex, BigDecimal fee, ApprovalStatus approvalStatus, Integer height, byte[] signature) { super(TransactionType.VOTE_ON_POLL, baseTransactionData);
super(TransactionType.VOTE_ON_POLL, timestamp, txGroupId, reference, voterPublicKey, fee, approvalStatus, height, signature);
this.voterPublicKey = voterPublicKey; this.voterPublicKey = baseTransactionData.creatorPublicKey;
this.pollName = pollName; this.pollName = pollName;
this.optionIndex = optionIndex; this.optionIndex = optionIndex;
this.previousOptionIndex = previousOptionIndex; this.previousOptionIndex = previousOptionIndex;
} }
/** From network/API */ /** From network/API */
public VoteOnPollTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] voterPublicKey, String pollName, int optionIndex, public VoteOnPollTransactionData(BaseTransactionData baseTransactionData, String pollName, int optionIndex) {
BigDecimal fee, byte[] signature) { this(baseTransactionData, pollName, optionIndex, null);
this(timestamp, txGroupId, reference, voterPublicKey, pollName, optionIndex, null, fee, null, null, signature);
}
/** New, unsigned */
public VoteOnPollTransactionData(long timestamp, int txGroupId, byte[] reference, byte[] voterPublicKey, String pollName, int optionIndex, BigDecimal fee) {
this(timestamp, txGroupId, reference, voterPublicKey, pollName, optionIndex, fee, null);
} }
// Getters / setters // Getters / setters