From 89d56c9a74f061d503054c339efc5d22daff9923 Mon Sep 17 00:00:00 2001 From: KauriHero <55721017+kauri-hero@users.noreply.github.com> Date: Wed, 15 Sep 2021 09:59:53 +1200 Subject: [PATCH 1/2] Delete Greypaper.md (#22) * Delete Greypaper.md Moving the Greypaper to its own repo, so not to disrupt Node repo https://github.com/MASQ-Project/MASQ-Greypaper * greypaper-move: trying to address changes in Rust 1.55; at least for Linux Co-authored-by: dnwiebe Co-authored-by: bertllll <65427484+bertllll@users.noreply.github.com> --- GREYPAPER.MD | 243 ------------------ masq/src/commands/setup_command.rs | 2 +- masq/src/communications/broadcast_handler.rs | 15 +- masq/src/interactive_mode.rs | 16 +- masq/src/non_interactive_mode.rs | 4 +- .../src/notifications/crashed_notification.rs | 9 +- masq/src/terminal/integration_test_utils.rs | 2 +- masq/src/terminal/terminal_interface.rs | 14 +- node/src/proxy_client/stream_reader.rs | 2 +- node/src/proxy_client/stream_writer.rs | 2 +- node/src/stream_handler_pool.rs | 4 +- node/src/stream_reader.rs | 2 +- node/src/stream_writer_sorted.rs | 2 +- node/src/stream_writer_unsorted.rs | 2 +- node/src/test_utils/database_utils.rs | 2 +- 15 files changed, 39 insertions(+), 282 deletions(-) delete mode 100644 GREYPAPER.MD diff --git a/GREYPAPER.MD b/GREYPAPER.MD deleted file mode 100644 index 6042199d5..000000000 --- a/GREYPAPER.MD +++ /dev/null @@ -1,243 +0,0 @@ -# MASQ - -## Project Greypaper - -# TABLE OF CONTENTS - -| Topic | Page # | -| ------ | ------ | -| Preamble – The Greypaper | [Navigate](#preamble) | -| Introduction | [Navigate](#introduction) | -| Solution – Rule of Three | [Navigate](#solution) | -| Founding Principles | [Navigate](#founding-principles) | -| Project Milestones | [Navigate](#key-goals) | -| Docker Style CLI | [In progress](#docker-cli) | -| Graphic User Interface (GUI) | [In progress](#gui) | -| Tokenomics | [Navigate](#tokenomics) | -| Don the MASQ & Get Involved | [Support Us](#support-us) | -| SUPPORT OUR CAUSE | [Donate](#donate) | -| References | [References](#references) | - - -## PREAMBLE - THE GREYPAPER - -Readers may be thinking “Why is this document called a ‘Greypaper’, and not a Whitepaper?" - -Through discussion over the team's combined years of experience in business, technology, cryptocurrency and project management, an interesting idea was proposed - one of the MASQ team decided that there had to be an alternative to the mainstream idea of releasing a Whitepaper. - -Whitepapers are exactly what they sound like – written in black and white and often outlining definitive goals and deadlines. - -This Greypaper will be a living and evolving document that can be updated on a needs-basis with accurate information. All the while providing enough starting information for readers to appreciate the overall vision and purpose of the project. - -Through this, MASQ aspires to not only be transparent in their goals and intentions, but also to avoid hype, disappointment and misinformation. -  - -# INTRODUCTION - -MASQ is a community-driven project aimed at solving the problem of internet censorship by repressive regimes. The project Committee is addressing this by building a decentralized mesh network which happens to also be censorship resistant. - -By doing so, it will allow content available on the World Wide Web to be accessible to anyone and everyone with an internet connection, all while allowing users to both share internet freedom and have an incentive to dedicate their excess bandwidth to the network. - -**MASQ intends to deliver an Open Source solution to a growing Real World set of issues through a unique approach combining:** -- Programming -- Blockchain application -- Network encryption -- Software design -- Self-healing autonomous network structures - -**The Use-cases of MASQ Node and the MASQ Network are central to the whole purpose - these include:** -- providing censorship resistance from oppresive regimes -- encouraging freedom of information across the clear net, regardless of geographical location -- increasing user accessibility to 'freedom based' applications, such as cryptocurrency, open source development platforms etc -- promoting privacy of personal information - -**MASQ Network’s vision is that its software attracts over 1 million users across millions of devices and creates an ecosystem of applications that leverages the decentralized mesh network.** - - -> “A whole world behind the MASQ” - -  -# SOLUTION – POWER OF THREE - -The software solution is made up of three design components: - - - Encrypted - **Completed** - Node allows--and encourages--encrypted connections, but it mainly addresses operations on a lower level. It operates on standard protocols such as TLS, SSL and HTTP/S - - - Untraceable - **Completed** - Data is sent through a multi-hop network route that changes too quickly to trace - - - Clandestine – **In progress** - Will hide not only the data, not only the route, but also the very fact that the user is using MASQ at all - -Read more about these methods in detail on the [Encryption Wiki Page] - - -# FOUNDING PRINCIPLES - -## Decentralized Governance -The MASQ team intends to have a core group of individuals forming a committee. At an agreed point, the Committee will dissolve, allowing the Open Source project to be fully decentralized. - -There will be no CEO, and practical methods will be applied to ensure no one person controls the entire project. - -## Community Spirit -The MASQ team have all been born of other projects and communities - they understand that without the true spirit of ‘By the Community, for the Community” the network and thus the project will cease to exist. From these humble roots, the team want to actively grow the Community and realize the full potential that the project can bring to the modern world of internet communication. - -## Privacy -MASQ intends to keep user privacy as an utmost priority, as without true privacy of the network participants, the network cannot grow to its full potential across the world to restricted countries, where access to such a solution could come with severe penalty from Government and watchdog agencies. - -Similarly, members of the Committee will remain pseudo-anonymous until such time that the network will be completely immutable, and there is little to no external threat to them. Some of the Committee are willing to be openly identified. -  - -# PROJECT MILESTONES - - -### Docker-Style CLI Interface - initial version completed, undergoing further development -We have discontinued development and maintenance on the original GUI, which was not only inefficient, but didn't reflect the features of Node entirely. From here the development is focused on the skeleton behind any G/UI, and is now based on an interactive Command Line Interface, which will be adapted to be used in all further iterations of the software - -A configuration file can be set up and referenced by the software Daemon, and then Node can be initialized by the user with a few simple commands on a Command Prompt in Windows, Linux or Mac - -After more of the UI-Gateway infrastructure (MASQNode-UIv2) design is developed and implemented, further UI components and GUIs can be designed and built on top of the MASQ Node software for more user-friendly adoption and fully-fledged visual features. - -As of October 2020, most of the UI-Gateway interface has been implemented and allows UIs to communicate directly with the running Node instance (masqd). - -The interfacing itself is handled across WebSockets broadcasts, handled by UIs and node across the UI-Gateway. - - -### Graphic User Interface (GUI) - in progress -Through the power of the amazing MASQ Community, a group was formed who is developing a streamlined GUI that will operate by communicating through the new MASQNode-UIv2-Gateway over Websocket broadcasts and messaging. - -The GUI will first be a browser-based solution for Alpha and Beta type testing with community, and then be developed into further iterations of GUIs. These may be based on other platforms or languages for greater user experience and streamlined features. This has been released on GitHub as an open source code repo. - -In parallel to the browser version, an Electron-based native app GUI will be developed as well which can be run on the 3 main platforms. - -### Additional Key Milestones - -* Auto Port-Forwarding - *next in development priority* - -* Clandestine Routing - -* Neighborhood Modes - -* Terminal Intelligence - -## MASQ Project GitHub is Open Source -The MASQ [GitHub] is an Open Source fork of Substratum (the code base was created and developed by Substratum LLC, a registered US company based in Tennessee) – under the GPLv3 license. All the forked source code used from the latest repo of Substratum is cited as such and credit given properly. - -Starting repositories include forks of: -* [SubNode] -* [SubTNT] - - -# Tokenomics - -The MASQ ERC20 token will be a pure utility token. Its primary purpose is to provide a monetization component within the Node software to allow micro-transactions between nodes providing services to each-other within the network. These services are measured and values are individually set by the user of each Node, creating a 'free and open market' within the network itself for users to provide their bandwidth and Node routing services. - -This monetization component is inherent to the security of the network, as it ensures: -- that users can both exchange a token to prove they are a reliable consumer or server of services -- reduce the likelihood of large scale network attacks such as botnets and DDoS -- 'Bad actor' Nodes or Nodes not clearing their consuming token debt will be banned or marked in a delinquent list, thus rendering them inactive Nodes - -## Smart Contract -MASQ is using a clone of an OpenZeppelin ERC20 token smart contract adapted by Substratum (GitHub repo [sub-contract]), which was audited by Quantstamp in 2018-2019. It was modified with a single constructor to provide protection from double-spending attacks. - -Our smart contract in Solidity can be view publicly on our [verified contract address](https://etherscan.io/address/0x02ba9B528425f9de08F961B88A10b03Be8B8B998) on etherscan.io - -## Token Supply and Development - -*The MASQ v2 utility token was announced on 17th October, 2020. -Detailed information can be immediately referenced on this [Medium post](https://medium.com/masq-project/masq-v2-tokenomics-8a9c4aa91cb4)* - -**Total Token Supply: 38,947,981** - -Airdrop Swap Pool: 4,447,981 - -Circulating Initial Advisor Pool: 5,000,000 - -Committee: 9,000,000 - -Development & Marketing: 20,500,000 - -*No further tokens will be minted or mined - -## Development & Marketing Allocations: - -From the 20,500,000 tokens being released, they will be allocated towards key areas of project activity: - -- Marketing & Liquidity 10,000,000 - -- Developer Community 9,000,000 - -- Initial Staking Reward Pools 1,500,000 - -## Token Releases: - -Upon minting, non-circulating tokens will be distributed from the deployer wallet (unissued supply) into the 3 relevant wallets, according to a time-release schedule - -**Development and Marketing** - -- Upon minting — 5,500,000* - -- 2,500,000 released per month thereafter, for 6 months - -**Committee** - -- Upon minting — 1,400,000** - -- 1,900,000 released per month thereafter, for total of 4 months - -\* *(note these tokens are made available to provide v2 token liquidity to Linkswap, and staking reward programs)* - -\** *(which is divided by committee)* - - - - -# GET INVOLVED - ->Do you have a passion for Freedom? Freedom of Information for the world? ->Do you have knowledge of Rust, or similar programming and would like to volunteer some of your time? ->Have you simply wanted and try to test a superior alternative to VPN or Tor? - -**Join our Community and Contact us!** - -Get in Touch - - [Telegram] - - [Twitter] - - [GitHub] - - [Website] - - -# SUPPORT OUR CAUSE - -As all of our Committee are volunteers donating our time and efforts, we will rely on donations from our community to help fund hosting, development, website services and other project expenses - -ETH address for any donations from our wonderful community: - -[masq.eth](https://masq.eth) - ENS - -[Donate ETH directly](https://etherdonation.com/d?to=0x27d9A2AC83b493f88ce9B4532EDcf74e95B9788d&amount=0.02) - -BTC - ```bc1qnsm0eqt9z9228n7hqc6a0g9dns84vsg3whnmsh``` - - -## REFERENCES - -**Substratum Sources and Links:** -- [GNU GPLv3 License](https://github.com/SubstratumNetwork/SubstratumNode/blob/master/LICENSE) -- [Original Codebase Repo](https://github.com/SubstratumNetwork/SubstratumNode) -- [Original TNT Repo](https://github.com/SubstratumNetwork/TNT) - -**OpenZeppelin Token Contracts:** -- [MIT License](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/LICENSE) -- [Contract Library](https://github.com/OpenZeppelin/openzeppelin-contracts) -- [ERC20 Tokens](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC20) - - -[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job) - - [Original Codebase Repo]: - [Original TNT Repo]: - [sub-contract]: - [Telegram]: - [Twitter]: - [GitHub]: - [Website]: - [Encryption Wiki Page]: https://github.com/MASQ-Project/Node/wiki/Encryption-Methods-Explained diff --git a/masq/src/commands/setup_command.rs b/masq/src/commands/setup_command.rs index 302c27d82..e7854f268 100644 --- a/masq/src/commands/setup_command.rs +++ b/masq/src/commands/setup_command.rs @@ -293,7 +293,7 @@ NOTE: no changes were made to the setup because the Node is currently running.\n }; let (stream_factory, handle) = TestStreamFactory::new(); let (mut stdout, _) = stream_factory.make(); - let term_interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let term_interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); SetupCommand::handle_broadcast(message, &mut stdout, &term_interface); diff --git a/masq/src/communications/broadcast_handler.rs b/masq/src/communications/broadcast_handler.rs index 859a5bb24..a6598f6c3 100644 --- a/masq/src/communications/broadcast_handler.rs +++ b/masq/src/communications/broadcast_handler.rs @@ -151,12 +151,13 @@ mod tests { use masq_lib::messages::{CrashReason, ToMessageBody, UiNodeCrashedBroadcast}; use masq_lib::messages::{UiSetupBroadcast, UiSetupResponseValue, UiSetupResponseValueStatus}; use masq_lib::ui_gateway::MessagePath; + use std::sync::Arc; use std::time::Duration; #[test] fn broadcast_of_setup_triggers_correct_handler() { let (factory, handle) = TestStreamFactory::new(); - let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Box::new( + let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Arc::new( TerminalPassiveMock::new(), )))) .start(Box::new(factory)); @@ -188,7 +189,7 @@ mod tests { #[test] fn broadcast_of_crashed_triggers_correct_handler() { let (factory, handle) = TestStreamFactory::new(); - let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Box::new( + let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Arc::new( TerminalPassiveMock::new(), )))) .start(Box::new(factory)); @@ -218,7 +219,7 @@ mod tests { #[test] fn broadcast_of_new_password_triggers_correct_handler() { let (factory, handle) = TestStreamFactory::new(); - let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Box::new( + let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Arc::new( TerminalPassiveMock::new(), )))) .start(Box::new(factory)); @@ -242,7 +243,7 @@ mod tests { #[test] fn broadcast_of_undelivered_ff_message_triggers_correct_handler() { let (factory, handle) = TestStreamFactory::new(); - let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Box::new( + let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Arc::new( TerminalPassiveMock::new(), )))) .start(Box::new(factory)); @@ -269,7 +270,7 @@ mod tests { #[test] fn unexpected_broadcasts_are_ineffectual_but_dont_kill_the_handler() { let (factory, handle) = TestStreamFactory::new(); - let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Box::new( + let subject = BroadcastHandlerReal::new(Some(TerminalWrapper::new(Arc::new( TerminalPassiveMock::new(), )))) .start(Box::new(factory)); @@ -310,7 +311,7 @@ mod tests { let (life_checker_handle, stream_factory, stream_handle) = make_tools_for_test_streams_with_thread_life_checker(); let broadcast_handler_real = BroadcastHandlerReal::new(Some(TerminalWrapper::new( - Box::new(TerminalPassiveMock::new()), + Arc::new(TerminalPassiveMock::new()), ))); let broadcast_handle = broadcast_handler_real.start(Box::new(stream_factory)); let example_broadcast = UiNewPasswordBroadcast {}.tmb(0); @@ -459,7 +460,7 @@ Cannot handle crash request: Node is not running. let mut stdout = StdoutBlender::new(tx); let stdout_clone = stdout.clone(); let stdout_second_clone = stdout.clone(); - let synchronizer = TerminalWrapper::new(Box::new(TerminalActiveMock::new())); + let synchronizer = TerminalWrapper::new(Arc::new(TerminalActiveMock::new())); let synchronizer_clone_idle = synchronizer.clone(); //synchronized part proving that the broadcast print is synchronized diff --git a/masq/src/interactive_mode.rs b/masq/src/interactive_mode.rs index b240bc677..677b167f2 100644 --- a/masq/src/interactive_mode.rs +++ b/masq/src/interactive_mode.rs @@ -202,7 +202,7 @@ mod tests { } fn make_terminal_interface() -> TerminalWrapper { - TerminalWrapper::new(Box::new( + TerminalWrapper::new(Arc::new( TerminalPassiveMock::new() .read_line_result(TerminalEvent::CommandLine(vec![ "error".to_string(), @@ -259,7 +259,7 @@ mod tests { fn continue_and_break_orders_work_for_interactive_mode() { let mut stream_holder = FakeStreamHolder::new(); let mut streams = stream_holder.streams(); - let terminal_interface = TerminalWrapper::new(Box::new( + let terminal_interface = TerminalWrapper::new(Arc::new( TerminalPassiveMock::new() .read_line_result(TerminalEvent::Continue) .read_line_result(TerminalEvent::Break), @@ -281,7 +281,7 @@ mod tests { #[test] fn pass_args_or_print_messages_announces_break_signal_from_line_reader() { let mut stream_holder = FakeStreamHolder::new(); - let interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); let result = pass_args_or_print_messages(&mut stream_holder.streams(), Break, &interface); @@ -293,7 +293,7 @@ mod tests { #[test] fn pass_args_or_print_messages_announces_continue_signal_from_line_reader() { let mut stream_holder = FakeStreamHolder::new(); - let interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); let result = pass_args_or_print_messages(&mut stream_holder.streams(), Continue, &interface); @@ -309,7 +309,7 @@ mod tests { #[test] fn pass_args_or_print_messages_announces_error_from_line_reader() { let mut stream_holder = FakeStreamHolder::new(); - let interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); let result = pass_args_or_print_messages( &mut stream_holder.streams(), @@ -327,7 +327,7 @@ mod tests { let mut stream_holder = FakeStreamHolder::new(); let command_factory = CommandFactoryMock::default(); let mut command_processor = CommandProcessorMock::default() - .inject_terminal_interface(TerminalWrapper::new(Box::new(TerminalPassiveMock::new()))); + .inject_terminal_interface(TerminalWrapper::new(Arc::new(TerminalPassiveMock::new()))); let readline_result = TerminalEvent::EoF; let result = handle_terminal_event( @@ -345,7 +345,7 @@ mod tests { #[test] fn handle_help_or_version_provides_fine_lock_for_help_text() { - let terminal_interface = TerminalWrapper::new(Box::new(TerminalActiveMock::new())); + let terminal_interface = TerminalWrapper::new(Arc::new(TerminalActiveMock::new())); let background_interface_clone = terminal_interface.clone(); let mut stdout = ByteArrayWriter::new(); let (tx, rx) = bounded(1); @@ -385,7 +385,7 @@ mod tests { } fn test_body_for_testing_the_classic_lock(tested_variant: TerminalEvent) { - let terminal_interface = TerminalWrapper::new(Box::new(TerminalActiveMock::new())); + let terminal_interface = TerminalWrapper::new(Arc::new(TerminalActiveMock::new())); let background_interface_clone = terminal_interface.clone(); let mut stream_holder = FakeStreamHolder::new(); let mut streams = stream_holder.streams(); diff --git a/masq/src/non_interactive_mode.rs b/masq/src/non_interactive_mode.rs index 4000432a7..54c70dd2a 100644 --- a/masq/src/non_interactive_mode.rs +++ b/masq/src/non_interactive_mode.rs @@ -550,7 +550,7 @@ mod tests { .process_result(Ok(())) .process_result(Ok(())) .process_params(&process_params_arc) - .inject_terminal_interface(TerminalWrapper::new(Box::new(terminal_mock))); + .inject_terminal_interface(TerminalWrapper::new(Arc::new(terminal_mock))); let processor_factory = CommandProcessorFactoryMock::new().make_result(Ok(Box::new(processor))); let mut subject = Main { @@ -594,7 +594,7 @@ mod tests { let close_params_arc = Arc::new(Mutex::new(vec![])); let processor = CommandProcessorMock::new() .close_params(&close_params_arc) - .inject_terminal_interface(TerminalWrapper::new(Box::new( + .inject_terminal_interface(TerminalWrapper::new(Arc::new( TerminalPassiveMock::new() .read_line_result(TerminalEvent::Error(Some("ConnectionRefused".to_string()))), ))); diff --git a/masq/src/notifications/crashed_notification.rs b/masq/src/notifications/crashed_notification.rs index 334da2e2d..62e572b88 100644 --- a/masq/src/notifications/crashed_notification.rs +++ b/masq/src/notifications/crashed_notification.rs @@ -65,6 +65,7 @@ mod tests { use crate::test_utils::mocks::TerminalPassiveMock; use masq_lib::test_utils::fake_stream_holder::ByteArrayWriter; use masq_lib::utils::running_test; + use std::sync::Arc; #[test] pub fn handles_child_wait_failure() { @@ -75,7 +76,7 @@ mod tests { process_id: 12345, crash_reason: CrashReason::ChildWaitFailure("Couldn't wait".to_string()), }; - let term_interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let term_interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); CrashNotifier::handle_broadcast(msg, &mut stdout, &term_interface); @@ -92,7 +93,7 @@ mod tests { process_id: 12345, crash_reason: CrashReason::Unrecognized("Just...failed!\n\n".to_string()), }; - let term_interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let term_interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); CrashNotifier::handle_broadcast(msg, &mut stdout, &term_interface); @@ -109,7 +110,7 @@ mod tests { process_id: 12345, crash_reason: CrashReason::NoInformation, }; - let term_interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let term_interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); CrashNotifier::handle_broadcast(msg, &mut stdout, &term_interface); @@ -126,7 +127,7 @@ mod tests { process_id: 12345, crash_reason: CrashReason::DaemonCrashed, }; - let term_interface = TerminalWrapper::new(Box::new(TerminalPassiveMock::new())); + let term_interface = TerminalWrapper::new(Arc::new(TerminalPassiveMock::new())); CrashNotifier::handle_broadcast(msg, &mut stdout, &term_interface); } diff --git a/masq/src/terminal/integration_test_utils.rs b/masq/src/terminal/integration_test_utils.rs index c870efc6e..f51e9e46b 100644 --- a/masq/src/terminal/integration_test_utils.rs +++ b/masq/src/terminal/integration_test_utils.rs @@ -203,7 +203,7 @@ mod tests { }; terminal_interface.console = Arc::new(Mutex::new(console)); terminal_interface.lock = lock; - let terminal = TerminalWrapper::new(Box::new(terminal_interface)); + let terminal = TerminalWrapper::new(Arc::new(terminal_interface)); let mut terminal_clone = terminal.clone(); let (tx, rx) = bounded(1); let handle = thread::spawn(move || { diff --git a/masq/src/terminal/terminal_interface.rs b/masq/src/terminal/terminal_interface.rs index 192cfeeb5..d48a9a0f3 100644 --- a/masq/src/terminal/terminal_interface.rs +++ b/masq/src/terminal/terminal_interface.rs @@ -29,7 +29,7 @@ mod test_cfg { //distribute the nonstandard, custom handles over a lot of places in our code. pub struct TerminalWrapper { - interface: Arc>, + interface: Arc, } impl Clone for TerminalWrapper { @@ -41,10 +41,8 @@ impl Clone for TerminalWrapper { } impl TerminalWrapper { - pub fn new(interface: Box) -> Self { - Self { - interface: Arc::new(interface), - } + pub fn new(interface: Arc) -> Self { + Self { interface } } pub fn lock(&self) -> Box { self.interface.lock() @@ -67,7 +65,7 @@ impl TerminalWrapper { if std::env::var(prod_cfg::MASQ_TEST_INTEGRATION_KEY) .eq(&Ok(prod_cfg::MASQ_TEST_INTEGRATION_VALUE.to_string())) { - TerminalWrapper::new(Box::new(prod_cfg::IntegrationTestTerminal::default())) + TerminalWrapper::new(Arc::new(prod_cfg::IntegrationTestTerminal::default())) .wrap_to_ok() } else { //we have no positive test aimed at this (only negative and as an integration test) @@ -82,7 +80,7 @@ impl TerminalWrapper { F: FnOnce() -> std::io::Result, TerminalType: linefeed::Terminal + 'static, { - Self::new(Box::new(interface_configurator( + Self::new(Arc::new(interface_configurator( terminal_creator_of_certain_type, Box::new(Interface::with_term), )?)) @@ -204,7 +202,7 @@ mod tests { where C: FnMut(TerminalWrapper, StdoutBlender) -> () + Sync + Send + 'static, { - let interface = TerminalWrapper::new(Box::new(TerminalActiveMock::new())); + let interface = TerminalWrapper::new(Arc::new(TerminalActiveMock::new())); let barrier = Arc::new(Barrier::new(2)); let (tx, rx) = unbounded(); let stdout_c1 = StdoutBlender::new(tx); diff --git a/node/src/proxy_client/stream_reader.rs b/node/src/proxy_client/stream_reader.rs index 736559e37..b0d35674a 100644 --- a/node/src/proxy_client/stream_reader.rs +++ b/node/src/proxy_client/stream_reader.rs @@ -381,7 +381,7 @@ mod tests { assert_eq!(result, Err(())); proxy_client_awaiter.await_message_count(1); TestLogHandler::new().exists_log_containing( - "WARN: test: Continuing after read error on stream from 6.5.4.1:8325: other os error", + "WARN: test: Continuing after read error on stream from 6.5.4.1:8325: other error", ); let proxy_client_recording = proxy_client_recording_arc.lock().unwrap(); assert_eq!( diff --git a/node/src/proxy_client/stream_writer.rs b/node/src/proxy_client/stream_writer.rs index fcfcdfa56..8ca38a278 100644 --- a/node/src/proxy_client/stream_writer.rs +++ b/node/src/proxy_client/stream_writer.rs @@ -343,7 +343,7 @@ mod tests { let tlh = TestLogHandler::new(); tlh.assert_logs_contain_in_order(vec!( format!("DEBUG: StreamWriter for {:?}/1.3.3.4:5678: Writing 19 bytes over existing stream", stream_key).as_str (), - format!("WARN: StreamWriter for {:?}/1.3.3.4:5678: Continuing after write error: other os error", stream_key).as_str (), + format!("WARN: StreamWriter for {:?}/1.3.3.4:5678: Continuing after write error: other error", stream_key).as_str (), format!("DEBUG: StreamWriter for {:?}/1.3.3.4:5678: Wrote 19/19 bytes of clear data", stream_key).as_str ())); } diff --git a/node/src/stream_handler_pool.rs b/node/src/stream_handler_pool.rs index 9c34fdb2b..7328afa3b 100644 --- a/node/src/stream_handler_pool.rs +++ b/node/src/stream_handler_pool.rs @@ -774,7 +774,7 @@ mod tests { }); TestLogHandler::new().await_log_containing( - "WARN: StreamWriter for 1.2.3.5:6789: Continuing after write error: other os error", + "WARN: StreamWriter for 1.2.3.5:6789: Continuing after write error: other error", 1000, ); @@ -1121,7 +1121,7 @@ mod tests { system.run(); }); - TestLogHandler::new().await_log_containing("ERROR: Dispatcher: Stream to 1.2.3.5:7000 does not exist and could not be connected; discarding 5 bytes: other os error", 1000); + TestLogHandler::new().await_log_containing("ERROR: Dispatcher: Stream to 1.2.3.5:7000 does not exist and could not be connected; discarding 5 bytes: other error", 1000); neighborhood_awaiter.await_message_count(1); let remove_neighbor_msg = Recording::get::(&neighborhood_recording_arc, 0); diff --git a/node/src/stream_reader.rs b/node/src/stream_reader.rs index 078d213db..2dacfbc49 100644 --- a/node/src/stream_reader.rs +++ b/node/src/stream_reader.rs @@ -416,7 +416,7 @@ mod tests { System::current().stop_with_code(0); system.run(); - TestLogHandler::new().await_log_containing("WARN: StreamReader for 1.2.3.4:5678: Continuing after read error on stream between local 1.2.3.5:6789 and peer 1.2.3.4:5678: other os error", 1000); + TestLogHandler::new().await_log_containing("WARN: StreamReader for 1.2.3.4:5678: Continuing after read error on stream between local 1.2.3.5:6789 and peer 1.2.3.4:5678: other error", 1000); let shp_recording = shp_recording_arc.lock().unwrap(); assert_eq!(shp_recording.len(), 0); diff --git a/node/src/stream_writer_sorted.rs b/node/src/stream_writer_sorted.rs index 73d2c40a7..3f559cc77 100644 --- a/node/src/stream_writer_sorted.rs +++ b/node/src/stream_writer_sorted.rs @@ -276,7 +276,7 @@ mod tests { subject.poll().unwrap(); TestLogHandler::new().exists_log_containing( - "WARN: StreamWriter for 1.2.3.4:5678: Continuing after write error: other os error", + "WARN: StreamWriter for 1.2.3.4:5678: Continuing after write error: other error", ); assert_eq!(write_params.lock().unwrap().len(), 3); } diff --git a/node/src/stream_writer_unsorted.rs b/node/src/stream_writer_unsorted.rs index e789500c2..a51f3a3fc 100644 --- a/node/src/stream_writer_unsorted.rs +++ b/node/src/stream_writer_unsorted.rs @@ -214,7 +214,7 @@ mod tests { subject.poll().unwrap(); TestLogHandler::new().await_log_containing( - "WARN: StreamWriter for 1.2.3.4:5678: Continuing after write error: other os error", + "WARN: StreamWriter for 1.2.3.4:5678: Continuing after write error: other error", 1000, ); assert_eq!(write_params.lock().unwrap().len(), 3); diff --git a/node/src/test_utils/database_utils.rs b/node/src/test_utils/database_utils.rs index e60f6e046..2e559fae2 100644 --- a/node/src/test_utils/database_utils.rs +++ b/node/src/test_utils/database_utils.rs @@ -19,7 +19,7 @@ pub fn revive_tables_of_the_version_0_and_return_the_connection_to_the_db( _ => (), }; let connection = Connection::open(&db_path).unwrap(); - &[ + [ "create table config ( name text not null, value text, From 163b26dbb0f7ffee240bb38862a7a71599440f6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 19:41:38 +0000 Subject: [PATCH 2/2] Bump generic-array from 0.12.3 to 0.12.4 in /automap Bumps [generic-array](https://github.com/fizyk20/generic-array) from 0.12.3 to 0.12.4. - [Release notes](https://github.com/fizyk20/generic-array/releases) - [Changelog](https://github.com/fizyk20/generic-array/blob/0.12.4/CHANGELOG.md) - [Commits](https://github.com/fizyk20/generic-array/compare/0.12.3...0.12.4) --- updated-dependencies: - dependency-name: generic-array dependency-type: indirect ... Signed-off-by: dependabot[bot] --- automap/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automap/Cargo.lock b/automap/Cargo.lock index bb1a01399..7949df9d3 100644 --- a/automap/Cargo.lock +++ b/automap/Cargo.lock @@ -581,9 +581,9 @@ checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ]