14 Finds and returns a sub array from an array of arrays. 15 to_match should be a unique idetifier of a sub array 18 for item
in object_array:
20 for key,value
in to_match.items():
21 if item[key] != value:
37 listreceivedbyaddress Test 54 {
"address":addr,
"account":
"",
"amount":Decimal(
"0.1"),
"confirmations":10,
"txids":[txid,]})
58 {
"address":addr,
"account":
"",
"amount":Decimal(
"0.1"),
"confirmations":10,
"txids":[txid,]})
66 {
"address":addr,
"account":
"",
"amount":0,
"confirmations":0,
"txids":[]})
69 getreceivedbyaddress Test 78 if balance != Decimal(
"0.0"):
79 raise AssertionError(
"Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance))
83 if balance != Decimal(
"0.1"):
84 raise AssertionError(
"Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance))
90 if balance != Decimal(
"0.1"):
91 raise AssertionError(
"Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance))
94 listreceivedbyaccount + getreceivedbyaccount Test 100 if len(received_by_account_json) == 0:
101 raise AssertionError(
"No accounts found in node")
110 received_by_account_json)
114 if balance != balance_by_account:
115 raise AssertionError(
"Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance))
122 {
"account":received_by_account_json[
"account"],
"amount":(received_by_account_json[
"amount"] + Decimal(
"0.1"))})
126 if balance != balance_by_account + Decimal(
"0.1"):
127 raise AssertionError(
"Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance))
132 if len(received_by_account_json) == 0:
133 raise AssertionError(
"No accounts found in node")
136 if received_by_account_json[
"amount"] != Decimal(
"0.0"):
137 raise AssertionError(
"Wrong balance returned by listreceivedbyaccount, %0.2f"%(received_by_account_json[
"amount"]))
141 if balance != Decimal(
"0.0"):
142 raise AssertionError(
"Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance))
144 if __name__ ==
'__main__':
UniValue listreceivedbyaccount(const UniValue ¶ms, bool fHelp)
def assert_array_result(object_array, to_match, expected, should_not_find=False)
UniValue getreceivedbyaccount(const UniValue ¶ms, bool fHelp)
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None)
UniValue getreceivedbyaddress(const UniValue ¶ms, bool fHelp)
UniValue getaccount(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 get_sub_array_from_array(object_array, to_match)
UniValue generate(const UniValue ¶ms, bool fHelp)
UniValue listreceivedbyaddress(const UniValue ¶ms, bool fHelp)