mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-11 13:50:03 +02:00
test: Add test for IPC serialization bug
Add regression test for serialization bug in IPC mining code that is not currently being called anywhere reported: https://github.com/Sjors/bitcoin/issues/71 https://github.com/chaincodelabs/libmultiprocess/issues/122
This commit is contained in:
parent
2221c8814d
commit
4e0aa1835b
@ -20,4 +20,5 @@ interface FooInterface $Proxy.wrap("FooImplementation") {
|
||||
passTransaction @3 (arg :Data) -> (result :Data);
|
||||
passVectorChar @4 (arg :Data) -> (result :Data);
|
||||
passBlockState @5 (arg :Mining.BlockValidationState) -> (result :Mining.BlockValidationState);
|
||||
passScript @6 (arg :Data) -> (result :Data);
|
||||
}
|
||||
|
@ -121,6 +121,10 @@ void IpcPipeTest()
|
||||
BOOST_CHECK_EQUAL(bs3.GetRejectReason(), bs4.GetRejectReason());
|
||||
BOOST_CHECK_EQUAL(bs3.GetDebugMessage(), bs4.GetDebugMessage());
|
||||
|
||||
auto script1{CScript() << OP_11};
|
||||
auto script2{foo->passScript(script1)};
|
||||
BOOST_CHECK_EQUAL(HexStr(script1), HexStr(script2));
|
||||
|
||||
// Test cleanup: disconnect pipe and join thread
|
||||
disconnect_client();
|
||||
thread.join();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define BITCOIN_TEST_IPC_TEST_H
|
||||
|
||||
#include <primitives/transaction.h>
|
||||
#include <script/script.h>
|
||||
#include <univalue.h>
|
||||
#include <util/fs.h>
|
||||
#include <validation.h>
|
||||
@ -19,6 +20,7 @@ public:
|
||||
CTransactionRef passTransaction(CTransactionRef t) { return t; }
|
||||
std::vector<char> passVectorChar(std::vector<char> v) { return v; }
|
||||
BlockValidationState passBlockState(BlockValidationState s) { return s; }
|
||||
CScript passScript(CScript s) { return s; }
|
||||
};
|
||||
|
||||
void IpcPipeTest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user