I'm trying to send a serialized transaction to a server, and then deserialize it there to be sent to an RPC then.
There's one owner
account, and two types of instructions as mentioned:
NonWritableIx
: this instruction does NOT requireowner
to beisWritable: true
WritableIx
: this instruction does requireowner
to beisWritable: true
Now if a send a serialized Transaction(NonWritableIx, WritableIx)
, and then deserialize it in the server, I notice that the owner
account is marked as isWritable: true
even for the NonWritableIx
.
Whereas if I send a serialized Transaction(NonWritableIx, NonWritableIx)
, then on deserialization, both instructions have owner
as isWritable: false
.
I'm assuming in the former case, the isWritable
changes due to the presence of a WritableIx
. But I was wondering if this is a desired behaviour?
The code snippet for serialization/deserialization is as shown below,
// Client
const serialized = tx.serialize({
requireAllSignatures: false,
});
// Server
const serialized = request.body?.transaction;
if (typeof serialized !== 'string') throw new Error('invalid transaction');
let transaction = Transaction.from(Buffer.from(serialized, 'base64'));