forked from Qortal/qortal
Modified reward share creation in test/common/AccountUtils to allow a fee to be specified.
This commit is contained in:
parent
3965f24ab5
commit
76686eca21
@ -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…
x
Reference in New Issue
Block a user