forked from Qortal/qortal
Converted ArbitraryTestTransaction to version 5
This fixes a failed serialization test when Transaction.getVersionByTimestamp() returns 5
This commit is contained in:
parent
fe79119809
commit
ede4802ceb
@ -16,15 +16,20 @@ import org.qortal.utils.Amounts;
|
||||
public class ArbitraryTestTransaction extends TestTransaction {
|
||||
|
||||
public static TransactionData randomTransaction(Repository repository, PrivateKeyAccount account, boolean wantValid) throws DataException {
|
||||
final int version = 4;
|
||||
final int version = 5;
|
||||
final ArbitraryTransactionData.Service service = ArbitraryTransactionData.Service.ARBITRARY_DATA;
|
||||
final int nonce = 0; // Version 4 doesn't need a nonce
|
||||
final int size = 0; // Version 4 doesn't need a size
|
||||
final String name = null; // Version 4 doesn't need a name
|
||||
final ArbitraryTransactionData.Method method = ArbitraryTransactionData.Method.PUT; // Version 4 doesn't need a method
|
||||
final byte[] secret = null; // Version 4 doesn't need a secret
|
||||
final ArbitraryTransactionData.Compression compression = ArbitraryTransactionData.Compression.NONE; // Version 4 doesn't use compression
|
||||
final byte[] chunkHashes = null; // Version 4 doesn't use chunk hashes
|
||||
final int nonce = 0;
|
||||
final int size = 4 * 1024 * 1024;
|
||||
final String name = "TEST";
|
||||
final ArbitraryTransactionData.Method method = ArbitraryTransactionData.Method.PUT;
|
||||
|
||||
final byte[] secret = new byte[32];
|
||||
random.nextBytes(secret);
|
||||
|
||||
final ArbitraryTransactionData.Compression compression = ArbitraryTransactionData.Compression.ZIP;
|
||||
|
||||
final byte[] chunkHashes = new byte[128];
|
||||
random.nextBytes(chunkHashes);
|
||||
|
||||
byte[] data = new byte[1024];
|
||||
random.nextBytes(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user