simplify add_keys
This commit is contained in:
parent
19e326c140
commit
45669dad33
1 changed files with 5 additions and 5 deletions
|
@ -489,12 +489,12 @@ class BaseDatabase(SQLiteMixin):
|
||||||
return addresses[0]
|
return addresses[0]
|
||||||
|
|
||||||
async def add_keys(self, account, chain, keys):
|
async def add_keys(self, account, chain, keys):
|
||||||
sql = "insert into pubkey_address (address, account, chain, position, pubkey) values (?, ?, ?, ?, ?)"
|
await self.db.executemany(
|
||||||
values = (
|
"insert into pubkey_address (address, account, chain, position, pubkey) values (?, ?, ?, ?, ?)",
|
||||||
(pubkey.address, account.public_key.address, chain, position, sqlite3.Binary(pubkey.pubkey_bytes))
|
((pubkey.address, account.public_key.address, chain,
|
||||||
for position, pubkey in keys
|
position, sqlite3.Binary(pubkey.pubkey_bytes))
|
||||||
|
for position, pubkey in keys)
|
||||||
)
|
)
|
||||||
await self.db.executemany(sql, values)
|
|
||||||
|
|
||||||
async def _set_address_history(self, address, history):
|
async def _set_address_history(self, address, history):
|
||||||
await self.db.execute(
|
await self.db.execute(
|
||||||
|
|
Loading…
Reference in a new issue