public FederationGatewayFeature(ILoggerFactory loggerFactory,
                                        ICrossChainTransactionMonitor crossChainTransactionMonitor,
                                        Signals signals,
                                        IConnectionManager connectionManager,
                                        FederationGatewaySettings federationGatewaySettings,
                                        IFullNode fullNode,
                                        IFederationWalletManager federationWalletManager,
                                        IFederationWalletSyncManager walletSyncManager,
                                        Network network,
                                        ConcurrentChain chain,
                                        IMonitorChainSessionManager monitorChainSessionManager,
                                        ICounterChainSessionManager counterChainSessionManager)
        {
            this.loggerFactory = loggerFactory;
            this.crossChainTransactionMonitor = crossChainTransactionMonitor;
            this.signals                   = signals;
            this.connectionManager         = connectionManager;
            this.federationGatewaySettings = federationGatewaySettings;
            this.fullNode                  = fullNode;
            this.chain = chain;
            this.federationWalletManager = federationWalletManager;
            this.walletSyncManager       = walletSyncManager;
            this.network = network;

            this.counterChainSessionManager = counterChainSessionManager;
            this.monitorChainSessionManager = monitorChainSessionManager;

            // add our payload
            var payloadProvider = this.fullNode.Services.ServiceProvider.GetService(typeof(PayloadProvider)) as PayloadProvider;

            payloadProvider.AddPayload(typeof(RequestPartialTransactionPayload));
        }
Пример #2
0
        /// <summary>
        /// Initialize the block observer with the wallet manager and the cross chain monitor.
        /// </summary>
        /// <param name="walletSyncManager">The wallet sync manager to pass new incoming blocks to.</param>
        /// <param name="crossChainTransactionMonitor">The crosschain transaction monitor to pass new incoming blocks to.</param>
        public BlockObserver(IFederationWalletSyncManager walletSyncManager, ICrossChainTransactionMonitor crossChainTransactionMonitor)
        {
            Guard.NotNull(walletSyncManager, nameof(walletSyncManager));
            Guard.NotNull(crossChainTransactionMonitor, nameof(crossChainTransactionMonitor));

            this.walletSyncManager            = walletSyncManager;
            this.crossChainTransactionMonitor = crossChainTransactionMonitor;
        }
        public PartialTransactionsBehavior(
            ILoggerFactory loggerFactory,
            ICrossChainTransactionMonitor crossChainTransactionMonitor,
            IFederationWalletManager federationWalletManager,
            ICounterChainSessionManager counterChainSessionManager,
            Network network,
            FederationGatewaySettings federationGatewaySettings)
        {
            Guard.NotNull(loggerFactory, nameof(loggerFactory));
            Guard.NotNull(crossChainTransactionMonitor, nameof(crossChainTransactionMonitor));
            Guard.NotNull(federationWalletManager, nameof(federationWalletManager));
            Guard.NotNull(counterChainSessionManager, nameof(counterChainSessionManager));
            Guard.NotNull(network, nameof(network));
            Guard.NotNull(federationGatewaySettings, nameof(federationGatewaySettings));

            this.logger        = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory = loggerFactory;
            this.crossChainTransactionMonitor = crossChainTransactionMonitor;
            this.federationWalletManager      = federationWalletManager;
            this.counterChainSessionManager   = counterChainSessionManager;
            this.network = network;
            this.federationGatewaySettings = federationGatewaySettings;
            this.ipAddressComparer         = new IPAddressComparer();
        }