Skip to content

Commit e0f7c80

Browse files
committed
WIP: fix functional tests
1 parent e0b70c8 commit e0f7c80

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

src/init.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,11 +888,6 @@ void InitParameterInteraction()
888888
for (const auto& arg : gArgs.GetUnsuitableSectionOnlyArgs()) {
889889
InitWarning(strprintf(_("Config setting for %s only applied on %s network when in [%s] section."), arg, network, network));
890890
}
891-
892-
// Warn if unrecognized section name are present in the config file.
893-
for (const auto& section : gArgs.GetUnrecognizedSections()) {
894-
InitWarning(strprintf(_("Section [%s] is not recognized."), section));
895-
}
896891
}
897892

898893
static std::string ResolveErrMsg(const char * const optname, const std::string& strBind)

test/functional/data/invalid_txs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class BadTxTemplate:
4747

4848
def __init__(self, *, spend_tx=None, spend_block=None):
4949
self.spend_tx = spend_block.vtx[0] if spend_block else spend_tx
50-
self.spend_avail = sum(o.nValue for o in self.spend_tx.vout)
50+
self.spend_avail = sum(o.nValue.getAmount() for o in self.spend_tx.vout)
5151
self.valid_txin = CTxIn(COutPoint(self.spend_tx.sha256, 0), b"", 0xffffffff)
5252

5353
@abc.abstractmethod
@@ -135,7 +135,8 @@ def get_tx(self):
135135

136136

137137
class SpendTooMuch(BadTxTemplate):
138-
reject_reason = 'bad-txns-in-belowout'
138+
# ELEMENTS: block amount checks are queued, so this is an aggregated error code
139+
reject_reason = 'block-validation-failed'
139140
expect_disconnect = True
140141

141142
def get_tx(self):

test/functional/feature_mandatory_coinbase.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def b2x(b):
2323
def assert_template(node, block, expect, rehash=True):
2424
if rehash:
2525
block.hashMerkleRoot = block.calc_merkle_root()
26-
rsp = node.getblocktemplate({'data': b2x(block.serialize()), 'mode': 'proposal'})
26+
rsp = node.getblocktemplate({'data': b2x(block.serialize()), 'mode': 'proposal', 'rules': 'segwit'})
2727
assert_equal(rsp, expect)
2828

2929
class MandatoryCoinbaseTest(BitcoinTestFramework):
@@ -51,7 +51,7 @@ def run_test(self):
5151

5252
# Have non-mandatory node make a template
5353
self.sync_all()
54-
tmpl = node1.getblocktemplate()
54+
tmpl = node1.getblocktemplate({'rules': 'segwit'})
5555

5656
# We make a block with OP_TRUE coinbase output that will fail on node0
5757
coinbase_tx = create_coinbase(height=int(tmpl["height"]))
@@ -86,7 +86,7 @@ def run_test(self):
8686
#
8787
# Also test that coinbases can't have fees.
8888
self.sync_all()
89-
tmpl = node1.getblocktemplate()
89+
tmpl = node1.getblocktemplate({'rules': 'segwit'})
9090
coinbase_tx = create_coinbase(height=int(tmpl["height"]))
9191
# sequence numbers must not be max for nLockTime to have effect
9292
coinbase_tx.vin[0].nSequence = 2 ** 32 - 2

test/functional/test_framework/messages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ def deserialize(self, f):
716716
self.wit = CTxWitness()
717717
if flags > 1:
718718
raise TypeError('Extra witness flags:' + str(flags))
719-
self.nLockTime = struct.unpack("<I", f.read(4))[0]
720719
self.sha256 = None
721720
self.hash = None
722721

@@ -907,7 +906,7 @@ def __repr__(self):
907906
time.ctime(self.nTime), self.block_height)
908907

909908
BLOCK_HEADER_SIZE = len(CBlockHeader().serialize())
910-
assert_equal(BLOCK_HEADER_SIZE, 80)
909+
assert_equal(BLOCK_HEADER_SIZE, 79)
911910

912911
class CBlock(CBlockHeader):
913912
__slots__ = ("vtx",)

0 commit comments

Comments
 (0)