mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Major upgrade of arbitrary transactions
- Adds support for files up 500MiB per transaction (at 2MiB chunk sizes). Previously, the max data size was 4000 bytes. - Adds a nonce, giving us the option to remove the transaction fees altogether on the data chain. These features become enabled in version 5 of arbitrary transactions.
This commit is contained in:
@@ -18,6 +18,9 @@ public class ArbitraryTestTransaction extends TestTransaction {
|
||||
public static TransactionData randomTransaction(Repository repository, PrivateKeyAccount account, boolean wantValid) throws DataException {
|
||||
final int version = 4;
|
||||
final int service = 123;
|
||||
final int nonce = 0; // Version 4 doesn't need a nonce
|
||||
final int size = 0; // Version 4 doesn't need a size
|
||||
final byte[] chunkHashes = null; // Version 4 doesn't use chunk hashes
|
||||
|
||||
byte[] data = new byte[1024];
|
||||
random.nextBytes(data);
|
||||
@@ -31,7 +34,7 @@ public class ArbitraryTestTransaction extends TestTransaction {
|
||||
List<PaymentData> payments = new ArrayList<>();
|
||||
payments.add(new PaymentData(recipient, assetId, amount));
|
||||
|
||||
return new ArbitraryTransactionData(generateBase(account), version, service, data, dataType, payments);
|
||||
return new ArbitraryTransactionData(generateBase(account), version, service, nonce, size, data, dataType, chunkHashes, payments);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user