I am using the documentation and I am able to successfully create a transaction if no data is present. When adding data using txRequest.SetData() the transaction will fail after.
Here is the code I am using:
private static async Task GetAccountBalance()
{
var _provider = new ElrondProvider(new HttpClient(), new ElrondNetworkConfiguration(Network.DevNet));
var aliceAccount =
new Account(Address.FromBech32(<address is here>));
// Ensure that the account in synchronize with the network to have a valid Nonce
await aliceAccount.Sync(_provider);
// Alice send 1 EGLD to bob
var txRequest = TransactionRequest.Create(aliceAccount, await NetworkConfig.GetFromNetwork(_provider), aliceAccount.Address, TokenAmount.EGLD("1"));
txRequest.SetData("Hello");
var tx = await txRequest.Send(_provider, Wallet.DeriveFromMnemonic(mnemonic));
// Await the execution of the transaction
await tx.AwaitExecuted(_provider);
}
Again to clarify: when txRequest.SetData("Hello"); is NOT present, the transaction is successful. An internal C# exception is thrown when that line is present.
I am using the documentation and I am able to successfully create a transaction if no data is present. When adding data using txRequest.SetData() the transaction will fail after.
Here is the code I am using:
Again to clarify: when
txRequest.SetData("Hello");
is NOT present, the transaction is successful. An internal C# exception is thrown when that line is present.