aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/bipdersig-p2p.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-01-17 18:34:40 -0500
committerJohn Newbery <john@johnnewbery.com>2017-02-23 10:31:04 -0500
commit3f95a806b1cd2f3c944bda7bcc266498a59326e4 (patch)
treea1370c242d232e14a1c31a8bf203f7236342b953 /qa/rpc-tests/bipdersig-p2p.py
parent61a640ea9741e5e76b945699a8332b0a9923339b (diff)
Fix docstrings in qa tests
This commit fixes the module-level docstrings for the tests and helper modules in qa. Many of these tests were uncommented previously - this commit ensures that every test case has at least a minimum level of commenting.
Diffstat (limited to 'qa/rpc-tests/bipdersig-p2p.py')
-rwxr-xr-xqa/rpc-tests/bipdersig-p2p.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/qa/rpc-tests/bipdersig-p2p.py b/qa/rpc-tests/bipdersig-p2p.py
index 3bad5af5e6..b82ef89395 100755
--- a/qa/rpc-tests/bipdersig-p2p.py
+++ b/qa/rpc-tests/bipdersig-p2p.py
@@ -2,6 +2,19 @@
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+"""Test BIP66 (DER SIG).
+
+Connect to a single node.
+Mine 2 (version 2) blocks (save the coinbases for later).
+Generate 98 more version 2 blocks, verify the node accepts.
+Mine 749 version 3 blocks, verify the node accepts.
+Check that the new DERSIG rules are not enforced on the 750th version 3 block.
+Check that the new DERSIG rules are enforced on the 751st version 3 block.
+Mine 199 new version blocks.
+Mine 1 old-version block.
+Mine 1 new version block.
+Mine 1 old version block, see that the node rejects.
+"""
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
@@ -15,10 +28,10 @@ import time
# A canonical signature consists of:
# <30> <total len> <02> <len R> <R> <02> <len S> <S> <hashtype>
def unDERify(tx):
- '''
+ """
Make the signature in vin 0 of a tx non-DER-compliant,
by adding padding after the S-value.
- '''
+ """
scriptSig = CScript(tx.vin[0].scriptSig)
newscript = []
for i in scriptSig:
@@ -27,20 +40,6 @@ def unDERify(tx):
else:
newscript.append(i)
tx.vin[0].scriptSig = CScript(newscript)
-
-'''
-This test is meant to exercise BIP66 (DER SIG).
-Connect to a single node.
-Mine 2 (version 2) blocks (save the coinbases for later).
-Generate 98 more version 2 blocks, verify the node accepts.
-Mine 749 version 3 blocks, verify the node accepts.
-Check that the new DERSIG rules are not enforced on the 750th version 3 block.
-Check that the new DERSIG rules are enforced on the 751st version 3 block.
-Mine 199 new version blocks.
-Mine 1 old-version block.
-Mine 1 new version block.
-Mine 1 old version block, see that the node rejects.
-'''
class BIP66Test(ComparisonTestFramework):