dotnet-stellar-sdk icon indicating copy to clipboard operation
dotnet-stellar-sdk copied to clipboard

Unknown TransactionResult type

Open jopmiddelkamp opened this issue 2 years ago • 7 comments

Hi guys,

I found a bug. Did you base your code on one of the official SDKs that are maintained by the Stellar team? If so could you tell me which one it is. Then maybe I could add the code myself to speed up the process.

Describe the bug When I execute a fee bump operation in my transaction and I read the Result property I receive the following error:

Unknown TransactionResult type
   at stellar_dotnet_sdk.responses.TransactionResult.FromXdr(TransactionResult result)
   at stellar_dotnet_sdk.responses.TransactionResult.FromXdr(String encoded)
   at stellar_dotnet_sdk.responses.SubmitTransactionResponse.get_Result()
   ...

To Reproduce The code to get this error is


    public async Task<string> FeeBumpTransaction(Transaction transaction)
    {
        var feeBumpTransaction = TransactionBuilder.BuildFeeBumpTransaction(
            _config.SignerKeyPair,
            transaction,
            _config.MaximumFee
        );

        feeBumpTransaction.Sign(_config.SignerKeyPair, Network);

        var response = await Invoke(
            Server.SubmitTransaction(feeBumpTransaction)!
        ).ConfigureAwait(false);

        if (response!.IsSuccess())
        {
            return response.Hash;
        }

        var result = response.Result; // <<<---- HAPPENS HERE
        
        ...
    }

The result can be checked here:

TransactionResult
  feeCharged: 20006
  result: [txFeeBumpInnerFailed]
    innerResultPair
      transactionHash: qtaF0b1+XhxJmwq+95jr0VmUCLUuv/8RR0fqFYzSOk0=
      result
        feeCharged: 100
        result: [txFailed]
          results: Array[1]
            [0]: [opInner]
              tr: [payment]
                paymentResult: [paymentUnderfunded]
        ext: [undefined]
  ext: [undefined]

Expected behavior I would expect the result to be of a type TransactionResultFeeBumpInnerFailed or something like that.

Additional context The code is running on a .NET 7 Web API.

jopmiddelkamp avatar Feb 22 '23 13:02 jopmiddelkamp

Would you be willing to submit a PR to fix this?

elucidsoft avatar Feb 23 '23 01:02 elucidsoft

If it is simply porting code from another base SDK that is officially maintained by Stellar I would. That is why I asked the question. Otherwise I'll probably will look for a workaround to save some time for now.

jopmiddelkamp avatar Feb 23 '23 11:02 jopmiddelkamp

Ok, I will take a look.

elucidsoft avatar Feb 23 '23 16:02 elucidsoft

Allright, thanks!

jopmiddelkamp avatar Feb 23 '23 21:02 jopmiddelkamp

Any status update by any chance?

jopmiddelkamp avatar Mar 06 '23 12:03 jopmiddelkamp

Sorry my day job has been brutal lately, it's still on my radar. Hopefully soon!

elucidsoft avatar Mar 06 '23 13:03 elucidsoft

@elucidsoft do you maybe have some time for a short call to point me in the right direction to fix this issue myself?

jopmiddelkamp avatar Jun 19 '23 13:06 jopmiddelkamp