Repository navigation
Bump embit "hardened" + MaixPy; adj tests and improve ci - #973
Conversation
ed5c842 to
af768f9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #973 +/- ##
========================================
Coverage 97.60% 97.60%
========================================
Files 84 84
Lines 10994 11001 +7
========================================
+ Hits 10731 10738 +7
Misses 263 263 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| def test_sign_trim_keeps_psbt_v2(m5stickv): | ||
| """A PSBTv2 must come back as a PSBTv2 that still derives the signed locktime""" | ||
| from embit import bip32, bip39, ec, script | ||
| from embit.bip32 import parse_path | ||
| from embit.networks import NETWORKS | ||
| from embit.psbt import PSBT, DerivationPath | ||
| from embit.transaction import Transaction, TransactionInput, TransactionOutput | ||
| from krux.key import Key, TYPE_SINGLESIG | ||
| from krux.psbt import PSBTSigner | ||
| from krux.qr import FORMAT_NONE | ||
| from krux.wallet import Wallet | ||
|
|
||
| mnemonic = "abandon " * 11 + "about" | ||
| root = bip32.HDKey.from_seed( | ||
| bip39.mnemonic_to_seed(mnemonic), version=NETWORKS["test"]["xprv"] | ||
| ) |
There was a problem hiding this comment.
DRY only: tdata.TEST_MNEMONIC in root
| def test_sign_trim_keeps_psbt_v2(m5stickv): | |
| """A PSBTv2 must come back as a PSBTv2 that still derives the signed locktime""" | |
| from embit import bip32, bip39, ec, script | |
| from embit.bip32 import parse_path | |
| from embit.networks import NETWORKS | |
| from embit.psbt import PSBT, DerivationPath | |
| from embit.transaction import Transaction, TransactionInput, TransactionOutput | |
| from krux.key import Key, TYPE_SINGLESIG | |
| from krux.psbt import PSBTSigner | |
| from krux.qr import FORMAT_NONE | |
| from krux.wallet import Wallet | |
| mnemonic = "abandon " * 11 + "about" | |
| root = bip32.HDKey.from_seed( | |
| bip39.mnemonic_to_seed(mnemonic), version=NETWORKS["test"]["xprv"] | |
| ) | |
| def test_sign_trim_keeps_psbt_v2(m5stickv, tdata): | |
| """A PSBTv2 must come back as a PSBTv2 that still derives the signed locktime""" | |
| from embit import bip32, bip39, ec, script | |
| from embit.bip32 import parse_path | |
| from embit.networks import NETWORKS | |
| from embit.psbt import PSBT, DerivationPath | |
| from embit.transaction import Transaction, TransactionInput, TransactionOutput | |
| from krux.key import Key, TYPE_SINGLESIG | |
| from krux.psbt import PSBTSigner | |
| from krux.qr import FORMAT_NONE | |
| from krux.wallet import Wallet | |
| root = bip32.HDKey.from_seed( | |
| bip39.mnemonic_to_seed(tdata.TEST_MNEMONIC), version=NETWORKS["test"]["xprv"] | |
| ) |
| def low_memory_read_from(stream, compress=CompressMode.KEEP_ALL): | ||
| if compress == CompressMode.KEEP_ALL: | ||
| raise MemoryError | ||
| return read_from(stream, compress=compress) |
There was a problem hiding this comment.
honest doubt: maybe one more test w/o the mock, so a future embit bump can't silently make both parse modes disagree?
2f9daea to
4fa4c45
Compare
|
tested on a TZT. built f51c3ab locally for maixpy_tzt: it builds, and firmware.bin is 1,635,008 bytes, 16,320 more than the 26.09.0 release. the board test used this tree plus MaixPy#60 and the i also ran embit's own tests on d8b18e2, because the hardened branch has no CI run of its own: one thing to know before the release: the Build workflow is disabled on GitHub right now, so merging this builds no firmware for the other boards. |
f51c3ab to
3e34a96
Compare
Duplicate keys are now rejected in compressed mode too, so force the SD card fallback with a MemoryError instead. A witness_utxo contradicting the previous tx is now refused by verify(), so test the rejection in both parse modes.
Trimming rebuilt a v0 PSBT, dropping the version, locktime fields and the TX_MODIFIABLE flags updated by the signer.
Embit now parses them, and Krux only refused them through a TypeError.
chore: ci action: black installs python via uv. test: fixes 6 invalid bip380 descriptor checksum testcases; ty harshil for embit PR-161 chore: bump embit to "hardened"; master at 2b375a3 + following: PR-152, PR-118, PR-124, PR-162, PR-82, PR-181, PR-182, PR-169, PR-158, PR-160, PR-161, PR-167, and PR-179
c5d2e52 to
d04a7e3
Compare
What is this PR for?
Temporarily, Krux will be using latest embit "hardened" branch:
Changes made to:
Did you build the code and tested on device?
What is the purpose of this pull request?