public async Task Handle(AssetInfoRetrievedEvent evt, ICommandSender sender) { var aggregate = await _repository.GetAsync(evt.OperationId); if (aggregate.OnAssetInfoRetrieved(evt.Moment, evt.DisplayId, evt.MultiplierPower, evt.AssetAddress, evt.Accuracy, evt.Blockchain, evt.Type, evt.IsTradable, evt.IsTrusted, evt.KycNeeded, evt.BlockchainIntegrationLayerId, evt.CashoutMinimalAmount, evt.LowVolumeAmount, evt.BlockchainWithdrawal, evt.LykkeEntityId)) { sender.SendCommand(new CreateCashoutCommand { OperationId = aggregate.OperationId, DestinationAddress = aggregate.ToAddress, DestinationAddressExtension = aggregate.ToAddressExtension, Volume = aggregate.Amount, Asset = new AssetCashoutModel { Id = aggregate.AssetId, DisplayId = aggregate.AssetDisplayId, MultiplierPower = aggregate.AssetMultiplierPower ?? throw new ArgumentNullException(nameof(aggregate.AssetMultiplierPower)), AssetAddress = aggregate.AssetAddress, Accuracy = aggregate.AssetAccuracy ?? throw new ArgumentNullException(nameof(aggregate.AssetAccuracy)), BlockchainIntegrationLayerId = aggregate.AssetBlockchainIntegrationLayerId, Blockchain = aggregate.AssetBlockchain, Type = aggregate.AssetType, IsTradable = aggregate.AssetIsTradable ?? throw new ArgumentNullException(nameof(aggregate.AssetIsTradable)), IsTrusted = aggregate.AssetIsTrusted ?? throw new ArgumentNullException(nameof(aggregate.AssetIsTrusted)), KycNeeded = aggregate.AssetKycNeeded ?? throw new ArgumentNullException(nameof(aggregate.AssetKycNeeded)), BlockchainWithdrawal = aggregate.AssetBlockchainWithdrawal ?? throw new ArgumentNullException(nameof(aggregate.AssetBlockchainWithdrawal)), CashoutMinimalAmount = aggregate.AssetCashoutMinimalAmount ?? throw new ArgumentNullException(nameof(aggregate.AssetCashoutMinimalAmount)), LowVolumeAmount = aggregate.AssetLowVolumeAmount ?? throw new ArgumentNullException(nameof(aggregate.AssetLowVolumeAmount)), LykkeEntityId = aggregate.AssetLykkeEntityId ?? throw new ArgumentNullException(nameof(aggregate.AssetLykkeEntityId)) },
private async Task Handle(AssetInfoRetrievedEvent evt, ICommandSender sender) { var aggregate = await _repository.GetAsync(evt.TransactionId); aggregate.OnAssetInfoRetrieved(DateTime.UtcNow, neoBlockchainAssetId: evt.NeoBlockchainAssetId, neoBlockchainType: evt.NeoBlockchainType, gasBlockchainAssetId: evt.GasBlockchainAssetId, gasBlockchainType: evt.GasBlockchainType); await _repository.SaveAsync(aggregate); _chaosKitty.Meow(aggregate.TransactionId); sender.SendCommand(new BuildTransactionCommand { TransactionId = aggregate.TransactionId, Address = aggregate.Address }, Self); }