chore(tests): remove Lisk

pull/1612/head
matejcik 3 years ago committed by matejcik
parent ee068b01ea
commit d66cca4069

@ -6,7 +6,6 @@ decred
eos
ethereum
komodo
lisk
monero
multisig
nem

@ -24,7 +24,6 @@ from trezorlib import (
ethereum,
fido,
firmware,
lisk,
misc,
monero,
nem,
@ -52,7 +51,6 @@ MODULES = (
ethereum,
fido,
firmware,
lisk,
misc,
monero,
nem,

@ -1,36 +0,0 @@
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import pytest
from trezorlib import lisk
from trezorlib.tools import parse_path
@pytest.mark.altcoin
@pytest.mark.lisk
@pytest.mark.parametrize(
"path, address",
(
("m/44h/134h/0h", "3685460048641680438L"),
("m/44h/134h/1h", "2178885030141662239L"),
("m/44h/134h/100h", "7191894793645699638L"),
("m/44h/1h/0h", "8365436719773013410L"),
),
)
def test_lisk_getaddress(client, path, address):
address_n = parse_path(path)
assert lisk.get_address(client, address_n) == address

@ -1,30 +0,0 @@
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import pytest
from trezorlib import lisk
from trezorlib.tools import parse_path
@pytest.mark.altcoin
@pytest.mark.lisk
def test_lisk_get_public_key(client):
sig = lisk.get_public_key(client, parse_path("m/44h/134h/0h"))
assert (
sig.public_key.hex()
== "68ffcc8fd29675264ba2c01e0926697b66b197179e130d4996ee07cd13892c1c"
)

@ -1,46 +0,0 @@
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import pytest
from trezorlib import lisk
from trezorlib.tools import parse_path
LISK_PATH = parse_path("m/44h/134h/0h")
LISK_PUBKEY = "68ffcc8fd29675264ba2c01e0926697b66b197179e130d4996ee07cd13892c1c"
@pytest.mark.altcoin
@pytest.mark.lisk
@pytest.mark.parametrize(
"message, signature",
(
pytest.param(
"This is an example of a signed message.",
"96dbdc588b6ec21a17b3d6d6c3c323179376302094c1125f106c9df2d44df9e8f579c8ea241caed7796feb490a7f3ffb8ff4a54a1f8cc437fa59381c32a01408",
id="short",
),
pytest.param(
"VeryLongMessage!" * 64,
"fdac2a32d0d2f39a5ad189daa843ccae6816f0cee17f54667edbbc4119aea2dbce2877e4c660ec4d9a916cb122674efdb435ff0de08a1950e71958b4ae450609",
id="long",
),
),
)
def test_sign(client, message, signature):
sig = lisk.sign_message(client, LISK_PATH, message)
assert sig.public_key.hex() == LISK_PUBKEY
assert sig.signature.hex() == signature

@ -1,200 +0,0 @@
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import pytest
from trezorlib import lisk, messages as proto
from trezorlib.tools import parse_path
@pytest.mark.altcoin
@pytest.mark.lisk
class TestMsgLiskSignTx:
def test_lisk_sign_tx_send(self, client):
with client:
client.set_expected_responses(
[
proto.ButtonRequest(code=proto.ButtonRequestType.SignTx),
proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput),
proto.LiskSignedTx(
signature=bytes.fromhex(
"f48532d43e8c5abadf50bb7b82098b31eec3e67747e5328c0675203e86441899c246fa3aea6fc91043209431ce710c5aa34aa234546b85b88299d5a379bff202"
)
),
]
)
lisk.sign_tx(
client,
parse_path("m/44'/134'/0'"),
{
"amount": "10000000",
"recipientId": "9971262264659915921L",
"timestamp": 57525937,
"type": 0,
"fee": "10000000",
"asset": {},
},
)
def test_lisk_sign_tx_send_with_data(self, client):
with client:
client.set_expected_responses(
[
proto.ButtonRequest(code=proto.ButtonRequestType.SignTx),
proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput),
proto.LiskSignedTx(
signature=bytes.fromhex(
"4e83a651e82f2f787a71a5f44a2911dd0429ee4001b80c79fb7d174ea63ceeefdfba55aa3a9f31fa14b8325a39ad973dcd7eadbaa77b0447a9893f84b60f210e"
)
),
]
)
lisk.sign_tx(
client,
parse_path("m/44'/134'/0'"),
{
"amount": "10000000",
"recipientId": "9971262264659915921L",
"timestamp": 57525937,
"type": 0,
"fee": "20000000",
"asset": {"data": "Test data"},
},
)
def test_lisk_sign_tx_second_signature(self, client):
with client:
client.set_expected_responses(
[
proto.ButtonRequest(code=proto.ButtonRequestType.PublicKey),
proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput),
proto.LiskSignedTx(
signature=bytes.fromhex(
"e27d8997d0bdbc9ab4ad928fcf140edb25a217007987447270085c0872e4178c018847d1378a949ad2aa913692f10aeec340810fd9de02da9d4461c63b6b6c06"
)
),
]
)
lisk.sign_tx(
client,
parse_path("m/44'/134'/0'"),
{
"amount": "0",
"timestamp": 57525937,
"type": 1,
"fee": "500000000",
"asset": {
"signature": {
"publicKey": "5d036a858ce89f844491762eb89e2bfbd50a4a0a0da658e4b2628b25b117ae09"
}
},
},
)
def test_lisk_sign_tx_delegate_registration(self, client):
with client:
client.set_expected_responses(
[
proto.ButtonRequest(code=proto.ButtonRequestType.SignTx),
proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput),
proto.LiskSignedTx(
signature=bytes.fromhex(
"e9f68b9961198f4e0d33d6ae95cbd90ab243c2c1f9fcc51db54eb54cc1491db53d237131e12da9485bfbfbd02255c431d08095076f926060c434edb01cf25807"
)
),
]
)
lisk.sign_tx(
client,
parse_path("m/44'/134'/0'"),
{
"amount": "0",
"timestamp": 57525937,
"type": 2,
"fee": "2500000000",
"asset": {"delegate": {"username": "trezor_t"}},
},
)
def test_lisk_sign_tx_cast_votes(self, client):
with client:
client.set_expected_responses(
[
proto.ButtonRequest(code=proto.ButtonRequestType.SignTx),
proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput),
proto.LiskSignedTx(
signature=bytes.fromhex(
"18d7cb27276a83178427aab2abcb5ee1c8ae9e8e2d1231585dcae7a83dd7d5167eea5baca890169bc80dcaf187320cab47c2f65a20c6483fede0f059919e4106"
)
),
]
)
lisk.sign_tx(
client,
parse_path("m/44'/134'/0'"),
{
"amount": "0",
"timestamp": 57525937,
"type": 3,
"fee": "100000000",
"asset": {
"votes": [
"+b002f58531c074c7190714523eec08c48db8c7cfc0c943097db1a2e82ed87f84",
"-ec111c8ad482445cfe83d811a7edd1f1d2765079c99d7d958cca1354740b7614",
]
},
},
)
def test_lisk_sign_tx_multisignature(self, client):
with client:
client.set_expected_responses(
[
proto.ButtonRequest(code=proto.ButtonRequestType.SignTx),
proto.ButtonRequest(code=proto.ButtonRequestType.ConfirmOutput),
proto.LiskSignedTx(
signature=bytes.fromhex(
"b84438ae3d419d270eacd0414fc8818d8f2c721602be54c3d705cf4cb3305de44e674f6dac9aac87379cce006cc97f2f635f296a48ab6a6adf62e2c11e08e409"
)
),
]
)
lisk.sign_tx(
client,
parse_path("m/44'/134'/0'"),
{
"amount": "0",
"timestamp": 57525937,
"type": 4,
"fee": "1500000000",
"asset": {
"multisignature": {
"min": 2,
"lifetime": 5,
"keysgroup": [
"+5d036a858ce89f844491762eb89e2bfbd50a4a0a0da658e4b2628b25b117ae09",
"+922fbfdd596fa78269bbcadc67ec2a1cc15fc929a19c462169568d7a3df1a1aa",
],
}
},
},
)

