(self)
| 40 | self.skip_if_no_bdb() |
| 41 | |
| 42 | def run_test(self): |
| 43 | feerate = 1.0 |
| 44 | |
| 45 | node0 = self.nodes[0] |
| 46 | node1 = self.nodes[1] |
| 47 | node2 = self.nodes[2] |
| 48 | |
| 49 | self.generate(node0, 101) |
| 50 | balance = node0.getbalance() |
| 51 | assert_equal(balance['bitcoin'], 21000000) |
| 52 | |
| 53 | self.log.info("Create UTXOs") |
| 54 | many = {} |
| 55 | num = 25 |
| 56 | for i in range(num): |
| 57 | addr = node0.getnewaddress() |
| 58 | info = node0.getaddressinfo(addr) |
| 59 | many[info['unconfidential']] = 1 |
| 60 | for i in range(10): |
| 61 | addr = node1.getnewaddress() |
| 62 | info = node1.getaddressinfo(addr) |
| 63 | many[info['unconfidential']] = 1 |
| 64 | for i in range(10): |
| 65 | addr = node2.getnewaddress() |
| 66 | info = node2.getaddressinfo(addr) |
| 67 | many[info['unconfidential']] = 1 |
| 68 | |
| 69 | txid = node0.sendmany("", many) |
| 70 | self.generate(node0, 1) |
| 71 | |
| 72 | self.log.info("Send explicit tx to node 0") |
| 73 | addr = node0.getnewaddress() |
| 74 | info = node0.getaddressinfo(addr) |
| 75 | txid = node0.sendtoaddress(info['unconfidential'], 1.0, "", "", False, None, None, None, None, None, None, feerate) |
| 76 | tx = node0.gettransaction(txid, True, True) |
| 77 | decoded = tx['decoded'] |
| 78 | vin = decoded['vin'] |
| 79 | vout = decoded['vout'] |
| 80 | assert_equal(len(vin), 2) |
| 81 | assert_equal(len(vout), 3) |
| 82 | assert_equal(tx['fee']['bitcoin'], Decimal('-0.00000326')) |
| 83 | assert_equal(decoded['vsize'], 326) |
| 84 | # tx weight can be 1301 or 1302, accept both |
| 85 | assert_approx(decoded['weight'], 1301.5, 0.5) |
| 86 | self.generate(node0, 1) |
| 87 | tx = node1.getrawtransaction(txid, True) |
| 88 | # tx discountweight can be 1301 or 1302, accept both |
| 89 | assert_approx(tx['discountweight'], 1301.5, 0.5) |
| 90 | assert_equal(tx['discountvsize'], 326) |
| 91 | |
| 92 | self.log.info("Send confidential tx to node 0") |
| 93 | addr = node0.getnewaddress() |
| 94 | info = node0.getaddressinfo(addr) |
| 95 | txid = node0.sendtoaddress(info['confidential'], 1.0, "", "", False, None, None, None, None, None, None, feerate) |
| 96 | tx = node0.gettransaction(txid, True, True) |
| 97 | decoded = tx['decoded'] |
| 98 | vin = decoded['vin'] |
| 99 | vout = decoded['vout'] |
nothing calls this directly
no test coverage detected