algorand / algorand/py-algorand-sdk

Python algosdk wallet.Wallet.delete_key() always returns True

オープン
#472 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug good first issue
主要言語
Python
スター
274
フォーク
145
平均マージ
3時間 1分
マージ済み PR(30日)
2

説明

### 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

```python
import unittest

from algosdk.wallet import Wallet
from beaker import sandbox

class KmdWalletDeleteKeyTestCase(unittest.TestCase):
def test_delete_key(self):
kmd_client = sandbox.kmd.get_client()

# create new wallet
name = "foo"
password = "bar"
kmd_client.create_wallet(name, password)
wallet = Wallet(name, password, kmd_client)

# generate new wallet account
address = wallet.generate_key()
self.assertTrue(address in wallet.list_keys())

# delete wallet account
self.assertTrue(wallet.delete_key(address))
self.assertFalse(address in wallet.list_keys())

# delete wallet account again
self.assertFalse(
wallet.delete_key(address),
"should return False because the wallet does not contain the account",
) # this assertion fails

if __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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。