public WalletTransactionHandler( ILoggerFactory loggerFactory, IWalletManager walletManager, IWalletFeePolicy walletFeePolicy, Network network) { this.walletManager = walletManager; this.walletFeePolicy = walletFeePolicy; this.coinType = (CoinType)network.Consensus.CoinType; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); }
/// <summary> /// Initializes a new instance of the object. /// </summary> /// <param name="fullNode">Full node to offer mining RPC.</param> /// <param name="loggerFactory">Factory to be used to create logger for the node.</param> /// <param name="walletManager">The wallet manager.</param> /// <param name="posMinting">PoS staker or null if PoS staking is not enabled.</param> public StakingRpcController(IFullNode fullNode, ILoggerFactory loggerFactory, IWalletManager walletManager, IPosMinting posMinting = null) : base(fullNode: fullNode) { Guard.NotNull(fullNode, nameof(fullNode)); Guard.NotNull(loggerFactory, nameof(loggerFactory)); Guard.NotNull(walletManager, nameof(walletManager)); this.fullNode = fullNode; this.logger = loggerFactory.CreateLogger("Impleum.Bitcoin.Fullnode"); this.walletManager = walletManager; this.posMinting = posMinting; }
public LightWalletFeature(IWalletSyncManager walletSyncManager, IWalletManager walletManager, IConnectionManager connectionManager, ConcurrentChain chain, NodeDeployments nodeDeployments, IAsyncLoopFactory asyncLoopFactory, FullNode.CancellationProvider cancellationProvider) { this.walletSyncManager = walletSyncManager; this.walletManager = walletManager; this.connectionManager = connectionManager; this.chain = chain; this.nodeDeployments = nodeDeployments; this.asyncLoopFactory = asyncLoopFactory; this.cancellationProvider = cancellationProvider; }
/// <summary> /// Initializes a new instance of the object. /// </summary> /// <param name="fullNode">Full Node.</param> /// <param name="loggerFactory">Factory to be used to create logger for the node.</param> /// <param name="walletManager">The wallet manager.</param> /// <param name="posMinting">PoS staker or null if PoS staking is not enabled.</param> public StakingController(IFullNode fullNode, ILoggerFactory loggerFactory, IWalletManager walletManager, IPosMinting posMinting = null) { Guard.NotNull(fullNode, nameof(fullNode)); Guard.NotNull(loggerFactory, nameof(loggerFactory)); Guard.NotNull(walletManager, nameof(walletManager)); this.fullNode = fullNode; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.walletManager = walletManager; this.posMinting = posMinting; }
public LightWalletFeature(IWalletSyncManager walletSyncManager, IWalletManager walletManager, IConnectionManager connectionManager, ConcurrentChain chain, NodeDeployments nodeDeployments, IAsyncLoopFactory asyncLoopFactory, INodeLifetime nodeLifetime, IWalletFeePolicy walletFeePolicy) { this.walletSyncManager = walletSyncManager; this.walletManager = walletManager; this.connectionManager = connectionManager; this.chain = chain; this.nodeDeployments = nodeDeployments; this.asyncLoopFactory = asyncLoopFactory; this.nodeLifetime = nodeLifetime; this.walletFeePolicy = walletFeePolicy; }
public WalletController(IWalletManager walletManager, IWalletTransactionHandler walletTransactionHandler, IWalletSyncManager walletSyncManager, IConnectionManager connectionManager, Network network, ConcurrentChain chain, DataFolder dataFolder) { this.walletManager = walletManager; this.walletTransactionHandler = walletTransactionHandler; this.walletSyncManager = walletSyncManager; this.connectionManager = connectionManager; this.network = network; this.coinType = (CoinType)network.Consensus.CoinType; this.chain = chain; this.dataFolder = dataFolder; }
public TumblingState(ILoggerFactory loggerFactory, ConcurrentChain chain, IWalletManager walletManager, IWatchOnlyWalletManager watchOnlyWalletManager, Network network) { this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.chain = chain; this.walletManager = walletManager; this.watchOnlyWalletManager = watchOnlyWalletManager; this.coinType = (CoinType)network.Consensus.CoinType; }
public TumbleBitManager(ILoggerFactory loggerFactory, IWalletManager walletManager, ConcurrentChain chain, Network network, Signals signals) { this.lastCycleStarted = 0; this.walletManager = walletManager; this.chain = chain; this.signals = signals; this.network = network; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); // load the persisted tumbling state this.tumblingState = TumblingState.LoadState(); }
/// <summary> /// Initializes a new instance of the object. /// </summary> /// <param name="powMining">PoW miner.</param> /// <param name="fullNode">Full node to offer mining RPC.</param> /// <param name="loggerFactory">Factory to be used to create logger for the node.</param> /// <param name="walletManager">The wallet manager.</param> public MiningRpcController(IPowMining powMining, IFullNode fullNode, ILoggerFactory loggerFactory, IWalletManager walletManager) : base(fullNode: fullNode) { Guard.NotNull(powMining, nameof(powMining)); Guard.NotNull(fullNode, nameof(fullNode)); Guard.NotNull(loggerFactory, nameof(loggerFactory)); Guard.NotNull(walletManager, nameof(walletManager)); this.fullNode = fullNode; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.walletManager = walletManager; this.powMining = powMining; }
/// <summary> /// Initializes a new instance of the object. /// </summary> /// <param name="powMining">PoW miner.</param> /// <param name="fullNode">Full Node.</param> /// <param name="loggerFactory">Factory to be used to create logger for the node.</param> /// <param name="walletManager">The wallet manager.</param> public MiningController(Network network, IPowMining powMining, ILoggerFactory loggerFactory, IWalletManager walletManager) { Guard.NotNull(network, nameof(network)); Guard.NotNull(powMining, nameof(powMining)); Guard.NotNull(loggerFactory, nameof(loggerFactory)); Guard.NotNull(walletManager, nameof(walletManager)); this.network = network; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.walletManager = walletManager; this.powMining = powMining; }
public List <uint256> Generate(int blockCount) { this.logger.LogTrace("({0}:{1})", nameof(blockCount), blockCount); IWalletManager wallet = this.FullNode.NodeService <IWalletManager>(); WalletAccountReference account = this.GetAccount(); HdAddress address = wallet.GetUnusedAddress(account); List <uint256> res = this.powMining.GenerateBlocks(new ReserveScript(address.Pubkey), (ulong)blockCount, int.MaxValue); this.logger.LogTrace("(-):*.{0}={1}", nameof(res.Count), res.Count); return(res); }
/// <summary> /// Initializes a new instance of the <see cref="WalletFeature"/> class. /// </summary> /// <param name="walletSyncManager">The synchronization manager for the wallet, tasked with keeping the wallet synced with the network.</param> /// <param name="walletManager">The wallet manager.</param> /// <param name="addressBookManager">The address book manager.</param> /// <param name="signals">The signals responsible for receiving blocks and transactions from the network.</param> /// <param name="connectionManager">The connection manager.</param> /// <param name="broadcasterBehavior">The broadcaster behavior.</param> public WalletFeature( IWalletSyncManager walletSyncManager, IWalletManager walletManager, IAddressBookManager addressBookManager, INodeStats nodeStats) { this.walletSyncManager = walletSyncManager; this.walletManager = walletManager; this.addressBookManager = addressBookManager; nodeStats.RegisterStats(this.AddComponentStats, StatsType.Component, this.GetType().Name); nodeStats.RegisterStats(this.AddInlineStats, StatsType.Inline, this.GetType().Name, 800); }
public WalletController( ILoggerFactory loggerFactory, IWalletService walletService, IWalletManager walletManager, IWalletSyncManager walletSyncManager, ChainIndexer chainIndexer) : base(loggerFactory.CreateLogger(typeof(WalletController).FullName)) { this.walletService = walletService; this.walletManager = walletManager; this.walletSyncManager = walletSyncManager; this.chainIndexer = chainIndexer; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider) { IWalletManager walletManager = serviceProvider.GetService <IWalletManager>(); walletManager.InitWallet(); app.UseWebSockets(); app.UseMvc(); app.Map("/ws", x => x.UseMiddleware <WebSocketMiddleware>( serviceProvider.GetService <ILogger <WebSocketMiddleware> >(), serviceProvider.GetService <IWebSocketManager>())); }
public ServiceNodeRegistration(Network network, NodeSettings nodeSettings, IBroadcasterManager broadcasterManager, IWalletTransactionHandler walletTransactionHandler, IWalletManager walletManager, IServiceNodeManager serviceNodeManager) { this.network = network; this.broadcasterManager = broadcasterManager; this.walletTransactionHandler = walletTransactionHandler; this.walletManager = walletManager; this.serviceNodeManager = serviceNodeManager; }
public WalletRPCController(IWalletManager walletManager, IWalletTransactionHandler walletTransactionHandler, IFullNode fullNode, IBroadcasterManager broadcasterManager, ILoggerFactory loggerFactory, WalletSettings walletSettings) : base(fullNode: fullNode) { this.walletManager = walletManager; this.walletTransactionHandler = walletTransactionHandler; this.fullNode = fullNode; this.broadcasterManager = broadcasterManager; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.walletSettings = walletSettings; }
public SmartContractWalletController( IBroadcasterManager broadcasterManager, IConnectionManager connectionManager, ILoggerFactory loggerFactory, Network network, IWalletManager walletManager) { this.broadcasterManager = broadcasterManager; this.connectionManager = connectionManager; this.coinType = (CoinType)network.Consensus.CoinType; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.network = network; this.walletManager = walletManager; }
public WalletInfoBroadcaster( ILoggerFactory loggerFactory, IWalletManager walletManager, IConnectionManager connectionManager, IAsyncProvider asyncProvider, INodeLifetime nodeLifetime, ChainIndexer chainIndexer, IEventsSubscriptionService subscriptionService = null) : base(loggerFactory, nodeLifetime, asyncProvider, subscriptionService) { this.walletManager = walletManager; this.connectionManager = connectionManager; this.chainIndexer = chainIndexer; }
public WalletTransactionHandler( ILoggerFactory loggerFactory, IWalletManager walletManager, IWalletFeePolicy walletFeePolicy, Network network, StandardTransactionPolicy transactionPolicy) { this.network = network; this.walletManager = walletManager; this.walletFeePolicy = walletFeePolicy; this.logger = loggerFactory.CreateLogger("Impleum.Bitcoin.Fullnode"); this.TransactionPolicy = transactionPolicy; }
public WalletTransactionHandler( ILoggerFactory loggerFactory, IWalletManager walletManager, IWalletFeePolicy walletFeePolicy, Network network, StandardTransactionPolicy transactionPolicy) { this.network = network; this.walletManager = walletManager; this.walletFeePolicy = walletFeePolicy; this.logger = loggerFactory.CreateLogger(GetType().FullName); this.TransactionPolicy = transactionPolicy; }
public WalletInfoBroadcaster( ILoggerFactory loggerFactory, IWalletManager walletManager, IConnectionManager connectionManager, IAsyncProvider asyncProvider, INodeLifetime nodeLifetime, ChainIndexer chainIndexer, EventsHub eventsHub) : base(eventsHub, loggerFactory, nodeLifetime, asyncProvider) { this.walletManager = walletManager; this.connectionManager = connectionManager; this.chainIndexer = chainIndexer; }
public PoAMiner( IConsensusManager consensusManager, IDateTimeProvider dateTimeProvider, Network network, INodeLifetime nodeLifetime, ILoggerFactory loggerFactory, IInitialBlockDownloadState ibdState, BlockDefinition blockDefinition, ISlotsManager slotsManager, IConnectionManager connectionManager, PoABlockHeaderValidator poaHeaderValidator, IFederationManager federationManager, IFederationHistory federationHistory, IIntegrityValidator integrityValidator, IWalletManager walletManager, INodeStats nodeStats, VotingManager votingManager, PoASettings poAMinerSettings, IAsyncProvider asyncProvider, IIdleFederationMembersKicker idleFederationMembersKicker, NodeSettings nodeSettings) { this.consensusManager = consensusManager; this.dateTimeProvider = dateTimeProvider; this.network = network as PoANetwork; this.ibdState = ibdState; this.blockDefinition = blockDefinition; this.slotsManager = slotsManager; this.connectionManager = connectionManager; this.poaHeaderValidator = poaHeaderValidator; this.federationManager = federationManager; this.federationHistory = federationHistory; this.integrityValidator = integrityValidator; this.walletManager = walletManager; this.votingManager = votingManager; this.poaSettings = poAMinerSettings; this.asyncProvider = asyncProvider; this.idleFederationMembersKicker = idleFederationMembersKicker; this.nodeLifetime = nodeLifetime; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.cancellation = CancellationTokenSource.CreateLinkedTokenSource(new[] { nodeLifetime.ApplicationStopping }); this.votingDataEncoder = new VotingDataEncoder(); this.nodeSettings = nodeSettings; this.miningStatistics = new MiningStatisticsModel(); nodeStats.RegisterStats(this.AddComponentStats, StatsType.Component, this.GetType().Name); }
public NodeController( ILogger <NodeController> logger, IWebSocketManager webSocketManager, IBlockchainManager blockchainManager, IBroadcastService broadcastService, IWalletManager walletManager, ITransactionPoolManager transactionPoolManager) { this.logger = logger; this.webSocketManager = webSocketManager; this.blockchainManager = blockchainManager; this.broadcastService = broadcastService; this.walletManager = walletManager; this.transactionPoolManager = transactionPoolManager; }
public ContractSwaggerController( SwaggerGeneratorOptions options, SwaggerUIOptions uiOptions, ILoader loader, IWalletManager walletmanager, IStateRepositoryRoot stateRepository, Network network) { this.options = options; this.uiOptions = uiOptions; this.loader = loader; this.walletmanager = walletmanager; this.stateRepository = stateRepository; this.network = network; }
public ColdStakingController( ILoggerFactory loggerFactory, IWalletManager walletManager, IWalletTransactionHandler walletTransactionHandler) { Guard.NotNull(loggerFactory, nameof(loggerFactory)); Guard.NotNull(walletManager, nameof(walletManager)); Guard.NotNull(walletTransactionHandler, nameof(walletTransactionHandler)); this.ColdStakingManager = walletManager as ColdStakingManager; Guard.NotNull(this.ColdStakingManager, nameof(this.ColdStakingManager)); this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.walletTransactionHandler = walletTransactionHandler; }
public SmartContractTransactionService( Network network, IWalletManager walletManager, IWalletTransactionHandler walletTransactionHandler, IMethodParameterStringSerializer methodParameterStringSerializer, ICallDataSerializer callDataSerializer, IAddressGenerator addressGenerator) { this.network = network; this.walletManager = walletManager; this.walletTransactionHandler = walletTransactionHandler; this.methodParameterStringSerializer = methodParameterStringSerializer; this.callDataSerializer = callDataSerializer; this.addressGenerator = addressGenerator; }
public WalletTransactionHandler( ILoggerFactory loggerFactory, IWalletManager walletManager, IWalletFeePolicy walletFeePolicy, Network network, StandardTransactionPolicy transactionPolicy, IReserveUtxoService reservedUtxoService) { this.network = network; this.walletManager = walletManager; this.walletFeePolicy = walletFeePolicy; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.TransactionPolicy = transactionPolicy; this.reserveUtxoService = reservedUtxoService; }
public WalletModel(IWalletManager walletManager, BalanceStatsModel balanceStatsModel, params TabItem[] menuItems) { this.MenuItems = new ObservableCollection <TabItem>(); this.BalanceStats = new BalanceStatsModel(); this.walletManager = walletManager; this.SendCommand = new ActionCommand((s) => NewSend(this)); this.ScanAddresses = new ScanAddressesModel(walletManager); this.SyncModels = new ObservableCollection <CancelSyncModel>(); foreach (var item in menuItems) { this.MenuItems.Add(item); } }
/// <summary> /// Initializes a new instance of the <see cref="WalletFeature"/> class. /// </summary> /// <param name="walletSyncManager">The synchronization manager for the wallet, tasked with keeping the wallet synced with the network.</param> /// <param name="walletManager">The wallet manager.</param> /// <param name="signals">The signals responsible for receiving blocks and transactions from the network.</param> /// <param name="chain">The chain of blocks.</param> /// <param name="connectionManager">The connection manager.</param> /// <param name="broadcasterBehavior">The broadcaster behavior.</param> public WalletFeature( IWalletSyncManager walletSyncManager, IWalletManager walletManager, Signals.Signals signals, ConcurrentChain chain, IConnectionManager connectionManager, BroadcasterBehavior broadcasterBehavior) { this.walletSyncManager = walletSyncManager; this.walletManager = walletManager; this.signals = signals; this.chain = chain; this.connectionManager = connectionManager; this.broadcasterBehavior = broadcasterBehavior; }
public ColdStakingController( ILoggerFactory loggerFactory, IWalletManager walletManager, IWalletTransactionHandler walletTransactionHandler) { Guard.NotNull(loggerFactory, nameof(loggerFactory)); Guard.NotNull(walletManager, nameof(walletManager)); Guard.NotNull(walletTransactionHandler, nameof(walletTransactionHandler)); this.ColdStakingManager = walletManager as ColdStakingManager; Guard.NotNull(this.ColdStakingManager, nameof(this.ColdStakingManager)); this.logger = loggerFactory.CreateLogger("Impleum.Bitcoin.Fullnode"); this.walletTransactionHandler = walletTransactionHandler; }
private TradeSharpWalletManager(IWalletManager proxyOrStub = null) { if (proxyOrStub != null) { proxy = proxyOrStub; return; } try { proxy = ProxyBuilder.Instance.GetImplementer<IWalletManager>(); } catch (Exception ex) { Logger.Error("WalletManager ctor", ex); } }
public void SetUp() { _walletManager = new WManager(); var m = new PrivateObject(typeof(WManager)); }
public void Setup() { // словари TradeSharpDictionary.Initialize(MoqTradeSharpDictionary.Mock); // заглушки для диалогов - выбора пользователей UserServiceRegistrator.DialogBoxProvider = new TestDialogBoxProvider(); // серверный (торговый) прокси fakeTradeServer = ProxyBuilder.Instance.GetImplementer<ITradeSharpServerTrade>(); List<Account> accounts; var getUserOwnedAccountsWithActualBalanceMethodName = ProxyBuilder.GetMethodName<ITradeSharpServerTrade>(a => a.GetUserOwnedAccountsWithActualBalance("", null, false, out accounts)); ((IMockableProxy)fakeTradeServer).MockMethods.Add(getUserOwnedAccountsWithActualBalanceMethodName, new GetUserOwnedAccountsWithActualBalanceDel((string login, ProtectedOperationContext secCtx, bool realOnly, out List<Account> acts) => { acts = new List<Account> { new Account { Balance = 12000, Currency = "USD", ID = 51, Group = "Real" }, new Account { Balance = 2000, Currency = "USD", ID = 52, Group = "Real" } }; return AuthenticationResponse.OK; })); MainForm.serverProxyTrade = new TradeSharpServerTrade(fakeTradeServer); // кошельковый прокси fakeWalletManager = ProxyBuilder.Instance.GetImplementer<IWalletManager>(); ((IMockableProxy) fakeWalletManager).MockMethods.Add(StronglyName.GetMethodName<IWalletManager>( w => w.GetUserWallet(null, null)), new Func<ProtectedOperationContext, string, Wallet>( (context, s) => new Wallet { Balance = 1005, Currency = "USD", User = 50 })); WalletError walletError; var registerOrUpdateServiceMethodName = ProxyBuilder.GetMethodName<IWalletManager>(w => w.RegisterOrUpdateService( null, null, out walletError)); ((IMockableProxy) fakeWalletManager).MockMethods.Add(registerOrUpdateServiceMethodName, new RegisterOrUpdateServiceDel( (ProtectedOperationContext ctx, PaidService service, out WalletError error) => { error = WalletError.OK; return true; })); TradeSharpWalletManager.Initialize(fakeWalletManager); }
public VMController(IWalletManager walletManager) { _walletManager = walletManager; }
public static void Initialize(IWalletManager proxyOrStub) { instance = new TradeSharpWalletManager(proxyOrStub); }
private void RenewFactory() { if (fakeChannel != null) return; try { if (factory != null) factory.Abort(); factory = new ChannelFactory<IWalletManager>(endpointName); channel = factory.CreateChannel(); } catch (Exception) { Logger.Error("WalletManagerProxy: невозможно создать прокси"); channel = null; } }