forked from LBRYCommunity/lbry-sdk
account_add fix
This commit is contained in:
parent
5cdfbcc88e
commit
cc2837c021
1 changed files with 9 additions and 18 deletions
|
@ -989,8 +989,7 @@ class API:
|
|||
|
||||
"""
|
||||
wallet = self.wallets.get_or_default(wallet_id)
|
||||
account = await Account.from_dict(
|
||||
self.ledger, wallet, {
|
||||
return await wallet.accounts.add_from_dict({
|
||||
'name': account_name,
|
||||
'seed': seed,
|
||||
'private_key': private_key,
|
||||
|
@ -998,12 +997,7 @@ class API:
|
|||
'address_generator': {
|
||||
'name': SingleKey.name if single_key else HierarchicalDeterministic.name
|
||||
}
|
||||
}
|
||||
)
|
||||
wallet.save()
|
||||
if self.ledger.sync.network.is_connected:
|
||||
await self.ledger.subscribe_account(account)
|
||||
return account
|
||||
})
|
||||
|
||||
async def account_create(
|
||||
self,
|
||||
|
@ -1046,10 +1040,7 @@ class API:
|
|||
|
||||
"""
|
||||
wallet = self.wallets.get_or_default(wallet_id)
|
||||
account = wallet.accounts.get_account_or_error(account_id)
|
||||
wallet.accounts.remove(account)
|
||||
await wallet.save()
|
||||
return account
|
||||
return await wallet.accounts.remove(account_id)
|
||||
|
||||
async def account_set(
|
||||
self,
|
||||
|
|
Loading…
Reference in a new issue