Solnet: [Bug] Serialization/Deserialization concepts of Transaction
Describe the bug
I think I have problem understanding the serialization/deserialization concepts of Transaction
I try to run the code below but the result is :
Transaction signature verification failure
var tbuilder = new TransactionBuilder()
.SetRecentBlockHash((await rpcClient.GetRecentBlockHashAsync()).Result.Value.Blockhash)
.SetFeePayer(buyer.Account)
.AddInstruction(MemoProgram.NewMemo(owner.PublicKey, "this is a test"));
var signlaterwithmessage = tbuilder.CompileMessage();
//this happens out of csharp code on the browser , but even doing it in csharp doesn't help as it doesn't work
var clienttransacton = Transaction.Populate(Message.Deserialize(signlaterwithmessage));
clienttransacton.Sign(buyer.Account);
var clientdto = clienttransacton.Serialize();
//this happens in csharp code side
var newtx = Transaction.Deserialize(clientdto);
newtx.Sign(owner);
RequestResult<string> tx2 = await rpcClient.SendTransactionAsync(newtx.Serialize());
Console.WriteLine(tx2.Result);
var subscription2 = await streamingRpcClient.SubscribeSignatureAsync(tx2.Result,
(subscriptionState, response) => {
}, Commitment.Finalized);
while (true)
{
Console.WriteLine(tx2.Reason); //Transaction signature verification failure
Console.WriteLine(subscription2.State);
System.Threading.Thread.Sleep(1000);
}
Expected behavior I think it should work
Desktop (please complete the following information):
- OS: Windows 10
- Solnet version 4.2 [as 4.17 doesn’t work with Solana.Metaplex that we use]
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (14 by maintainers)
We’ve replicated this and narrowed it down to an edge case in the
Transaction.Populatemethod. A fix for this will be merged shortly and v0.5.1 will be released. Thanks for the help narrowing this down.@nort3x @Neo-vortex Any updates on this since my last message? Need to figure out if something actually needs to be fixed.