def test_disallow(self): bts = self.bts acc = Account("bhive", hive_instance=bts) if sys.version > '3': _assertRaisesRegex = self.assertRaisesRegex else: _assertRaisesRegex = self.assertRaisesRegexp with _assertRaisesRegex(ValueError, ".*Changes nothing.*"): acc.disallow( "STX55VCzsb47NZwWe5F3qyQKedX9iHBHMVVFSc96PDvV7wuj7W86n", weight=1, threshold=1, permission="active" ) with _assertRaisesRegex(ValueError, ".*Changes nothing!.*"): acc.disallow( "STX6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", weight=1, threshold=1, permission="active" )
memo_privkey = memo_key.get_private_key() if useWallet: hv.wallet.addPrivateKey(owner_privkey) hv.wallet.addPrivateKey(active_privkey) hv.wallet.addPrivateKey(memo_privkey) hv.wallet.addPrivateKey(posting_privkey) else: hv = Hive(node=testnet_node, wif={ 'active': str(active_privkey), 'posting': str(posting_privkey), 'memo': str(memo_privkey) }) account = Account(username, hive_instance=hv) if account["name"] == "bhive": account.disallow("bhive1", permission='posting') account.allow('bhive1', weight=1, permission='posting', account=None) account.follow("bhive1") elif account["name"] == "bhive5": account.allow('bhive4', weight=2, permission='active', account=None) if useWallet: hv.wallet.getAccountFromPrivateKey(str(active_privkey)) # hv.create_account("bhive1", creator=account, password=password1) account1 = Account("bhive1", hive_instance=hv) b = Blockchain(hive_instance=hv) blocknum = b.get_current_block().identifier account.transfer("bhive1", 1, "HBD", "test") b1 = Block(blocknum, hive_instance=hv)