From 565119960f2f41eeaf8dbf8f481607249dba5307 Mon Sep 17 00:00:00 2001 From: JeremyRand Date: Tue, 5 Nov 2019 10:00:38 +0000 Subject: [PATCH] (WIP) Namecoin: Handle Bitcoin Core style options in name_show TODO: Needs rebase once 5147, 5574, 5653, and 5660 merged upstream. --- electrum_nmc/electrum/commands.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/electrum_nmc/electrum/commands.py b/electrum_nmc/electrum/commands.py index 9a5973b94a23..0d8e7c41812b 100644 --- a/electrum_nmc/electrum/commands.py +++ b/electrum_nmc/electrum/commands.py @@ -1132,7 +1132,15 @@ async def getfeerate(self, fee_method=None, fee_level=None): return self.config.fee_per_kb(dyn=dyn, mempool=mempool, fee_level=fee_level) @command('n') - async def name_show(self, identifier, stream_id=None): + async def name_show(self, identifier, options=None, stream_id=None): + # Handle Bitcoin-Core-style options + if options is not None: + if "streamID" in options: + if stream_id is None: + stream_id = options["streamID"] + else: + raise Exception("stream_id specified in both Electrum and Core style") + # TODO: support non-ASCII encodings identifier_bytes = identifier.encode("ascii") sh = name_identifier_to_scripthash(identifier_bytes) @@ -1372,6 +1380,7 @@ def eval_bool(x: str) -> bool: 'value': (None, "The value to assign to the name"), 'trigger_txid':(None, "Broadcast the transaction when this txid reaches the specified number of confirmations"), 'trigger_name':(None, "Broadcast the transaction when this name reaches the specified number of confirmations"), + 'options': (None, "Options in Bitcoin-Core-style dict"), }