diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-02-06 00:29:32 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-02-06 00:29:32 -0800 |
commit | 3b224bb99db27971f4fc02b77390340c54bb6c99 (patch) | |
tree | 952d3e4e712f3acc611855d3f250e83d155c6d48 /tests/functional_tests | |
parent | Merge pull request #6053 (diff) | |
parent | wallet: allow message sign/verify for subaddresses (diff) | |
download | monero-3b224bb99db27971f4fc02b77390340c54bb6c99.tar.xz |
Merge pull request #6069
d64e5aa7 wallet: allow message sign/verify for subaddresses (moneromooo-monero)
Diffstat (limited to 'tests/functional_tests')
-rwxr-xr-x | tests/functional_tests/sign_message.py | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tests/functional_tests/sign_message.py b/tests/functional_tests/sign_message.py index de8f0cee2..9dd70f8bc 100755 --- a/tests/functional_tests/sign_message.py +++ b/tests/functional_tests/sign_message.py @@ -43,7 +43,8 @@ from framework.wallet import Wallet class MessageSigningTest(): def run_test(self): self.create() - self.check_signing() + self.check_signing(False) + self.check_signing(True) def create(self): print('Creating wallets') @@ -65,20 +66,34 @@ class MessageSigningTest(): assert res.address == self.address[i] assert res.seed == seeds[i] - def check_signing(self): - print('Signing/verifing messages') + def check_signing(self, subaddress): + print('Signing/verifing messages with ' + ('subaddress' if subaddress else 'standard address')) messages = ['foo', ''] + if subaddress: + address = [] + for i in range(2): + res = self.wallet[i].create_account() + if i == 0: + account_index = res.account_index + res = self.wallet[i].create_address(account_index = account_index) + if i == 0: + address_index = res.address_index + address.append(res.address) + else: + address = [self.address[0], self.address[1]] + account_index = 0 + address_index = 0 for message in messages: - res = self.wallet[0].sign(message) + res = self.wallet[0].sign(message, account_index = account_index, address_index = address_index) signature = res.signature for i in range(2): - res = self.wallet[i].verify(message, self.address[0], signature) + res = self.wallet[i].verify(message, address[0], signature) assert res.good - res = self.wallet[i].verify('different', self.address[0], signature) + res = self.wallet[i].verify('different', address[0], signature) assert not res.good - res = self.wallet[i].verify(message, self.address[1], signature) + res = self.wallet[i].verify(message, address[1], signature) assert not res.good - res = self.wallet[i].verify(message, self.address[0], signature + 'x') + res = self.wallet[i].verify(message, address[0], signature + 'x') assert not res.good if __name__ == '__main__': |