Skip to content
Permalink
Browse files

update 202

  • Loading branch information...
bitzec committed Dec 2, 2018
1 parent 2e4a33a commit 7defe00a89cab27a139c049ff2d2d41be3e4bdb5
Showing with 10 additions and 4 deletions.
  1. +3 −0 qa/rpc-tests/test_framework/mininode.py
  2. +6 −3 qa/rpc-tests/test_framework/util.py
  3. +1 −1 src/bitcoind.cpp
@@ -1324,6 +1324,7 @@ def create_callback_map(self):
"alert": self.on_alert,
"inv": self.on_inv,
"getdata": self.on_getdata,
"notfound": self.on_notfound,
"getblocks": self.on_getblocks,
"tx": self.on_tx,
"block": self.on_block,
@@ -1366,6 +1367,7 @@ def on_inv(self, conn, message):
def on_addr(self, conn, message): pass
def on_alert(self, conn, message): pass
def on_getdata(self, conn, message): pass
def on_notfound(self, conn, message): pass
def on_getblocks(self, conn, message): pass
def on_tx(self, conn, message): pass
def on_block(self, conn, message): pass
@@ -1391,6 +1393,7 @@ class NodeConn(asyncore.dispatcher):
"alert": msg_alert,
"inv": msg_inv,
"getdata": msg_getdata,
"notfound": msg_notfound,
"getblocks": msg_getblocks,
"tx": msg_tx,
"block": msg_block,
@@ -355,11 +355,11 @@ def random_transaction(nodes, amount, min_fee, fee_increment, fee_variants):

return (txid, signresult["hex"], fee)

def assert_equal(expected, actual, message = ""):
def assert_equal(expected, actual, message=""):
if expected != actual:
if message:
message = "%s; " % message
raise AssertionError("%sexpected: <%s> but was: <%s>" % (message, str(expected), str(actual)))
message = "; %s" % message
raise AssertionError("(left == right)%s\n left: <%s>\n right: <%s>" % (message, str(expected), str(actual)))

def assert_true(condition, message = ""):
if not condition:
@@ -382,6 +382,9 @@ def assert_raises(exc, fun, *args, **kwds):
else:
raise AssertionError("No exception raised")

def fail(message=""):
raise AssertionError(message)

# Returns txid if operation was a success or None
def wait_and_assert_operationid_status(node, myopid, in_status='success', in_errormsg=None, timeout=300):
print('waiting for async operation {}'.format(myopid))
@@ -87,7 +87,7 @@ bool AppInit(int argc, char* argv[])
}

fprintf(stdout, "%s", strUsage.c_str());
return false;
return true;
}

try

0 comments on commit 7defe00

Please sign in to comment.
You can’t perform that action at this time.