File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,18 @@ static ProUpServPL GetRandomProUpServPayload()
5858 return pl;
5959}
6060
61+ static ProUpRegPL GetRandomProUpRegPayload ()
62+ {
63+ ProUpRegPL pl;
64+ pl.proTxHash = GetRandHash ();
65+ pl.keyIDOperator = GetRandomKeyID ();
66+ pl.keyIDVoting = GetRandomKeyID ();
67+ pl.scriptPayout = GetRandomScript ();
68+ pl.inputsHash = GetRandHash ();
69+ pl.vchSig = InsecureRandBytes (63 );
70+ return pl;
71+ }
72+
6173BOOST_AUTO_TEST_CASE (protx_validation_test)
6274{
6375 CMutableTransaction mtx;
@@ -146,6 +158,22 @@ BOOST_AUTO_TEST_CASE(proupserv_setpayload_test)
146158 BOOST_CHECK (pl.vchSig == pl2.vchSig );
147159}
148160
161+ BOOST_AUTO_TEST_CASE (proupreg_setpayload_test)
162+ {
163+ const ProUpRegPL& pl = GetRandomProUpRegPayload ();
164+
165+ CMutableTransaction mtx;
166+ SetTxPayload (mtx, pl);
167+ ProUpRegPL pl2;
168+ BOOST_CHECK (GetTxPayload (mtx, pl2));
169+ BOOST_CHECK (pl.proTxHash == pl2.proTxHash );
170+ BOOST_CHECK (pl.keyIDOperator == pl2.keyIDOperator );
171+ BOOST_CHECK (pl.keyIDVoting == pl2.keyIDVoting );
172+ BOOST_CHECK (pl.scriptPayout == pl2.scriptPayout );
173+ BOOST_CHECK (pl.inputsHash == pl2.inputsHash );
174+ BOOST_CHECK (pl.vchSig == pl2.vchSig );
175+ }
176+
149177BOOST_AUTO_TEST_CASE (proreg_checkstringsig_test)
150178{
151179 ProRegPL pl = GetRandomProRegPayload ();
You can’t perform that action at this time.
0 commit comments