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

Method test_pegout

test/functional/feature_fedpeg.py:169–185  ·  view source on GitHub ↗
(self, parent_chain_addr, sidechain)

Source from the content-addressed store, hash-verified

167 print("Setting up network done")
168
169 def test_pegout(self, parent_chain_addr, sidechain):
170 pegout_txid = sidechain.sendtomainchain(parent_chain_addr, 1)
171 raw_pegout = sidechain.getrawtransaction(pegout_txid, True)
172 assert 'vout' in raw_pegout and len(raw_pegout['vout']) > 0
173 pegout_tested = False
174 for output in raw_pegout['vout']:
175 scriptPubKey = output['scriptPubKey']
176 if 'type' in scriptPubKey and scriptPubKey['type'] == 'nulldata':
177 assert 'pegout_hex' in scriptPubKey and 'pegout_asm' in scriptPubKey and 'pegout_type' in scriptPubKey
178 assert 'pegout_chain' in scriptPubKey and 'pegout_address' in scriptPubKey
179 assert scriptPubKey['pegout_chain'] == self.parentgenesisblockhash
180 assert parent_chain_addr == scriptPubKey['pegout_address']
181 pegout_tested = True
182 break
183 assert pegout_tested
184 self.generatetoaddress(self.nodes[2], 1, sidechain.getnewaddress(), sync_fun=self.no_op)
185 assert_equal(sidechain.gettransaction(pegout_txid)["confirmations"], 1)
186
187 def run_test(self):
188 self.import_deterministic_coinbase_privkeys() # Create wallets for all nodes

Callers 1

run_testMethod · 0.95

Calls 2

assert_equalFunction · 0.90
generatetoaddressMethod · 0.45

Tested by

no test coverage detected