コード例 #1
0
ファイル: two_of_three.py プロジェクト: tester3418/garecovery
    def __init__(self, keyset, witness_type, vout, tx, dest_address):
        assert vout < wally.tx_get_num_outputs(tx)

        self.keyset = keyset
        self.vout = vout
        self.tx = tx
        self.txhash_bin = txutil.get_txhash_bin(tx)
        self.dest_address = dest_address
        self.witness = self.keyset.witnesses[witness_type]
コード例 #2
0
ファイル: test_2of3.py プロジェクト: jsv/garecovery
 def _get_unspent(self, address):
     imported = self.imported.get(address, None)
     if imported is None:
         return None
     tx, i = imported
     script = wally.tx_get_output_script(tx, i)
     return {
         "txid": txutil.get_txhash_bin(tx),
         "vout": i,
         "address": address,
         "scriptPubKey": wally.hex_from_bytes(script)
     }
コード例 #3
0
ファイル: test_2of3.py プロジェクト: zhoudaqing/garecovery
    def __init__(self, txfile):
        self.tx_by_id = {}
        self.txout_by_address = {}
        for line in open(datafile(txfile)).readlines():
            tx = txutil.from_hex(line.strip())
            self.tx_by_id[txutil.get_txhash_bin(tx)] = tx
            for i in range(wally.tx_get_num_outputs(tx)):
                addr = txutil.get_output_address(tx, i, gaconstants.ADDR_VERSIONS_TESTNET)
                self.txout_by_address[addr] = (tx, i)
        self.imported = {}

        # This is something of a workaround because all the existing tests are based on generating
        # txs where nlocktime was fixed as 0. The code changed to use current blockheight, so by
        # fudging this value to 0 the existing tests don't notice the difference
        self.getblockcount.return_value = 0