Skip to content

Commit

Permalink
Merge pull request #2170 from markblundeberg/revert-RPA
Browse files Browse the repository at this point in the history
Revert RPA changes (#2006 and fixes)
  • Loading branch information
cculianu committed Feb 16, 2021
2 parents f82b9e8 + b8a02d7 commit f6bbd9f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 611 deletions.
15 changes: 0 additions & 15 deletions electroncash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from functools import wraps

from . import bitcoin
from . import rpa
from . import util
from .address import Address, AddressError
from .bitcoin import hash_160, COIN, TYPE_ADDRESS
Expand Down Expand Up @@ -547,19 +546,6 @@ def _mktx(self, outputs, fee=None, change_addr=None, domain=None, nocheck=False,
self.wallet.save_transactions()
return tx

@command('w')
def rpa_generate_paycode(self):
return rpa.paycode.generate_paycode(self.wallet)

@command('w')
def rpa_generate_transaction_from_paycode(self, amount, paycode):
# WARNING: Amount is in full Bitcoin Cash units
return rpa.paycode.generate_transaction_from_paycode(self.wallet, self.config, amount, paycode)

@command('wp')
def rpa_extract_private_key_from_transaction(self, raw_tx, password=None):
return rpa.paycode.extract_private_key_from_transaction(self.wallet, raw_tx, password)

@command('wp')
def payto(self, destination, amount, fee=None, from_addr=None, change_addr=None, nocheck=False, unsigned=False, password=None, locktime=None,
op_return=None, op_return_raw=None, addtransaction=False):
Expand Down Expand Up @@ -890,7 +876,6 @@ def help(self):
'paid': (None, "Show only paid requests."),
'passphrase': (None, "Seed extension"),
'password': ("-W", "Password"),
'paycode': (None, 'RPA Resuable Payment Address Paycode'),
'payment_url': (None, 'Optional URL where you would like users to POST the BIP70 Payment message'),
'pending': (None, "Show only pending requests."),
'privkey': (None, "Private key. Set to '?' to get a prompt."),
Expand Down
14 changes: 2 additions & 12 deletions electroncash/keystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import inspect
from . import bitcoin
from .bitcoin import *

Expand Down Expand Up @@ -105,7 +104,7 @@ def decrypt_message(self, sequence, message, password):
decrypted = ec.decrypt_message(message)
return decrypted

def sign_transaction(self, tx, password, *, use_cache=False, ndata=None):
def sign_transaction(self, tx, password, *, use_cache=False):
if self.is_watching_only():
return
# Raise if password is not correct.
Expand All @@ -116,16 +115,7 @@ def sign_transaction(self, tx, password, *, use_cache=False, ndata=None):
keypairs[k] = self.get_private_key(v, password)
# Sign
if keypairs:
if ndata is not None:
# If we have ndata, check that the Transaction class passed to us supports ndata.
# Some extant plugins such as Flipstarter inherit from Transaction (reimplementing `sign`) and do not
# support this argument.
if 'ndata' not in inspect.signature(tx.sign, follow_wrapped=True).parameters:
raise RuntimeError(f'Transaction subclass "{tx.__class__.__name__}" does not support the "ndata" kwarg')
tx.sign(keypairs, use_cache=use_cache, ndata=ndata)
else:
# Regular transaction sign (no ndata supported or no ndata specified)
tx.sign(keypairs, use_cache=use_cache)
tx.sign(keypairs, use_cache=use_cache)


class Imported_KeyStore(Software_KeyStore):
Expand Down
9 changes: 0 additions & 9 deletions electroncash/rpa/__init__.py

This file was deleted.

180 changes: 0 additions & 180 deletions electroncash/rpa/addr.py

This file was deleted.

Loading

0 comments on commit f6bbd9f

Please sign in to comment.