Browse Source

Modified reward share creation in test/common/AccountUtils to allow a fee to be specified.

at-states-fix
CalDescent 2 years ago
parent
commit
76686eca21
  1. 6
      src/test/java/org/qortal/test/common/AccountUtils.java

6
src/test/java/org/qortal/test/common/AccountUtils.java

@ -49,10 +49,10 @@ public class AccountUtils {
public static TransactionData createRewardShare(Repository repository, String minter, String recipient, int sharePercent) throws DataException { public static TransactionData createRewardShare(Repository repository, String minter, String recipient, int sharePercent) throws DataException {
PrivateKeyAccount mintingAccount = Common.getTestAccount(repository, minter); PrivateKeyAccount mintingAccount = Common.getTestAccount(repository, minter);
PrivateKeyAccount recipientAccount = Common.getTestAccount(repository, recipient); PrivateKeyAccount recipientAccount = Common.getTestAccount(repository, recipient);
return createRewardShare(repository, mintingAccount, recipientAccount, sharePercent); return createRewardShare(repository, mintingAccount, recipientAccount, sharePercent, fee);
} }
public static TransactionData createRewardShare(Repository repository, PrivateKeyAccount mintingAccount, PrivateKeyAccount recipientAccount, int sharePercent) throws DataException { public static TransactionData createRewardShare(Repository repository, PrivateKeyAccount mintingAccount, PrivateKeyAccount recipientAccount, int sharePercent, long fee) throws DataException {
byte[] reference = mintingAccount.getLastReference(); byte[] reference = mintingAccount.getLastReference();
long timestamp = repository.getTransactionRepository().fromSignature(reference).getTimestamp() + 1; long timestamp = repository.getTransactionRepository().fromSignature(reference).getTimestamp() + 1;
@ -78,7 +78,7 @@ public class AccountUtils {
} }
public static byte[] rewardShare(Repository repository, PrivateKeyAccount minterAccount, PrivateKeyAccount recipientAccount, int sharePercent) throws DataException { public static byte[] rewardShare(Repository repository, PrivateKeyAccount minterAccount, PrivateKeyAccount recipientAccount, int sharePercent) throws DataException {
TransactionData transactionData = createRewardShare(repository, minterAccount, recipientAccount, sharePercent); TransactionData transactionData = createRewardShare(repository, minterAccount, recipientAccount, sharePercent, fee);
TransactionUtils.signAndMint(repository, transactionData, minterAccount); TransactionUtils.signAndMint(repository, transactionData, minterAccount);
byte[] rewardSharePrivateKey = minterAccount.getRewardSharePrivateKey(recipientAccount.getPublicKey()); byte[] rewardSharePrivateKey = minterAccount.getRewardSharePrivateKey(recipientAccount.getPublicKey());

Loading…
Cancel
Save