From bd543a526b90ad737bb393e12abf8889cd49e06d Mon Sep 17 00:00:00 2001 From: catbref Date: Fri, 22 May 2020 17:13:55 +0100 Subject: [PATCH] Update uses of old Public/PrivateKeyAccount static methods to Crypto --- src/main/java/org/qortal/block/Block.java | 2 +- src/main/java/org/qortal/transaction/ChatTransaction.java | 2 +- src/main/java/org/qortal/transaction/Transaction.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/qortal/block/Block.java b/src/main/java/org/qortal/block/Block.java index 98cf2cb3..f7dde924 100644 --- a/src/main/java/org/qortal/block/Block.java +++ b/src/main/java/org/qortal/block/Block.java @@ -945,7 +945,7 @@ public class Block { if (onlineAccounts.remove(onlineAccountData)) // remove() is like contains() but also reduces the number to check next time continue; - if (!PublicKeyAccount.verify(publicKey, signature, onlineTimestampBytes)) + if (!Crypto.verify(publicKey, signature, onlineTimestampBytes)) return ValidationResult.ONLINE_ACCOUNT_SIGNATURE_INCORRECT; } diff --git a/src/main/java/org/qortal/transaction/ChatTransaction.java b/src/main/java/org/qortal/transaction/ChatTransaction.java index acdbd5ce..dcf6bc98 100644 --- a/src/main/java/org/qortal/transaction/ChatTransaction.java +++ b/src/main/java/org/qortal/transaction/ChatTransaction.java @@ -169,7 +169,7 @@ public class ChatTransaction extends Transaction { throw new RuntimeException("Unable to transform transaction to byte array for verification", e); } - if (!PublicKeyAccount.verify(this.transactionData.getCreatorPublicKey(), signature, transactionBytes)) + if (!Crypto.verify(this.transactionData.getCreatorPublicKey(), signature, transactionBytes)) return false; int nonce = this.chatTransactionData.getNonce(); diff --git a/src/main/java/org/qortal/transaction/Transaction.java b/src/main/java/org/qortal/transaction/Transaction.java index 6928894c..ffe65cdf 100644 --- a/src/main/java/org/qortal/transaction/Transaction.java +++ b/src/main/java/org/qortal/transaction/Transaction.java @@ -18,6 +18,7 @@ import org.qortal.account.PublicKeyAccount; import org.qortal.asset.Asset; import org.qortal.block.BlockChain; import org.qortal.controller.Controller; +import org.qortal.crypto.Crypto; import org.qortal.data.block.BlockData; import org.qortal.data.group.GroupApprovalData; import org.qortal.data.group.GroupData; @@ -479,7 +480,7 @@ public abstract class Transaction { return false; try { - return PublicKeyAccount.verify(this.transactionData.getCreatorPublicKey(), signature, TransactionTransformer.toBytesForSigning(transactionData)); + return Crypto.verify(this.transactionData.getCreatorPublicKey(), signature, TransactionTransformer.toBytesForSigning(transactionData)); } catch (TransformationException e) { throw new RuntimeException("Unable to transform transaction to byte array for verification", e); }