Compare commits

...
Author SHA1 Message Date
jessop 2a5b5859a0 add preference clear - remove individual preference 2020-02-21 18:35:02 -05:00
Jack Robison c1153302aa v0.60.1 2020-02-21 16:13:30 -05:00
Victor Shyba 1086a3297f check its broadcasted and use a retriable call 2020-02-21 17:51:46 -03:00
Jack Robison 5c613934ca Revert "v0.60.1"
This reverts commit 7f03b13579.
2020-02-21 15:05:33 -05:00
Jack Robison 6d7e9092f8 Merge pull request #2825 from lbryio/tx_from_stream_controller
use the stream controller tx instead of local history
2020-02-21 15:04:57 -05:00
4 changed files with 30 additions and 2 deletions

No files matched your search

+19
View File
@@ -1151,6 +1151,25 @@ class Daemon(metaclass=JSONRPCServerType):
wallet.save()
return {key: value}
def jsonrpc_preference_clear(self, key, wallet_id=None):
"""
Clear daemon preference
Usage:
preference_clear (<key>) [--wallet_id=<wallet_id>]
Options:
--key=<key> : (str) key associated with value
--wallet_id=<wallet_id> : (str) restrict operation to specific wallet
Returns:
(dict) Updated dictionary of daemon preferences
"""
wallet = self.wallet_manager.get_wallet_or_default(wallet_id)
del wallet.preferences[key]
wallet.save()
return wallet.preferences.to_dict_without_ts()
WALLET_DOC = """
Create, modify and inspect wallets.
"""
+1 -1
View File
@@ -29,7 +29,7 @@ class WalletServerPayer:
async def pay(self):
while self.running:
await asyncio.sleep(self.payment_period)
features = await self.ledger.network.get_server_features()
features = await self.ledger.network.retriable_call(self.ledger.network.get_server_features)
address = features['payment_address']
amount = str(features['daily_fee'])
if not address or not amount:
@@ -239,6 +239,14 @@ class WalletEncryptionAndSynchronization(CommandTestCase):
{"one": "1", "two": "2", "conflict": "2", "another": "B", "fruit": ["peach", "apricot"]}
)
daemon.jsonrpc_preference_clear("one")
self.assertDictEqual(
# "two" key added and "conflict" value changed to "2"
daemon.jsonrpc_preference_get(),
{"two": "2", "conflict": "2", "another": "B", "fruit": ["peach", "apricot"]}
)
# Channel Certificate
channel = await daemon2.jsonrpc_channel_create('@foo', '0.1')
await self.confirm_tx(channel.id, self.daemon2.ledger)
@@ -67,7 +67,7 @@ class TestUsagePayment(CommandTestCase):
await wallet_pay_service.stop()
await wallet_pay_service.start(ledger=self.ledger, wallet=self.wallet)
address = (await self.account.receiving.get_addresses(limit=1, only_usable=True))[0]
address = await self.blockchain.get_raw_change_address()
_, history = await self.ledger.get_local_status_and_history(address)
self.assertEqual(history, [])
@@ -91,5 +91,6 @@ class TestUsagePayment(CommandTestCase):
self.assertEqual(features["payment_address"], address)
self.assertEqual(features["daily_fee"], "1.0")
tx = await asyncio.wait_for(wallet_pay_service.on_payment.first, timeout=3)
self.assertIsNotNone(await self.blockchain.get_raw_transaction(tx.id)) # verify its broadcasted
self.assertEqual(tx.outputs[0].amount, 100000000)
self.assertEqual(tx.outputs[0].get_address(self.ledger), address)