aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-05-20 21:43:09 +0000
committerSarang Noether <32460187+SarangNoether@users.noreply.github.com>2020-08-28 19:25:17 -0400
commit743608ec16e27a3c1ca2febd4e80391a32c23efd (patch)
treed8b4f65cc302f765f7fd97aca7ef6189065307e3 /tests/functional_tests
parentMerge pull request #6787 (diff)
downloadmonero-743608ec16e27a3c1ca2febd4e80391a32c23efd.tar.xz
wallet: allow signing a message with spend or view key
Diffstat (limited to 'tests/functional_tests')
-rwxr-xr-xtests/functional_tests/sign_message.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/functional_tests/sign_message.py b/tests/functional_tests/sign_message.py
index 7ce2f2c18..73c714450 100755
--- a/tests/functional_tests/sign_message.py
+++ b/tests/functional_tests/sign_message.py
@@ -43,8 +43,10 @@ from framework.wallet import Wallet
class MessageSigningTest():
def run_test(self):
self.create()
- self.check_signing(False)
- self.check_signing(True)
+ self.check_signing(False, False)
+ self.check_signing(False, True)
+ self.check_signing(True, False)
+ self.check_signing(True, True)
def create(self):
print('Creating wallets')
@@ -66,8 +68,8 @@ class MessageSigningTest():
assert res.address == self.address[i]
assert res.seed == seeds[i]
- def check_signing(self, subaddress):
- print('Signing/verifing messages with ' + ('subaddress' if subaddress else 'standard address'))
+ def check_signing(self, subaddress, spend_key):
+ print('Signing/verifing messages with ' + ('subaddress' if subaddress else 'standard address') + ' ' + ('spend key' if spend_key else 'view key'))
messages = ['foo', '']
if subaddress:
address = []
@@ -84,11 +86,14 @@ class MessageSigningTest():
account_index = 0
address_index = 0
for message in messages:
- res = self.wallet[0].sign(message, account_index = account_index, address_index = address_index)
+ res = self.wallet[0].sign(message, account_index = account_index, address_index = address_index, signature_type = 'spend' if spend_key else 'view')
signature = res.signature
for i in range(2):
res = self.wallet[i].verify(message, address[0], signature)
assert res.good
+ assert not res.old
+ assert res.version == 2
+ assert res.signature_type == 'spend' if spend_key else 'view'
res = self.wallet[i].verify('different', address[0], signature)
assert not res.good
res = self.wallet[i].verify(message, address[1], signature)