예제 #1
0
        /// <summary>
        /// Checks if transaction update is supposed to be processed by current instance of service since
        /// there is a division between different networks
        /// </summary>
        /// <param name="walletAddress">Blockchain wallet address</param>
        /// <param name="blockchain">Blockchain type</param>
        /// <returns></returns>
        // todo: The division should be a matter of settings but not runtime processing
        private async Task ValidateWalletAddressHosterAsync(string walletAddress, BlockchainType blockchain)
        {
            string virtualAddress = await _bcnWalletUsageService.ResolveOccupierAsync(walletAddress, blockchain);

            if (string.IsNullOrEmpty(virtualAddress))
            {
                throw new WalletAddressProcessingHostException(walletAddress, blockchain);
            }
        }
예제 #2
0
        public string Resolve(IWalletAddressHolder source, object destination, string destMember, ResolutionContext context)
        {
            if (string.IsNullOrEmpty(source.WalletAddress))
            {
                return(string.Empty);
            }

            string virtualAddress = _bcnWalletUsageService.ResolveOccupierAsync(source.WalletAddress, source.Blockchain)
                                    .GetAwaiter().GetResult();

            if (string.IsNullOrEmpty(virtualAddress))
            {
                throw new BlockchainWalletNotLinkedException(source.WalletAddress, source.Blockchain);
            }

            return(virtualAddress);
        }