14 """Return curr_balance after asserting the fee was in range""" 15 fee = balance_with_fee - curr_balance
16 target_fee = fee_per_byte * tx_size
18 raise AssertionError(
"Fee of %s DASH too low! (Should be %s DASH)"%(str(fee), str(target_fee)))
20 if fee > fee_per_byte * (tx_size + 2):
21 raise AssertionError(
"Fee of %s DASH too high! (Should be %s DASH)"%(str(fee), str(target_fee)))
25 print(
"Initializing test directory "+self.options.tmpdir)
43 print "Mining blocks..." 78 unspent_0 = {
"txid": unspent_0[
"txid"],
"vout": unspent_0[
"vout"]}
102 for utxo
in node0utxos:
105 inputs.append({
"txid" : utxo[
"txid"],
"vout" : utxo[
"vout"]})
124 fee_per_byte = Decimal(
'0.001') / 1000
136 node_2_bal -= Decimal(
'100')
141 txid = self.
nodes[2].
sendmany(
'from1', {address: 100}, 0,
False,
"", [])
144 node_0_bal += Decimal(
'100')
149 txid = self.
nodes[2].
sendmany(
'from1', {address: 100}, 0,
False,
"", [address])
152 node_2_bal -= Decimal(
'100')
184 inputs = [{
"txid":usp[0][
'txid'],
"vout":usp[0][
'vout']}]
191 zeroValueTxid= decRawTx[
'txid']
200 for uTx
in unspentTxs:
201 if uTx[
'txid'] == zeroValueTxid:
209 self.
nodes =
start_nodes(3, self.options.tmpdir, [[
"-walletbroadcast=0"],[
"-walletbroadcast=0"],[
"-walletbroadcast=0"]])
264 except JSONRPCException
as e:
265 assert(
"Invalid amount" in e.error[
'message'])
267 raise AssertionError(
"Must not parse invalid amounts")
272 raise AssertionError(
"Must not accept strings as numeric")
273 except JSONRPCException
as e:
274 assert(
"not an integer" in e.error[
'message'])
291 {
"address": address_to_import},
292 {
"spendable":
False})
300 {
"address": address_to_import},
313 for mode
in [
True,
False]:
314 self.
nodes[0].ensure_ascii = mode
316 for s
in [
u'рыба',
u'𝅘𝅥𝅯']:
321 self.
nodes[0].ensure_ascii =
True 331 for m
in maintenance:
336 while m ==
'-reindex' and [block_count] * 3 != [self.
nodes[i].
getblockcount()
for i
in range(3)]:
345 assert_equal(coinbase_tx_1[
"transactions"][0][
"blockhash"], blocks[1])
348 if __name__ ==
'__main__':
349 WalletTest ().main ()
UniValue importprivkey(const UniValue ¶ms, bool fHelp)
UniValue resendwallettransactions(const UniValue ¶ms, bool fHelp)
UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp)
def count_bytes(hex_string)
def assert_array_result(object_array, to_match, expected, should_not_find=False)
UniValue validateaddress(const UniValue ¶ms, bool fHelp)
UniValue settxfee(const UniValue ¶ms, bool fHelp)
UniValue dumpprivkey(const UniValue ¶ms, bool fHelp)
UniValue getbalance(const UniValue ¶ms, bool fHelp)
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None)
def assert_raises(exc, fun, args, kwds)
UniValue getrawtransaction(const UniValue ¶ms, bool fHelp)
UniValue listaccounts(const UniValue ¶ms, bool fHelp)
UniValue getaccount(const UniValue ¶ms, bool fHelp)
UniValue sendmany(const UniValue ¶ms, bool fHelp)
UniValue listunspent(const UniValue ¶ms, bool fHelp)
UniValue getaccountaddress(const UniValue ¶ms, bool fHelp)
UniValue sendtoaddress(const UniValue ¶ms, bool fHelp)
UniValue getnewaddress(const UniValue ¶ms, bool fHelp)
def sync_mempools(rpc_connections, wait=1)
UniValue getblockcount(const UniValue ¶ms, bool fHelp)
def initialize_chain_clean(test_dir, num_nodes)
UniValue getwalletinfo(const UniValue ¶ms, bool fHelp)
UniValue listlockunspent(const UniValue ¶ms, bool fHelp)
UniValue signrawtransaction(const UniValue ¶ms, bool fHelp)
UniValue createrawtransaction(const UniValue ¶ms, bool fHelp)
UniValue listsinceblock(const UniValue ¶ms, bool fHelp)
UniValue decoderawtransaction(const UniValue ¶ms, bool fHelp)
UniValue importaddress(const UniValue ¶ms, bool fHelp)
UniValue lockunspent(const UniValue ¶ms, bool fHelp)
def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=None)
UniValue generate(const UniValue ¶ms, bool fHelp)
UniValue sendrawtransaction(const UniValue ¶ms, bool fHelp)
def sync_blocks(rpc_connections, wait=1)
UniValue getrawmempool(const UniValue ¶ms, bool fHelp)
def setup_network(self, split=False)
def assert_equal(thing1, thing2)
def connect_nodes_bi(nodes, a, b)
UniValue gettransaction(const UniValue ¶ms, bool fHelp)
def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size)