From 9230aa0b9a88b5241915a8d6afa8a522d35abd5d Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Fri, 12 Apr 2024 00:09:48 -0400 Subject: [PATCH] Better error messages for transaction field mismatch (#4659). --- src.ts/transaction/transaction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src.ts/transaction/transaction.ts b/src.ts/transaction/transaction.ts index c024640b4..883aa9c12 100644 --- a/src.ts/transaction/transaction.ts +++ b/src.ts/transaction/transaction.ts @@ -1164,12 +1164,12 @@ export class Transaction implements TransactionLike { if (tx.blobs != null) { result.blobs = tx.blobs; } if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); + assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); } if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); + assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); }