@ -1,42 +0,0 @@
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import pytest
from trezorlib import lisk
VECTORS = ( # pubkey, signature, message
(
"eb56d7bbb5e8ea9269405f7a8527fe126023d1db2c973cfac6f760b60ae27294",
"7858ae7cd52ea6d4b17e800ca60144423db5560bfd618b663ffbf26ab66758563df45cbffae8463db22dc285dd94309083b8c807776085b97d05374d79867d05",
"This is an example of a signed message.",
),
(
"8bca6b65a1a877767b746ea0b3c4310d404aa113df99c1b554e1802d70185ab5",
"458ca5896d0934866992268f7509b5e954d568b1251e20c19bd3149ee3c86ffb5a44d1c2a0abbb99a3ab4767272dbb0e419b4579e890a24919ebbbe6cc0f970f",
"VeryLongMessage!" * 64,
),
)
@pytest.mark.altcoin
@pytest.mark.lisk
@pytest.mark.parametrize("pubkey, signature, message", VECTORS)
def test_verify(client, pubkey, signature, message):
with client:
lisk.verify_message(
client, bytes.fromhex(pubkey), bytes.fromhex(signature), message
)

@ -335,21 +335,6 @@
"test_msg_getpublickey_curve.py::test_publickey_curve[nist256p1-path3-03b93f7e6c777143ad4eeb-52f3ce03": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_getpublickey_curve.py::test_publickey_curve[secp256k1-path0-02f65ce170451f66f46daf-74f2bfd2": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_getpublickey_curve.py::test_publickey_curve[secp256k1-path1-0212f4629f4f224db0f778-ffb4454d": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_lisk_getaddress.py::test_lisk_getaddress[m-44h-134h-0h-3685460048641680438L]": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_lisk_getaddress.py::test_lisk_getaddress[m-44h-134h-100h-7191894793645699638L]": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_lisk_getaddress.py::test_lisk_getaddress[m-44h-134h-1h-2178885030141662239L]": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_lisk_getaddress.py::test_lisk_getaddress[m-44h-1h-0h-8365436719773013410L]": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_lisk_getpublickey.py::test_lisk_get_public_key": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_lisk_signmessage.py::test_sign[long]": "5079ab9d88acab6d36831fc5a3f36d6bfd92d000381e5486ecabc2b97c150bec",
"test_msg_lisk_signmessage.py::test_sign[short]": "0e3079a6e60029c9fbc4a372c9e6649e856637e6125a73d515ed016ca3060ff7",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_cast_votes": "2e29a0c0b81d8282d452a67049b7ff2f11d89083d15b9781d1de41da78059559",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_delegate_registration": "69f3bc6b2359d5961c4b941cd76ed9e9c57f62430e7f5a70ce9e73b79b5565b2",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_multisignature": "e0743e84c87c4387cb2c2c7067a01441e84ba4049c6b5c8a6ec8810e8953df85",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_second_signature": "0228dd388b3357a1848b87a943b172cdf796ba7d6cb51675025c7ba43e88c509",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_send": "07e5a905588b9e2518db7554c76c548c5a1267849b30cf911259477938705ff8",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_send_with_data": "ea969f90b6e4b840bb8728a9a99e5d07f59f478dba6b144218148d9db83f7a49",
"test_msg_lisk_verifymessage.py::test_verify[8bca6b65a1a877767b746ea0b3c4310d404aa113df99c1b-40e13f34": "697153a3eaad37f29fc25f7826bf6c709730f2cb3b8850e45d41f537eef056ac",
"test_msg_lisk_verifymessage.py::test_verify[eb56d7bbb5e8ea9269405f7a8527fe126023d1db2c973cf-4e588545": "492d75b6126690f5ecb17132cd1dafcf0da9bddbb8fecd3c32e7654f346039e2",
"test_msg_loaddevice.py-test_load_device_1": "1c6db0d592b1d22b3c9fce3ddab8a9fd138f11d83e5d4e64431a02bf4ffed605",
"test_msg_loaddevice.py-test_load_device_2": "dc13c8486d8a59c5062e19139d8b3cea4ece1a3bc93592be7dc226f83ba54477",
"test_msg_loaddevice.py-test_load_device_slip39_advanced": "1c6db0d592b1d22b3c9fce3ddab8a9fd138f11d83e5d4e64431a02bf4ffed605",

Loading…
Cancel
Save