Package com.h2tcoin.takamakachain.test
Class TransactionGenerator
- java.lang.Object
-
- com.h2tcoin.takamakachain.test.TransactionGenerator
-
public class TransactionGenerator extends Object
- Author:
- Giovanni Antino
-
-
Constructor Summary
Constructors Constructor Description TransactionGenerator()
-
Method Summary
-
-
-
Method Detail
-
fromJsonToTbox
public static TransactionBox[] fromJsonToTbox(String[] transactionArray)
-
generateTransactionArray
public static String[] generateTransactionArray(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfFromWallets, int numberOfToWallets, int fromWalletSpace, int toWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
generateTransactionArrayWithPay
public static String[] generateTransactionArrayWithPay(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfFromWallets, int numberOfToWallets, int fromWalletSpace, int toWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
areSameLength
public static boolean areSameLength(Object[]... arrays)
-
generateTransactionArrayWithPresonalizedValues
public static String[] generateTransactionArrayWithPresonalizedValues(InstanceWalletKeystoreInterface[] wallets, Integer[] keyIndex, KeyContexts.TransactionType[] types, String[] from, String[] to, BigInteger[] greenValues, BigInteger[] redValues, String[] messages) throws TransactionNotYetImplementedException, TransactionCanNotBeCreatedException
-
testTransaction
public static TkmValidityBean testTransaction(InstanceWalletKeyStoreBCED25519 wallet, int key, InternalTransactionBean itb) throws TransactionCanNotBeCreatedException
-
testTransactions
public static TkmValidityBean[] testTransactions(InstanceWalletKeyStoreBCED25519[] wallet, InternalTransactionBean[] itb) throws TransactionCanNotBeCreatedException
-
generateTransactionArrayWithPayQT
public static String[] generateTransactionArrayWithPayQT(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfFromWallets, int numberOfToWallets, int fromWalletSpace, int toWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
generateRegisterMainTransactionArrayWithQT
public static String[] generateRegisterMainTransactionArrayWithQT(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfWallets, int fromWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
generateRegisterMainTransactionArray
public static String[] generateRegisterMainTransactionArray(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfWallets, int fromWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
generateNodeTransactionArrayWithDeclaration
public static String[] generateNodeTransactionArrayWithDeclaration(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfWallets, int fromWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
generateAssignOverflowTransactionArray
public static String[] generateAssignOverflowTransactionArray() throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, WalletException
-
generateDeregisterOverflowTransactionArray
public static String[] generateDeregisterOverflowTransactionArray() throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, WalletException
-
generateDeregisterOverflowTransactionArray_V2
public static String[] generateDeregisterOverflowTransactionArray_V2() throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, WalletException
-
generateDeregisterMainTransactionArray
public static String[] generateDeregisterMainTransactionArray() throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, WalletException
-
generateUnassignOverflowTransactionArray
public static String[] generateUnassignOverflowTransactionArray() throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, WalletException
-
getTransactionJson
public static String getTransactionJson(KeyContexts.TransactionType type, InstanceWalletKeyStoreBCED25519 from, InstanceWalletKeyStoreBCED25519 to, int fromIndex, int toIndex, BigInteger green, BigInteger red, String message) throws TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, TransactionCanNotBeCreatedException, WalletException
-
getTransactionJson
public static String getTransactionJson(KeyContexts.TransactionType type, InstanceWalletKeystoreInterface from, InstanceWalletKeystoreInterface to, int fromIndex, int toIndex, BigInteger green, BigInteger red, String message) throws TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, TransactionCanNotBeCreatedException, WalletException
-
getTransactionJson
public static String getTransactionJson(KeyContexts.TransactionType type, InstanceWalletKeystoreInterface from, InstanceWalletKeystoreInterface to, int fromIndex, int toIndex, BigInteger green, BigInteger red, String message, Date notBefore, int epoch, int slot) throws TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, TransactionCanNotBeCreatedException, WalletException
-
generateTransactionArrayWithPaySU
public static String[] generateTransactionArrayWithPaySU(int numberOfTransaction, KeyContexts.TransactionType type, String walletPrefix, int numberOfFromWallets, int numberOfToWallets, int fromWalletSpace, int toWalletSpace) throws TransactionCanNotBeCreatedException, TransactionNotYetImplementedException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException
-
pickANumberInRange
public static int pickANumberInRange(int min, int max)
[min,max)- Parameters:
min
-max
-- Returns:
-
pickANumberAsCoin
public static BigInteger pickANumberAsCoin(int digits)
-
pickABigNumberInRange
public static BigInteger pickABigNumberInRange(BigInteger min, BigInteger max)
-
getTransactionBean
public static InternalTransactionBean getTransactionBean(KeyContexts.TransactionType type, String from, String to, BigInteger greenValue, BigInteger redValue, String message) throws TransactionNotYetImplementedException
-
getTransactionBean
public static InternalTransactionBean getTransactionBean(KeyContexts.TransactionType type, String from, String to, BigInteger greenValue, BigInteger redValue, String message, Date notBefore, int epoch, int slot) throws TransactionNotYetImplementedException
-
createIdentifingMessage
public static String createIdentifingMessage(String header, int fromWalletNumber, int fromWalletKey, int toWalletNumber, int toWalletKey)
-
generateWalletList
public static InstanceWalletKeystoreInterface[] generateWalletList(String basename, int numAddr, KeyContexts.WalletCypher cy) throws TransactionNotYetImplementedException, UnlockWalletException, WalletBurnedException, WalletEmptySeedException
-
generateStakeholderDeclarations
public static String[] generateStakeholderDeclarations(InstanceWalletKeystoreInterface[] keys)
-
generateStakeholderDeclarations
public static String[] generateStakeholderDeclarations(InstanceWalletKeystoreInterface[] keys, int greenTK, int redTK)
-
generateRedWalletsDeclarations
public static String[] generateRedWalletsDeclarations(InstanceWalletKeystoreInterface[] keys)
-
generateRegisterMain
public static String[] generateRegisterMain(InstanceWalletKeystoreInterface[] keys)
-
generateRegisterOverflow
public static String[] generateRegisterOverflow(InstanceWalletKeystoreInterface[] keys)
-
generateAssignOverflowToMain
public static String[] generateAssignOverflowToMain(InstanceWalletKeystoreInterface[] mainKeys, InstanceWalletKeystoreInterface[] overflowKeys)
-
generatStakeToMain
public static String[] generatStakeToMain(InstanceWalletKeystoreInterface[] mainKeys, InstanceWalletKeystoreInterface[] holderKeys)
-
generatePayToRed
public static String[] generatePayToRed(InstanceWalletKeystoreInterface[] from, InstanceWalletKeystoreInterface[] to, BigInteger value)
-
generatePayToGreen
public static String[] generatePayToGreen(InstanceWalletKeystoreInterface[] from, InstanceWalletKeystoreInterface[] to, BigInteger value)
-
mergeTboxArrays
public static TransactionBox[] mergeTboxArrays(TransactionBox[]... args)
-
-