-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin/bitcoin#30205: test: add mocked Sock that can read/writ…
…e custom data and/or CNetMessages b448b01 test: add a mocked Sock that allows inspecting what has been Send() to it (Vasil Dimov) f186414 test: put the generic parts from StaticContentsSock into a separate class (Vasil Dimov) 4b58d55 test: move the implementation of StaticContentsSock to .cpp (Vasil Dimov) Pull request description: Put the generic parts from `StaticContentsSock` into a separate class `ZeroSock` so that they can be reused in other mocked `Sock` implementations. Add a new `DynSock` whose `Recv()` and `Send()` methods can be controlled after the object is created. To achieve that, the caller/creator of `DynSock` provides to its constructor two pipes (FIFOs) - recv-pipe and send-pipe. Whatever data is written to recv-pipe is later received by `DynSock::Recv()` method and whatever data is written to the socket using `DynSock::Send()` can later be found in the send-pipe. For convenience there are also two methods to send and receive `CNetMessage`s. --- This is used in bitcoin/bitcoin#26812 (first two commits from that PR). Extracting as a separate PR suggested here: bitcoin/bitcoin#30043 (comment). ACKs for top commit: Sjors: re-ACK b448b01 jonatack: re-ACK b448b01 pinheadmz: ACK b448b01 Tree-SHA512: 4a36f038192ec4ef63366cbe1a38ae70e7e015630c9f7c44926b756b20ab8c08138acae41801f23b30f6629c7059c1f81e001806e86584ff1bf1fa5b44d9caec
- Loading branch information
Showing
2 changed files
with
462 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.