From b99bfaaec2af11a1c30ab5b4c550a88238768256 Mon Sep 17 00:00:00 2001 From: danielailie Date: Wed, 11 Dec 2024 11:19:28 +0200 Subject: [PATCH] Fixed relayed transactions tests --- src/relayed/relayedTransactionsFactory.ts | 8 ++++---- src/transactionComputer.ts | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/relayed/relayedTransactionsFactory.ts b/src/relayed/relayedTransactionsFactory.ts index 12e878cd..71f6a440 100644 --- a/src/relayed/relayedTransactionsFactory.ts +++ b/src/relayed/relayedTransactionsFactory.ts @@ -87,12 +87,12 @@ export class RelayedTransactionsFactory { private prepareInnerTransactionForRelayedV1(innerTransaction: Transaction): string { const txObject = { - nonce: Number(innerTransaction.nonce), + nonce: innerTransaction.nonce, sender: innerTransaction.sender.getPublicKey().toString("base64"), receiver: innerTransaction.receiver.getPublicKey().toString("base64"), - value: innerTransaction.value.toString(), - gasPrice: Number(innerTransaction.gasPrice), - gasLimit: Number(innerTransaction.gasLimit), + value: innerTransaction.value, + gasPrice: innerTransaction.gasPrice, + gasLimit: innerTransaction.gasLimit, data: Buffer.from(innerTransaction.data).toString("base64"), signature: Buffer.from(innerTransaction.signature).toString("base64"), chainID: Buffer.from(innerTransaction.chainID).toString("base64"), diff --git a/src/transactionComputer.ts b/src/transactionComputer.ts index a9cbec3b..47846b34 100644 --- a/src/transactionComputer.ts +++ b/src/transactionComputer.ts @@ -121,7 +121,7 @@ export class TransactionComputer { obj.chainID = transaction.chainID; obj.version = transaction.version; obj.options = transaction.options ? transaction.options : undefined; - obj.guardian = transaction.guardian.isEmpty() ? undefined : transaction.guardian; + obj.guardian = transaction.guardian.isEmpty() ? undefined : transaction.guardian.bech32(); return obj; } @@ -131,7 +131,6 @@ export class TransactionComputer { } private toBase64OrUndefined(value?: string | Uint8Array) { - console.log(1121, value && value.length ? Buffer.from(value).toString("base64") : undefined); return value && value.length ? Buffer.from(value).toString("base64") : undefined; }