MCPcopy Create free account
hub / github.com/ElementsProject/elements / test_chain

Method test_chain

test/functional/rpc_packages.py:133–154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

131 assert_equal(testres_package_high_fee, testres_high_fee + self.independent_txns_testres_blank)
132
133 def test_chain(self):
134 node = self.nodes[0]
135 first_coin = self.coins.pop()
136 (chain_hex, chain_txns) = create_raw_chain(node, first_coin, self.address, self.privkeys)
137 self.log.info("Check that testmempoolaccept requires packages to be sorted by dependency")
138 assert_equal(node.testmempoolaccept(rawtxs=chain_hex[::-1]),
139 [{"txid": tx.rehash(), "wtxid": tx.getwtxid(), "package-error": "package-not-sorted"} for tx in chain_txns[::-1]])
140
141 self.log.info("Testmempoolaccept a chain of 25 transactions")
142 testres_multiple = node.testmempoolaccept(rawtxs=chain_hex)
143
144 testres_single = []
145 # Test accept and then submit each one individually, which should be identical to package test accept
146 for rawtx in chain_hex:
147 testres = node.testmempoolaccept([rawtx])
148 testres_single.append(testres[0])
149 # Submit the transaction now so its child should have no problem validating
150 node.sendrawtransaction(rawtx)
151 assert_equal(testres_single, testres_multiple)
152
153 # Clean up by clearing the mempool
154 self.generate(node, 1)
155
156 def test_multiple_children(self):
157 node = self.nodes[0]

Callers 1

run_testMethod · 0.95

Calls 7

create_raw_chainFunction · 0.90
assert_equalFunction · 0.90
infoMethod · 0.80
getwtxidMethod · 0.80
sendrawtransactionMethod · 0.80
rehashMethod · 0.45
generateMethod · 0.45

Tested by

no test coverage detected