You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the docs, Wallet.delete_key(), should return True if the account has been deleted.
Thus, if the wallet does not contain the account, then False is the expected return result.
However, Walletdelete_key() always returns True.
Your environment
py-algorand-sdk 2.1.2
algokit 1.0.1
Steps to reproduce
importunittestfromalgosdk.walletimportWalletfrombeakerimportsandboxclassKmdWalletDeleteKeyTestCase(unittest.TestCase):
deftest_delete_key(self):
kmd_client=sandbox.kmd.get_client()
# create new walletname="foo"password="bar"kmd_client.create_wallet(name, password)
wallet=Wallet(name, password, kmd_client)
# generate new wallet accountaddress=wallet.generate_key()
self.assertTrue(addressinwallet.list_keys())
# delete wallet accountself.assertTrue(wallet.delete_key(address))
self.assertFalse(addressinwallet.list_keys())
# delete wallet account againself.assertFalse(
wallet.delete_key(address),
"should return False because the wallet does not contain the account",
) # this assertion failsif__name__=="__main__":
unittest.main()
Expected behaviour
Wallet.delete_key(address) should return False if the wallet does not contain the specified address
Actual behaviour
Wallet.delete_key(address) always returns True, even if the wallet does not contain the specified address
The text was updated successfully, but these errors were encountered:
Hello, I would like to contribute to it. Can someone please show me the way forward to do it? I am quite a beginner in open source.
I can see @algoanne transferred this issue to the GO Language repository, so should I consider looking at that repository for the fix? Please let me know if I am missing some of the vital things to consider which will help me fix the issue.
Hi @yusharth, I transferred the issue from go-algorand to the python SDK. I believe the ideal fix should be done in this repository and you should not need to worry about go-algorand.
wallet.Wallet.delete_key() always return True
Per the docs,
Wallet.delete_key()
, should return True if the account has been deleted.Thus, if the wallet does not contain the account, then False is the expected return result.
However,
Walletdelete_key()
always returns True.Your environment
py-algorand-sdk 2.1.2
algokit 1.0.1
Steps to reproduce
Expected behaviour
Wallet.delete_key(address)
should return False if the wallet does not contain the specified addressActual behaviour
Wallet.delete_key(address)
always returns True, even if the wallet does not contain the specified addressThe text was updated successfully, but these errors were encountered: