public async Task Handle(UpdateAllotmentEvent message, IMessageHandlerContext context)
        {
            Data.AllotmentEventId = message.AllotmentEventId;
            Data.TransactionHash  = message.TransactionHash;

            var ethereumTransactionType = GetTransactionType(message.Operation);
            await _transactionService.StartAsync(message.TransactionHash, message.UserId, EthereumTransactionEntityType.AllotmentEvent, message.AllotmentEventId, ethereumTransactionType);

            await context.SendLocal(new WaitForTransaction { TransactionHash = message.TransactionHash });
        }
Esempio n. 2
0
        public async Task SetScoringTransactionAsync(long projectId, string transactionHash, long userId)
        {
            var application = await _scoringApplicationRepository.GetByProjectIdAsync(projectId) ?? throw new AppErrorException(ErrorCode.ScoringApplicationNotFound);

            var transactionId = await _ethereumTransactionService.StartAsync(transactionHash, userId, EthereumTransactionEntityType.ScoringApplication, application.Id, EthereumTransactionType.StartScoring);

            application.ScoringStartTransactionId = transactionId;

            await _scoringApplicationRepository.SaveChangesAsync();
        }
Esempio n. 3
0
        public async Task Handle(PublishAllotmentEvent command, IMessageHandlerContext context)
        {
            Data.AllotmentEventId = command.AllotmentEventId;
            Data.UserId           = command.UserId;
            Data.TransactionHash  = command.TransactionHash;

            await _ethereumTransactionService.StartAsync(command.TransactionHash, command.UserId, EthereumTransactionEntityType.AllotmentEvent, command.AllotmentEventId, EthereumTransactionType.PublishAllotmentEvent);

            await context.SendLocal(new WaitForTransaction { TransactionHash = command.TransactionHash });
        }
Esempio n. 4
0
        public async Task Handle(UpdateExpertAreas message, IMessageHandlerContext context)
        {
            Data.TransactionHash = message.TransactionHash;

            var expert = await _expertService.GetByAddressAsync(message.ExpertAddress);

            Data.ExpertId = expert.UserId;

            await _transactionService.StartAsync(message.TransactionHash, message.UserId, EthereumTransactionEntityType.Expert, expert.UserId, EthereumTransactionType.UpdateExpertAreas);

            await context.SendLocal(new WaitForTransaction { TransactionHash = message.TransactionHash });
        }