@@ -290,6 +290,20 @@ def run_test(self):
290290 # Default "blind" value is true, omitting explicit argument for last
291291 process_raw_issuance (self .nodes [0 ], [{"asset_amount" : 1 , "asset_address" : nonblind_addr , "token_amount" :2 , "token_address" :blind_addr , "blind" :True }, {"asset_amount" :3 , "asset_address" :nonblind_addr , "blind" :True }, {"asset_amount" :4 , "asset_address" :nonblind_addr , "token_amount" :5 , "token_address" :blind_addr , "blind" :True }, {"asset_amount" :6 , "asset_address" :nonblind_addr , "token_amount" :7 , "token_address" :blind_addr , "blind" :True }, {"asset_amount" :8 , "asset_address" :nonblind_addr , "token_amount" :9 , "token_address" :blind_addr }])
292292
293+ # Make sure that invalid addresses are rejected.
294+ valid_addr = self .nodes [0 ].getnewaddress ()
295+ raw_tx = self .nodes [0 ].createrawtransaction ([], {valid_addr : Decimal ("1" )})
296+ funded_tx = raw_tx #self.nodes[0].fundrawtransaction(raw_tx, {"feeRate": Decimal('0.00050000')})['hex']
297+ assert_raises_rpc_error (- 8 , "Invalid asset address provided: foobar" ,
298+ self .nodes [0 ].rawissueasset , funded_tx , [{"asset_amount" : 1 , "asset_address" : "foobar" }])
299+ assert_raises_rpc_error (- 8 , "Invalid token address provided: foobar" ,
300+ self .nodes [0 ].rawissueasset , funded_tx , [{"token_amount" : 1 , "token_address" : "foobar" }])
301+ # Also test for missing value.
302+ assert_raises_rpc_error (- 8 , "Invalid parameter, missing corresponding asset_address" ,
303+ self .nodes [0 ].rawissueasset , funded_tx , [{"asset_amount" : 1 , "token_address" : valid_addr }])
304+ assert_raises_rpc_error (- 8 , "Invalid parameter, missing corresponding token_address" ,
305+ self .nodes [0 ].rawissueasset , funded_tx , [{"token_amount" : 1 , "asset_address" : valid_addr }])
306+
293307 # Make sure contract hash is being interpreted as expected, resulting in different asset ids
294308 raw_tx = self .nodes [0 ].createrawtransaction ([], {nonblind_addr :self .nodes [0 ].getbalance ()['bitcoin' ]- 1 })
295309 funded_tx = self .nodes [0 ].fundrawtransaction (raw_tx )['hex' ]
0 commit comments