Nethereum.SimpleWindowsWallet icon indicating copy to clipboard operation
Nethereum.SimpleWindowsWallet copied to clipboard

Parameter transaction is null when TransactionViewModel.Initialize(transaction) is called from MessageBus.Current.Listen<TransactionAdded>() in class TransactionsViewModel

Open mwherman2000 opened this issue 7 years ago • 3 comments
trafficstars

Parameter transaction is null when TransactionViewModel.Initialize(transaction) is called from MessageBus.Current.Listen<TransactionAdded>() in class TransactionsViewModel... Here is a copy of the calling code:

MessageBus.Current.Listen<TransactionAdded>().Subscribe(async x => { if (Util.Utils.IsValidUrl(Url)) { var web3 = new Web3.Web3(Url); var transactionViewModel = new TransactionViewModel(); var transaction = await web3.Eth.Transactions.GetTransactionByHash.SendRequestAsync(x.TransactionHash); transactionViewModel.Initialise(transaction); transactionViewModel.Status = TransactionViewModel.STATUS_INPROGRESS; lock (receiptsCheckLock) { Transactions.Add(transactionViewModel) } } });

mwherman2000 avatar Jan 13 '18 21:01 mwherman2000

In what scenario you see this? There is not much (if any) error handling in the sample. But when a transaction is sent, the transaction hash is put in the bus.

juanfranblanco avatar Jan 14 '18 19:01 juanfranblanco

Sending a plain old transaction on mainnet. I did add something to the extra data field:

badbad

The value/amount was 0.001 and the rest was defaulted.

mwherman2000 avatar Jan 14 '18 20:01 mwherman2000

I guess the extra data might have made the transaction to be rejected, and removed from pending before being able to retrieve it. So yes a null check might come handy there.

juanfranblanco avatar Jan 14 '18 20:01 juanfranblanco