Skip to content

Commit

Permalink
(WIP) Namecoin: Handle Bitcoin Core style options in name_show
Browse files Browse the repository at this point in the history
TODO: Needs rebase once 5147, 5574, 5653, and 5660 merged upstream.
  • Loading branch information
JeremyRand committed Nov 5, 2019
1 parent 9f3bb89 commit 5651199
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion electrum_nmc/electrum/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"),
}


Expand Down

0 comments on commit 5651199

Please sign in to comment.