#Serializing and deserializing a transaction

4 messages · Page 1 of 1 (latest)

onyx jacinth
#

This is not working:

let txn1 = await Mina.transaction(
  { sender: deployerPuk, fee: TX_FEE }, 
  () => { zkRelayer.dispatchBatch(batch); }
);
await txn1.prove();

let serializedTxn = txn1.toJSON();

let txn2 = Mina.Transaction.fromJSON(JSON.parse(serializedTxn));

let pendingTxn = await txn2.sign([deployerPrk]).send();

It throws : Error: Failed to send transaction { statusCode: 200, statusText: "Couldn't send zkApp command: (Verification_failed\n" + ' "Invalid_signature: [B62qo1gZFRgGhsozfGeqHv9bbkACr2sHA7qRsf4r9Tadk3dHH3Fwwmy]")' }

#

I know the signature is ok, because just by doing txn2 = txn1 before signing it works,as shown here:

zkRelayer address= B62qryAUBTdHHbEMuZdu7bLMXtvoZRBeTSPmMu7jmtXyPVr7h3tsqg6
Success txn= https://minascan.io/berkeley/tx/5JtihepyFXfEDMiM8J4NbWPAxzRLns62rVcfDkXeaBjkoJfcqc41?type=zk-tx
#

Is this an error or I am doing something wrong ?
I am using o1js 0.15.2

tawny ferry