diff options
Diffstat (limited to 'packages/taler-wallet-core/src/util')
-rw-r--r-- | packages/taler-wallet-core/src/util/contractTerms.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/util/contractTerms.ts b/packages/taler-wallet-core/src/util/contractTerms.ts index 652ef707d..b064079e9 100644 --- a/packages/taler-wallet-core/src/util/contractTerms.ts +++ b/packages/taler-wallet-core/src/util/contractTerms.ts @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { canonicalJson } from "@gnu-taler/taler-util"; +import { canonicalJson, Logger } from "@gnu-taler/taler-util"; import { kdf } from "@gnu-taler/taler-util"; import { decodeCrock, @@ -24,6 +24,8 @@ import { stringToBytes, } from "@gnu-taler/taler-util"; +const logger = new Logger("contractTerms.ts"); + export namespace ContractTermsUtil { export type PathPredicate = (path: string[]) => boolean; @@ -222,6 +224,8 @@ export namespace ContractTermsUtil { export function hashContractTerms(contractTerms: unknown): string { const cleaned = scrub(contractTerms); const canon = canonicalJson(cleaned) + "\0"; - return encodeCrock(hash(stringToBytes(canon))); + const bytes = stringToBytes(canon); + logger.info(`contract terms before hashing: ${encodeCrock(bytes)}`); + return encodeCrock(hash(bytes)); } } |