mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
129 lines
57 KiB
HTML
129 lines
57 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.14"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Dash Core: qa/rpc-tests/decodescript.py Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(initResizable);
|
|
/* @license-end */</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="bitcoin_logo_doxygen.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Dash Core
|
|
 <span id="projectnumber">0.12.2.1</span>
|
|
</div>
|
|
<div id="projectbrief">P2P Digital Currency</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('decodescript_8py_source.html','');});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">decodescript.py</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="decodescript_8py.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="namespacedecodescript.html"> 1</a></span> <span class="comment">#!/usr/bin/env python2</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"># Copyright (c) 2015 The Bitcoin Core developers</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"># Distributed under the MIT software license, see the accompanying</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"># file COPYING or http://www.opensource.org/licenses/mit-license.php.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1test__framework.html">test_framework.test_framework</a> <span class="keyword">import</span> BitcoinTestFramework</div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1util.html">test_framework.util</a> <span class="keyword">import</span> *</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1mininode.html">test_framework.mininode</a> <span class="keyword">import</span> *</div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">from</span> io <span class="keyword">import</span> BytesIO</div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html"> 11</a></span> <span class="keyword">class </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html">DecodeScriptTest</a>(<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html">BitcoinTestFramework</a>):</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  <span class="stringliteral">"""Tests decoding scripts via RPC command "decodescript"."""</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#a23017eb529bde6b760fca7f2b3f670c7"> 14</a></span>  <span class="keyword">def </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a23017eb529bde6b760fca7f2b3f670c7">setup_chain</a>(self):</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  print(<span class="stringliteral">'Initializing test directory '</span> + self.options.tmpdir)</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  <a class="code" href="namespacetest__framework_1_1util.html#a0d5c2187844d0b046113dbea6b956413">initialize_chain_clean</a>(self.options.tmpdir, 1)</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#af287e0898ab8c7a0e8ec73443edb0e92"> 18</a></span>  <span class="keyword">def </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html#af287e0898ab8c7a0e8ec73443edb0e92">setup_network</a>(self, split=False):</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca"> 19</a></span>  self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a> = <a class="code" href="namespacetest__framework_1_1util.html#aa6b84bae918a356af030860efab10362">start_nodes</a>(1, self.options.tmpdir)</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#a9d18333f972b3265043f6cee7ffd6a09"> 20</a></span>  self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9d18333f972b3265043f6cee7ffd6a09">is_network_split</a> = <span class="keyword">False</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#a9fd19df4527578f7a303bb0241908518"> 22</a></span>  <span class="keyword">def </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9fd19df4527578f7a303bb0241908518">decodescript_script_sig</a>(self):</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  signature = <span class="stringliteral">'304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c509001'</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  push_signature = <span class="stringliteral">'48'</span> + signature</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  public_key = <span class="stringliteral">'03b0da749730dc9b4b1f4a14d6902877a92541f5368778853d9c4a0cb7802dcfb2'</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  push_public_key = <span class="stringliteral">'21'</span> + public_key</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="comment"># below are test cases for all of the standard transaction types</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="comment"># 1) P2PK scriptSig</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="comment"># the scriptSig of a public key scriptPubKey simply pushes a signature onto the stack</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(push_signature)</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(signature, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="comment"># 2) P2PKH scriptSig</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(push_signature + push_public_key)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(signature + <span class="stringliteral">' '</span> + public_key, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="comment"># 3) multisig scriptSig</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="comment"># this also tests the leading portion of a P2SH multisig scriptSig</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="comment"># OP_0 <A sig> <B sig></span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'00'</span> + push_signature + push_signature)</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'0 '</span> + signature + <span class="stringliteral">' '</span> + signature, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment"># 4) P2SH scriptSig</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="comment"># an empty P2SH redeemScript is valid and makes for a very simple test case.</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="comment"># thus, such a spending scriptSig would just need to pass the outer redeemScript</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="comment"># hash test and leave true on the top of the stack.</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'5100'</span>)</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'1 0'</span>, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment"># 5) null data scriptSig - no such thing because null data scripts can not be spent.</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="comment"># thus, no test case for that standard transaction type is here.</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#a78deed8ce951dada97c69ff225bafb08"> 55</a></span>  <span class="keyword">def </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a78deed8ce951dada97c69ff225bafb08">decodescript_script_pub_key</a>(self):</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  public_key = <span class="stringliteral">'03b0da749730dc9b4b1f4a14d6902877a92541f5368778853d9c4a0cb7802dcfb2'</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  push_public_key = <span class="stringliteral">'21'</span> + public_key</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  public_key_hash = <span class="stringliteral">'11695b6cd891484c2d49ec5aa738ec2b2f897777'</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  push_public_key_hash = <span class="stringliteral">'14'</span> + public_key_hash</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="comment"># below are test cases for all of the standard transaction types</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="comment"># 1) P2PK scriptPubKey</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="comment"># <pubkey> OP_CHECKSIG</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(push_public_key + <span class="stringliteral">'ac'</span>)</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(public_key + <span class="stringliteral">' OP_CHECKSIG'</span>, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment"># 2) P2PKH scriptPubKey</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment"># OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'76a9'</span> + push_public_key_hash + <span class="stringliteral">'88ac'</span>)</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_DUP OP_HASH160 '</span> + public_key_hash + <span class="stringliteral">' OP_EQUALVERIFY OP_CHECKSIG'</span>, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="comment"># 3) multisig scriptPubKey</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="comment"># <m> <A pubkey> <B pubkey> <C pubkey> <n> OP_CHECKMULTISIG</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment"># just imagine that the pub keys used below are different.</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="comment"># for our purposes here it does not matter that they are the same even though it is unrealistic.</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'52'</span> + push_public_key + push_public_key + push_public_key + <span class="stringliteral">'53ae'</span>)</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'2 '</span> + public_key + <span class="stringliteral">' '</span> + public_key + <span class="stringliteral">' '</span> + public_key + <span class="stringliteral">' 3 OP_CHECKMULTISIG'</span>, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="comment"># 4) P2SH scriptPubKey</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="comment"># OP_HASH160 <Hash160(redeemScript)> OP_EQUAL.</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="comment"># push_public_key_hash here should actually be the hash of a redeem script.</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment"># but this works the same for purposes of this test.</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'a9'</span> + push_public_key_hash + <span class="stringliteral">'87'</span>)</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_HASH160 '</span> + public_key_hash + <span class="stringliteral">' OP_EQUAL'</span>, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment"># 5) null data scriptPubKey</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment"># use a signature look-alike here to make sure that we do not decode random data as a signature.</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="comment"># this matters if/when signature sighash decoding comes along.</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="comment"># would want to make sure that no such decoding takes place in this case.</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  signature_imposter = <span class="stringliteral">'48304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c509001'</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment"># OP_RETURN <data></span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'6a'</span> + signature_imposter)</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_RETURN '</span> + signature_imposter[2:], rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment"># 6) a CLTV redeem script. redeem scripts are in-effect scriptPubKey scripts, so adding a test here.</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="comment"># OP_NOP2 is also known as OP_CHECKLOCKTIMEVERIFY.</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment"># just imagine that the pub keys used below are different.</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment"># for our purposes here it does not matter that they are the same even though it is unrealistic.</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">#</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment"># OP_IF</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="comment"># <receiver-pubkey> OP_CHECKSIGVERIFY</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="comment"># OP_ELSE</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="comment"># <lock-until> OP_CHECKLOCKTIMEVERIFY OP_DROP</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="comment"># OP_ENDIF</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="comment"># <sender-pubkey> OP_CHECKSIG</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="comment">#</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="comment"># lock until block 500,000</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="namespacedecodescript.html">decodescript</a>(<span class="stringliteral">'63'</span> + push_public_key + <span class="stringliteral">'ad670320a107b17568'</span> + push_public_key + <span class="stringliteral">'ac'</span>)</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_IF '</span> + public_key + <span class="stringliteral">' OP_CHECKSIGVERIFY OP_ELSE 500000 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_ENDIF '</span> + public_key + <span class="stringliteral">' OP_CHECKSIG'</span>, rpc_result[<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#aba21f728e23fbe661bc6d0ffe8e290b6"> 112</a></span>  <span class="keyword">def </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html#aba21f728e23fbe661bc6d0ffe8e290b6">decoderawtransaction_asm_sighashtype</a>(self):</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="stringliteral">"""Tests decoding scripts via RPC command "decoderawtransaction".</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="stringliteral"></span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="stringliteral"> This test is in with the "decodescript" tests because they are testing the same "asm" script decodes.</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="stringliteral"> """</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="comment"># this test case uses a random plain vanilla mainnet transaction with a single P2PKH input and output</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  tx = <span class="stringliteral">'0100000001696a20784a2c70143f634e95227dbdfdf0ecd51647052e70854512235f5986ca010000008a47304402207174775824bec6c2700023309a168231ec80b82c6069282f5133e6f11cbb04460220570edc55c7c5da2ca687ebd0372d3546ebc3f810516a002350cac72dfe192dfb014104d3f898e6487787910a690410b7a917ef198905c27fb9d3b0a42da12aceae0544fc7088d239d9a48f2828a15a09e84043001f27cc80d162cb95404e1210161536ffffffff0100e1f505000000001976a914eb6c6e0cdb2d256a32d97b8df1fc75d1920d9bca88ac00000000'</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(tx)</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'304402207174775824bec6c2700023309a168231ec80b82c6069282f5133e6f11cbb04460220570edc55c7c5da2ca687ebd0372d3546ebc3f810516a002350cac72dfe192dfb[ALL] 04d3f898e6487787910a690410b7a917ef198905c27fb9d3b0a42da12aceae0544fc7088d239d9a48f2828a15a09e84043001f27cc80d162cb95404e1210161536'</span>, rpc_result[<span class="stringliteral">'vin'</span>][0][<span class="stringliteral">'scriptSig'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="comment"># this test case uses a mainnet transaction that has a P2SH input and both P2PKH and P2SH outputs.</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="comment"># it's from James D'Angelo's awesome introductory videos about multisig: https://www.youtube.com/watch?v=zIbUSaZBJgU and https://www.youtube.com/watch?v=OSA1pwlaypc</span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="comment"># verify that we have not altered scriptPubKey decoding.</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  tx = <span class="stringliteral">'01000000018d1f5635abd06e2c7e2ddf58dc85b3de111e4ad6e0ab51bb0dcf5e84126d927300000000fdfe0000483045022100ae3b4e589dfc9d48cb82d41008dc5fa6a86f94d5c54f9935531924602730ab8002202f88cf464414c4ed9fa11b773c5ee944f66e9b05cc1e51d97abc22ce098937ea01483045022100b44883be035600e9328a01b66c7d8439b74db64187e76b99a68f7893b701d5380220225bf286493e4c4adcf928c40f785422572eb232f84a0b83b0dea823c3a19c75014c695221020743d44be989540d27b1b4bbbcfd17721c337cb6bc9af20eb8a32520b393532f2102c0120a1dda9e51a938d39ddd9fe0ebc45ea97e1d27a7cbd671d5431416d3dd87210213820eb3d5f509d7438c9eeecb4157b2f595105e7cd564b3cdbb9ead3da41eed53aeffffffff02611e0000000000001976a914dc863734a218bfe83ef770ee9d41a27f824a6e5688acee2a02000000000017a9142a5edea39971049a540474c6a99edf0aa4074c588700000000'</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(tx)</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'8e3730608c3b0bb5df54f09076e196bc292a8e39a78e73b44b6ba08c78f5cbb0'</span>, rpc_result[<span class="stringliteral">'txid'</span>])</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'0 3045022100ae3b4e589dfc9d48cb82d41008dc5fa6a86f94d5c54f9935531924602730ab8002202f88cf464414c4ed9fa11b773c5ee944f66e9b05cc1e51d97abc22ce098937ea[ALL] 3045022100b44883be035600e9328a01b66c7d8439b74db64187e76b99a68f7893b701d5380220225bf286493e4c4adcf928c40f785422572eb232f84a0b83b0dea823c3a19c75[ALL] 5221020743d44be989540d27b1b4bbbcfd17721c337cb6bc9af20eb8a32520b393532f2102c0120a1dda9e51a938d39ddd9fe0ebc45ea97e1d27a7cbd671d5431416d3dd87210213820eb3d5f509d7438c9eeecb4157b2f595105e7cd564b3cdbb9ead3da41eed53ae'</span>, rpc_result[<span class="stringliteral">'vin'</span>][0][<span class="stringliteral">'scriptSig'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_DUP OP_HASH160 dc863734a218bfe83ef770ee9d41a27f824a6e56 OP_EQUALVERIFY OP_CHECKSIG'</span>, rpc_result[<span class="stringliteral">'vout'</span>][0][<span class="stringliteral">'scriptPubKey'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_HASH160 2a5edea39971049a540474c6a99edf0aa4074c58 OP_EQUAL'</span>, rpc_result[<span class="stringliteral">'vout'</span>][1][<span class="stringliteral">'scriptPubKey'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  txSave = <a class="code" href="classtest__framework_1_1mininode_1_1CTransaction.html">CTransaction</a>()</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  txSave.deserialize(BytesIO(<a class="code" href="namespacetest__framework_1_1util.html#a7a98a073cd2a7a26b707f52d2fef01be">hex_str_to_bytes</a>(tx)))</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment"># make sure that a specifically crafted op_return value will not pass all the IsDERSignature checks and then get decoded as a sighash type</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  tx = <span class="stringliteral">'01000000015ded05872fdbda629c7d3d02b194763ce3b9b1535ea884e3c8e765d42e316724020000006b48304502204c10d4064885c42638cbff3585915b322de33762598321145ba033fc796971e2022100bb153ad3baa8b757e30a2175bd32852d2e1cb9080f84d7e32fcdfd667934ef1b012103163c0ff73511ea1743fb5b98384a2ff09dd06949488028fd819f4d83f56264efffffffff0200000000000000000b6a0930060201000201000180380100000000001976a9141cabd296e753837c086da7a45a6c2fe0d49d7b7b88ac00000000'</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(tx)</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_RETURN 300602010002010001'</span>, rpc_result[<span class="stringliteral">'vout'</span>][0][<span class="stringliteral">'scriptPubKey'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> </div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="comment"># verify that we have not altered scriptPubKey processing even of a specially crafted P2PKH pubkeyhash and P2SH redeem script hash that is made to pass the der signature checks</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  tx = <span class="stringliteral">'01000000018d1f5635abd06e2c7e2ddf58dc85b3de111e4ad6e0ab51bb0dcf5e84126d927300000000fdfe0000483045022100ae3b4e589dfc9d48cb82d41008dc5fa6a86f94d5c54f9935531924602730ab8002202f88cf464414c4ed9fa11b773c5ee944f66e9b05cc1e51d97abc22ce098937ea01483045022100b44883be035600e9328a01b66c7d8439b74db64187e76b99a68f7893b701d5380220225bf286493e4c4adcf928c40f785422572eb232f84a0b83b0dea823c3a19c75014c695221020743d44be989540d27b1b4bbbcfd17721c337cb6bc9af20eb8a32520b393532f2102c0120a1dda9e51a938d39ddd9fe0ebc45ea97e1d27a7cbd671d5431416d3dd87210213820eb3d5f509d7438c9eeecb4157b2f595105e7cd564b3cdbb9ead3da41eed53aeffffffff02611e0000000000001976a914301102070101010101010102060101010101010188acee2a02000000000017a91430110207010101010101010206010101010101018700000000'</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(tx)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_DUP OP_HASH160 3011020701010101010101020601010101010101 OP_EQUALVERIFY OP_CHECKSIG'</span>, rpc_result[<span class="stringliteral">'vout'</span>][0][<span class="stringliteral">'scriptPubKey'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_HASH160 3011020701010101010101020601010101010101 OP_EQUAL'</span>, rpc_result[<span class="stringliteral">'vout'</span>][1][<span class="stringliteral">'scriptPubKey'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="comment"># some more full transaction tests of varying specific scriptSigs. used instead of</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment"># tests in decodescript_script_sig because the decodescript RPC is specifically</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment"># for working on scriptPubKeys (argh!).</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  push_signature = <a class="code" href="namespacetest__framework_1_1util.html#ae6b425a1e3feb505726ee64525523264">bytes_to_hex_str</a>(txSave.vin[0].scriptSig)[2:(0x48*2+4)]</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  signature = push_signature[2:]</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  der_signature = signature[:-2]</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  signature_sighash_decoded = der_signature + <span class="stringliteral">'[ALL]'</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  signature_2 = der_signature + <span class="stringliteral">'82'</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  push_signature_2 = <span class="stringliteral">'48'</span> + signature_2</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  signature_2_sighash_decoded = der_signature + <span class="stringliteral">'[NONE|ANYONECANPAY]'</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> </div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="comment"># 1) P2PK scriptSig</span></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  txSave.vin[0].scriptSig = <a class="code" href="namespacetest__framework_1_1util.html#a7a98a073cd2a7a26b707f52d2fef01be">hex_str_to_bytes</a>(push_signature)</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(<a class="code" href="namespacetest__framework_1_1util.html#ae6b425a1e3feb505726ee64525523264">bytes_to_hex_str</a>(txSave.serialize()))</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(signature_sighash_decoded, rpc_result[<span class="stringliteral">'vin'</span>][0][<span class="stringliteral">'scriptSig'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="comment"># make sure that the sighash decodes come out correctly for a more complex / lesser used case.</span></div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  txSave.vin[0].scriptSig = <a class="code" href="namespacetest__framework_1_1util.html#a7a98a073cd2a7a26b707f52d2fef01be">hex_str_to_bytes</a>(push_signature_2)</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(<a class="code" href="namespacetest__framework_1_1util.html#ae6b425a1e3feb505726ee64525523264">bytes_to_hex_str</a>(txSave.serialize()))</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(signature_2_sighash_decoded, rpc_result[<span class="stringliteral">'vin'</span>][0][<span class="stringliteral">'scriptSig'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="comment"># 2) multisig scriptSig</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  txSave.vin[0].scriptSig = <a class="code" href="namespacetest__framework_1_1util.html#a7a98a073cd2a7a26b707f52d2fef01be">hex_str_to_bytes</a>(<span class="stringliteral">'00'</span> + push_signature + push_signature_2)</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(<a class="code" href="namespacetest__framework_1_1util.html#ae6b425a1e3feb505726ee64525523264">bytes_to_hex_str</a>(txSave.serialize()))</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'0 '</span> + signature_sighash_decoded + <span class="stringliteral">' '</span> + signature_2_sighash_decoded, rpc_result[<span class="stringliteral">'vin'</span>][0][<span class="stringliteral">'scriptSig'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="comment"># 3) test a scriptSig that contains more than push operations.</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="comment"># in fact, it contains an OP_RETURN with data specially crafted to cause improper decode if the code does not catch it.</span></div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  txSave.vin[0].scriptSig = <a class="code" href="namespacetest__framework_1_1util.html#a7a98a073cd2a7a26b707f52d2fef01be">hex_str_to_bytes</a>(<span class="stringliteral">'6a143011020701010101010101020601010101010101'</span>)</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  rpc_result = self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">nodes</a>[0].<a class="code" href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a>(<a class="code" href="namespacetest__framework_1_1util.html#ae6b425a1e3feb505726ee64525523264">bytes_to_hex_str</a>(txSave.serialize()))</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(<span class="stringliteral">'OP_RETURN 3011020701010101010101020601010101010101'</span>, rpc_result[<span class="stringliteral">'vin'</span>][0][<span class="stringliteral">'scriptSig'</span>][<span class="stringliteral">'asm'</span>])</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classdecodescript_1_1DecodeScriptTest.html#a4925e9925d3ff0956d708d5473020d18"> 178</a></span>  <span class="keyword">def </span><a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a4925e9925d3ff0956d708d5473020d18">run_test</a>(self):</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a9fd19df4527578f7a303bb0241908518">decodescript_script_sig</a>()</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#a78deed8ce951dada97c69ff225bafb08">decodescript_script_pub_key</a>()</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  self.<a class="code" href="classdecodescript_1_1DecodeScriptTest.html#aba21f728e23fbe661bc6d0ffe8e290b6">decoderawtransaction_asm_sighashtype</a>()</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span> </div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">if</span> __name__ == <span class="stringliteral">'__main__'</span>:</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <a class="code" href="classdecodescript_1_1DecodeScriptTest.html">DecodeScriptTest</a>().<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a076857f5499c37bacf64a8ccb6ba5197">main</a>()</div><div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_a78deed8ce951dada97c69ff225bafb08"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#a78deed8ce951dada97c69ff225bafb08">decodescript.DecodeScriptTest.decodescript_script_pub_key</a></div><div class="ttdeci">def decodescript_script_pub_key(self)</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00055">decodescript.py:55</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1util_html_a7a98a073cd2a7a26b707f52d2fef01be"><div class="ttname"><a href="namespacetest__framework_1_1util.html#a7a98a073cd2a7a26b707f52d2fef01be">test_framework.util.hex_str_to_bytes</a></div><div class="ttdeci">def hex_str_to_bytes(hex_str)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00111">util.py:111</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1util_html_aa6b84bae918a356af030860efab10362"><div class="ttname"><a href="namespacetest__framework_1_1util.html#aa6b84bae918a356af030860efab10362">test_framework.util.start_nodes</a></div><div class="ttdeci">def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00305">util.py:305</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1test__framework_html"><div class="ttname"><a href="namespacetest__framework_1_1test__framework.html">test_framework.test_framework</a></div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00001">test_framework.py:1</a></div></div>
|
|
<div class="ttc" id="classtest__framework_1_1test__framework_1_1BitcoinTestFramework_html"><div class="ttname"><a href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html">test_framework.test_framework.BitcoinTestFramework</a></div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00032">test_framework.py:32</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html">decodescript.DecodeScriptTest</a></div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00011">decodescript.py:11</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_af287e0898ab8c7a0e8ec73443edb0e92"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#af287e0898ab8c7a0e8ec73443edb0e92">decodescript.DecodeScriptTest.setup_network</a></div><div class="ttdeci">def setup_network(self, split=False)</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00018">decodescript.py:18</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1util_html_a0d5c2187844d0b046113dbea6b956413"><div class="ttname"><a href="namespacetest__framework_1_1util.html#a0d5c2187844d0b046113dbea6b956413">test_framework.util.initialize_chain_clean</a></div><div class="ttdeci">def initialize_chain_clean(test_dir, num_nodes)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00252">util.py:252</a></div></div>
|
|
<div class="ttc" id="rawtransaction_8cpp_html_abd3d6aa800b863a2e503ef322d680d9b"><div class="ttname"><a href="rawtransaction_8cpp.html#abd3d6aa800b863a2e503ef322d680d9b">decoderawtransaction</a></div><div class="ttdeci">UniValue decoderawtransaction(const UniValue &params, bool fHelp)</div><div class="ttdef"><b>Definition:</b> <a href="rawtransaction_8cpp_source.html#l00460">rawtransaction.cpp:460</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_a4925e9925d3ff0956d708d5473020d18"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#a4925e9925d3ff0956d708d5473020d18">decodescript.DecodeScriptTest.run_test</a></div><div class="ttdeci">def run_test(self)</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00178">decodescript.py:178</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_a9d18333f972b3265043f6cee7ffd6a09"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#a9d18333f972b3265043f6cee7ffd6a09">decodescript.DecodeScriptTest.is_network_split</a></div><div class="ttdeci">is_network_split</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00020">decodescript.py:20</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_a9ea12e17527eb8d971101ed1184357ca"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#a9ea12e17527eb8d971101ed1184357ca">decodescript.DecodeScriptTest.nodes</a></div><div class="ttdeci">nodes</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00019">decodescript.py:19</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_a9fd19df4527578f7a303bb0241908518"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#a9fd19df4527578f7a303bb0241908518">decodescript.DecodeScriptTest.decodescript_script_sig</a></div><div class="ttdeci">def decodescript_script_sig(self)</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00022">decodescript.py:22</a></div></div>
|
|
<div class="ttc" id="classtest__framework_1_1test__framework_1_1BitcoinTestFramework_html_a076857f5499c37bacf64a8ccb6ba5197"><div class="ttname"><a href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a076857f5499c37bacf64a8ccb6ba5197">test_framework.test_framework.BitcoinTestFramework.main</a></div><div class="ttdeci">def main(self)</div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00097">test_framework.py:97</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_aba21f728e23fbe661bc6d0ffe8e290b6"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#aba21f728e23fbe661bc6d0ffe8e290b6">decodescript.DecodeScriptTest.decoderawtransaction_asm_sighashtype</a></div><div class="ttdeci">def decoderawtransaction_asm_sighashtype(self)</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00112">decodescript.py:112</a></div></div>
|
|
<div class="ttc" id="classtest__framework_1_1mininode_1_1CTransaction_html"><div class="ttname"><a href="classtest__framework_1_1mininode_1_1CTransaction.html">test_framework.mininode.CTransaction</a></div><div class="ttdef"><b>Definition:</b> <a href="mininode_8py_source.html#l00391">mininode.py:391</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1mininode_html"><div class="ttname"><a href="namespacetest__framework_1_1mininode.html">test_framework.mininode</a></div><div class="ttdef"><b>Definition:</b> <a href="mininode_8py_source.html#l00001">mininode.py:1</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1util_html"><div class="ttname"><a href="namespacetest__framework_1_1util.html">test_framework.util</a></div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00001">util.py:1</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1util_html_ad3df488aacbcdc741bbb9eb66caddd6b"><div class="ttname"><a href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">test_framework.util.assert_equal</a></div><div class="ttdeci">def assert_equal(thing1, thing2)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00461">util.py:461</a></div></div>
|
|
<div class="ttc" id="namespacedecodescript_html"><div class="ttname"><a href="namespacedecodescript.html">decodescript</a></div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00001">decodescript.py:1</a></div></div>
|
|
<div class="ttc" id="classdecodescript_1_1DecodeScriptTest_html_a23017eb529bde6b760fca7f2b3f670c7"><div class="ttname"><a href="classdecodescript_1_1DecodeScriptTest.html#a23017eb529bde6b760fca7f2b3f670c7">decodescript.DecodeScriptTest.setup_chain</a></div><div class="ttdeci">def setup_chain(self)</div><div class="ttdef"><b>Definition:</b> <a href="decodescript_8py_source.html#l00014">decodescript.py:14</a></div></div>
|
|
<div class="ttc" id="namespacetest__framework_1_1util_html_ae6b425a1e3feb505726ee64525523264"><div class="ttname"><a href="namespacetest__framework_1_1util.html#ae6b425a1e3feb505726ee64525523264">test_framework.util.bytes_to_hex_str</a></div><div class="ttdeci">def bytes_to_hex_str(byte_str)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00108">util.py:108</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_62ba24d7ce8eecc59962fe5b590c1065.html">qa</a></li><li class="navelem"><a class="el" href="dir_dbddb259b29a77ea11562b7a380aa303.html">rpc-tests</a></li><li class="navelem"><a class="el" href="decodescript_8py.html">decodescript.py</a></li>
|
|
<li class="footer">Generated on Thu Dec 14 2017 13:15:01 for Dash Core by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|