Interim commit of *TransactionData classes for safety

This commit is contained in:
catbref
2019-05-31 18:11:54 +01:00
parent 041773cf41
commit c9968b3dd2
87 changed files with 964 additions and 446 deletions

View File

@@ -65,12 +65,10 @@ public class GroupApprovalTests extends Common {
ApprovalThreshold approvalThreshold = ApprovalThreshold.ONE;
int minimumBlockDelay = 0;
int maximumBlockDelay = 1440;
Integer groupId = null;
BigDecimal fee = BigDecimal.ONE.setScale(8);
byte[] signature = null;
TransactionData transactionData = new CreateGroupTransactionData(timestamp, txGroupId, reference, creatorPublicKey, owner, groupName, description,
isOpen, approvalThreshold, minimumBlockDelay, maximumBlockDelay, groupId, fee, signature);
isOpen, approvalThreshold, minimumBlockDelay, maximumBlockDelay, fee);
Transaction transaction = new CreateGroupTransaction(repository, transactionData);
// Sign transaction

View File

@@ -257,12 +257,11 @@ public class TransactionTests extends Common {
// Update name's owner and data
Account newOwner = new PublicKeyAccount(repository, recipientSeed);
String newData = "{\"newKey\":\"newValue\"}";
byte[] nameReference = reference;
BigDecimal fee = BigDecimal.ONE;
long timestamp = parentBlockData.getTimestamp() + 1_000;
UpdateNameTransactionData updateNameTransactionData = new UpdateNameTransactionData(timestamp, Group.NO_GROUP, reference, sender.getPublicKey(),
newOwner.getAddress(), name, newData, nameReference, fee);
newOwner.getAddress(), name, newData, fee);
Transaction updateNameTransaction = new UpdateNameTransaction(repository, updateNameTransactionData);
updateNameTransaction.sign(sender);
@@ -402,7 +401,6 @@ public class TransactionTests extends Common {
// Buyer
PrivateKeyAccount buyer = new PrivateKeyAccount(repository, recipientSeed);
byte[] nameReference = reference;
// Send buyer some funds so they have a reference
Transaction somePaymentTransaction = createPayment(sender, buyer.getAddress());
@@ -418,7 +416,7 @@ public class TransactionTests extends Common {
BigDecimal fee = BigDecimal.ONE;
long timestamp = parentBlockData.getTimestamp() + 1_000;
BuyNameTransactionData buyNameTransactionData = new BuyNameTransactionData(timestamp, Group.NO_GROUP, buyersReference, buyer.getPublicKey(), name,
originalNameData.getSalePrice(), seller, nameReference, fee);
originalNameData.getSalePrice(), seller, fee);
Transaction buyNameTransaction = new BuyNameTransaction(repository, buyNameTransactionData);
buyNameTransaction.sign(buyer);