TransactionResponse constructor fails for text memo
See original GitHub issueProblem In the class stellar_dotnet_sdk.responses.TransactionResponse processing of MemoText currently is not possible. For example, this text memo cad98atrnpbwtn9qiozjpd5m6o is used as a deposit address for a user.
This code should work with text memo: https://github.com/elucidsoft/dotnet-stellar-sdk/blob/master/stellar-dotnet-sdk/responses/TransactionResponse.cs#L78
Solution Update getter and setter of MemoValue property
public Memo Memo
{
get
{
switch (MemoType)
{
case "none":
return Memo.None();
case "id":
return Memo.Id(ulong.Parse(MemoValue));
case "hash":
return Memo.Hash(Convert.FromBase64String(MemoValue));
case "return":
return Memo.ReturnHash(Convert.FromBase64String(MemoValue));
// Code below should be added
case "text":
return Memo.Text(MemoValue);
default:
throw new ArgumentException(nameof(MemoType));
}
}
private set
{
switch (value)
{
case MemoNone _:
MemoType = "none";
MemoValue = null;
return;
case MemoId id:
MemoType = "id";
MemoValue = id.IdValue.ToString();
return;
case MemoHash h:
MemoType = "hash";
MemoValue = Convert.ToBase64String(h.MemoBytes);
return;
case MemoReturnHash r:
MemoType = "return";
MemoValue = Convert.ToBase64String(r.MemoBytes);
return;
// Code below should be added
case MemoText r:
MemoType = "text";
MemoValue = value;
return;
default:
throw new ArgumentException(nameof(value));
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Why is the JsonRpcSigner sendTransaction slow? #340
When we call a method that requires signature on a contract, we are finding that, while MetaMask returns a transaction hash immediately upon ......
Read more >Contract - Ethers.js
A Contract is an abstraction of code that has been deployed to the blockchain. A Contract may be sent transactions, which will trigger...
Read more >TransactionRecord - Hedera
Field Type Label
receipt TransactionReceipt
transactionHash bytes
consensusTimestamp Timestamp
Read more >ethersproject/providers
5, import { Provider, TransactionRequest, TransactionResponse } from ... SERVER_ERROR && error.error && typeof(error.error.message) === "string") {.
Read more >Writing Solidity tests for array length & contents (chai)
In my deployed Remix contract, I'm able to call, for example, nameToFavoriteNumber with the string of the user I've added, and the supplied ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix was merged in master. I will close once we release a new version.
Version
4.2.24
was published on nuget. The bug should be fixed now.