mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-14 17:31:04 +00:00
fix(xmr): fix tx sending to an integrated address
This commit is contained in:
parent
fb08536b6a
commit
90771ebb59
@ -19,8 +19,8 @@ let
|
|||||||
sha256 = "02s3qkb6kz3ndyx7rfndjbvp4vlwiqc42fxypn3g6jnc0v5jyz95";
|
sha256 = "02s3qkb6kz3ndyx7rfndjbvp4vlwiqc42fxypn3g6jnc0v5jyz95";
|
||||||
}) { };
|
}) { };
|
||||||
moneroTests = nixpkgs.fetchurl {
|
moneroTests = nixpkgs.fetchurl {
|
||||||
url = "https://github.com/ph4r05/monero/releases/download/v0.17.3.2-dev-tests-u18.04-03/trezor_tests";
|
url = "https://github.com/ph4r05/monero/releases/download/v0.18.1.0-dev-tests-u18.04-01/trezor_tests";
|
||||||
sha256 = "3280aeef795baf2fc46687c07ac4131e5a18767ecdd3af83cf17823ebb2d1007";
|
sha256 = "7a8bab583d5f2f06f092ea297b1417008f20c1c5ca23c74e0eb11660068dead9";
|
||||||
};
|
};
|
||||||
moneroTestsPatched = nixpkgs.runCommandCC "monero_trezor_tests" {} ''
|
moneroTestsPatched = nixpkgs.runCommandCC "monero_trezor_tests" {} ''
|
||||||
cp ${moneroTests} $out
|
cp ${moneroTests} $out
|
||||||
|
1
core/.changelog.d/2213.fixed.1
Normal file
1
core/.changelog.d/2213.fixed.1
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix sending XMR transaction to an integrated address
|
@ -23,8 +23,8 @@ fi
|
|||||||
|
|
||||||
# When updating URL and sha256sum also update the URL in ci/shell.nix.
|
# When updating URL and sha256sum also update the URL in ci/shell.nix.
|
||||||
error=1
|
error=1
|
||||||
: "${TREZOR_MONERO_TESTS_URL:=https://github.com/ph4r05/monero/releases/download/v0.17.3.2-dev-tests-u18.04-03/trezor_tests}"
|
: "${TREZOR_MONERO_TESTS_URL:=https://github.com/ph4r05/monero/releases/download/v0.18.1.0-dev-tests-u18.04-01/trezor_tests}"
|
||||||
: "${TREZOR_MONERO_TESTS_SHA256SUM:=3280aeef795baf2fc46687c07ac4131e5a18767ecdd3af83cf17823ebb2d1007}"
|
: "${TREZOR_MONERO_TESTS_SHA256SUM:=7a8bab583d5f2f06f092ea297b1417008f20c1c5ca23c74e0eb11660068dead9}"
|
||||||
: "${TREZOR_MONERO_TESTS_PATH:=$CORE_DIR/tests/trezor_monero_tests}"
|
: "${TREZOR_MONERO_TESTS_PATH:=$CORE_DIR/tests/trezor_monero_tests}"
|
||||||
: "${TREZOR_MONERO_TESTS_LOG:=$CORE_DIR/tests/trezor_monero_tests.log}"
|
: "${TREZOR_MONERO_TESTS_LOG:=$CORE_DIR/tests/trezor_monero_tests.log}"
|
||||||
: "${TREZOR_MONERO_TESTS_CHAIN:=$CORE_DIR/tests/trezor_monero_tests.chain}"
|
: "${TREZOR_MONERO_TESTS_CHAIN:=$CORE_DIR/tests/trezor_monero_tests.chain}"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from common import *
|
from common import *
|
||||||
|
|
||||||
if not utils.BITCOIN_ONLY:
|
if not utils.BITCOIN_ONLY:
|
||||||
|
from trezor.crypto import monero as tcry
|
||||||
from trezor.enums import MoneroNetworkType
|
from trezor.enums import MoneroNetworkType
|
||||||
from apps.monero.xmr import crypto, crypto_helpers, monero
|
from apps.monero.xmr import crypto, crypto_helpers, monero
|
||||||
from apps.monero.xmr.addresses import encode_addr
|
from apps.monero.xmr.addresses import encode_addr
|
||||||
@ -153,6 +154,22 @@ class TestMoneroCrypto(unittest.TestCase):
|
|||||||
b"bcf365a551e6358f3f281a6241d4a25eded60230b60a1d48c67b51a85e33d70e",
|
b"bcf365a551e6358f3f281a6241d4a25eded60230b60a1d48c67b51a85e33d70e",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_addr_encode(self):
|
||||||
|
addr_exp = "4LL9oSLmtpccfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2bYXZKKQePHES9khPK"
|
||||||
|
addr = tcry.xmr_base58_addr_encode_check(
|
||||||
|
19,
|
||||||
|
unhexlify(b"eda9fe8dfcdd25d5430ea64229d04f6b41b2e5a1587c29cd499a63eb79d117113076a02b73d130fb904c9e91075fcd16f735c6850dfadb125eb826d96a113f098a125052fe6f3877"))
|
||||||
|
|
||||||
|
addr2 = encode_addr(
|
||||||
|
bytes([19]),
|
||||||
|
unhexlify(b"eda9fe8dfcdd25d5430ea64229d04f6b41b2e5a1587c29cd499a63eb79d11711"),
|
||||||
|
unhexlify(b"3076a02b73d130fb904c9e91075fcd16f735c6850dfadb125eb826d96a113f09"),
|
||||||
|
unhexlify(b"8a125052fe6f3877")
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(addr, addr_exp)
|
||||||
|
self.assertEqual(addr2, addr_exp)
|
||||||
|
|
||||||
def test_wallet_addr(self):
|
def test_wallet_addr(self):
|
||||||
addr = encode_addr(
|
addr = encode_addr(
|
||||||
net_version(),
|
net_version(),
|
||||||
|
@ -48,7 +48,7 @@ const size_t encoded_block_sizes[] = {
|
|||||||
const size_t full_block_size =
|
const size_t full_block_size =
|
||||||
sizeof(encoded_block_sizes) / sizeof(encoded_block_sizes[0]) - 1;
|
sizeof(encoded_block_sizes) / sizeof(encoded_block_sizes[0]) - 1;
|
||||||
const size_t addr_checksum_size = 4;
|
const size_t addr_checksum_size = 4;
|
||||||
const size_t max_bin_data_size = 64;
|
const size_t max_bin_data_size = 72;
|
||||||
const int decoded_block_sizes[] = {0, -1, 1, 2, -1, 3, 4, 5, -1, 6, 7, 8};
|
const int decoded_block_sizes[] = {0, -1, 1, 2, -1, 3, 4, 5, -1, 6, 7, 8};
|
||||||
#define reverse_alphabet(letter) ((int8_t)b58digits_map[(int)letter])
|
#define reverse_alphabet(letter) ((int8_t)b58digits_map[(int)letter])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user