private async Task Handle(TransactionBuiltEvent evt, ICommandSender sender) { var aggregate = await _repository.GetAsync(evt.TransactionId); aggregate.OnTransactionBuilt(DateTime.UtcNow, evt.UnsignedTransactionContext, allGas: evt.AllGas, claimedGas: evt.ClaimedGas); await _repository.SaveAsync(aggregate); _chaosKitty.Meow(aggregate.TransactionId); sender.SendCommand(new SignTransactionCommand { TransactionId = aggregate.TransactionId, NeoBlockchainType = aggregate.NeoBlockchainType, UnsignedTransactionContext = aggregate.UnsignedTransactionContext ?? throw new ArgumentNullException(nameof(aggregate.UnsignedTransactionContext)), Address = aggregate.Address }, Self);
private async Task Handle(TransactionBuiltEvent evt, ICommandSender sender) { var aggregate = await _repository.GetAsync(evt.TransactionId); if (_stateSwitcher.Switch(aggregate, evt)) { sender.SendCommand ( new SignTransactionCommand { OperationId = aggregate.OperationId, TransactionId = aggregate.TransactionId, BlockchainType = aggregate.BlockchainType, SignerAddress = aggregate.FromAddress, TransactionContext = aggregate.Context }, Self ); _chaosKitty.Meow(evt.TransactionId); await _repository.SaveAsync(aggregate); } }