Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package3 #58

Open
wants to merge 140 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
8634dd4
blackify codebase
Mar 1, 2021
84f4f14
Migrate to buidl/PSBT and general cleanup
Feb 6, 2021
6886981
fix merge conflicts from blackify-ing code base
Mar 1, 2021
d2fde2f
resolve merge conflicts for blackified view
Mar 1, 2021
92fed28
blackify codebase
Mar 1, 2021
2ab8839
add python.yml workflow to git commits
Mar 1, 2021
b60d55a
flake8 and black
Mar 1, 2021
6d291e7
add black
Mar 1, 2021
c4871d6
only flake8 a specific directory, for now
Mar 1, 2021
dd63f1d
mark pytest github as TODO
Mar 1, 2021
c5e176c
Merge branch 'blackify' into hermit-psbt-demo2
Mar 1, 2021
6eb3557
fix outstanding merge conflict
Mar 1, 2021
59dc041
blackify
Mar 1, 2021
147b199
fix imports
Mar 1, 2021
bb40cfa
black
Mar 1, 2021
7ab88fb
flake8
Mar 1, 2021
e4017ee
update readme
Mar 1, 2021
66042f9
stashing broken changes
Mar 31, 2021
a1e2b3e
stashing more broken
Apr 1, 2021
8415f5b
stashing more BROKEN changes
Apr 1, 2021
70d3e85
stashing changes, still doesn't work but qr popup does
Apr 5, 2021
4e35d1f
kinda sorta works
Apr 5, 2021
904b47b
cleanup
Apr 5, 2021
25de236
support non-animated BCUR strings as well
Apr 5, 2021
cb4feeb
remove shard_words*
Apr 5, 2021
35b779c
make testnet work
Apr 5, 2021
7388d1c
cleanup
Apr 5, 2021
37ba32b
stashing broken
Apr 5, 2021
d5e365c
export xpub works
Apr 5, 2021
d934791
cleanup xpub
Apr 5, 2021
78e1ad0
kill debug print
Apr 6, 2021
cb68ff1
stashing broken chunking code
Apr 7, 2021
4740051
stash working-ish changes
Apr 8, 2021
bab5f21
move code to buidl branch, stashing working-ish changes
Apr 8, 2021
6b2e7b6
blackify
Apr 8, 2021
c99af5a
move buidl to pypi branch
May 22, 2021
ed6232e
cleanup readme
May 22, 2021
1e97437
RIP vendor folder
May 22, 2021
ccf706d
bump version
May 22, 2021
0b6b542
stashing broken changes. still having issue with needing xpubs.
May 22, 2021
3e50541
remove unusued restore_random_bytes
May 23, 2021
cdd5ef1
stash CLI working version! needs lots of improvements,
May 23, 2021
f9d5f1a
add back in slip132 version bytes for explicit specter-desktop compat…
May 23, 2021
e169c66
cleanup through export xpub
May 24, 2021
672a3a2
black
May 24, 2021
86a8dab
working-ish for qr and cli up to signing
May 24, 2021
51e628c
everything works through qr signing. display could use some work.
May 24, 2021
8322a06
cleanup
May 24, 2021
2ef0588
readme
May 25, 2021
58ca943
cleanup
May 25, 2021
b486340
fix QR return broadcast
May 25, 2021
650bd06
put stuff together to get it nominally working. The test need some at…
howech Jul 14, 2021
0353943
bumped version
howech Jul 14, 2021
6a1263f
minor tweaks
howech Jul 30, 2021
5f668f1
removed TODO in sign-bitcoin description
howech Jul 30, 2021
433a716
working on getting sign_bitcoin to work
howech Jul 30, 2021
02a4e3d
can now nominally sign transactions again
howech Jul 30, 2021
d373cd8
python version
howech Aug 23, 2021
5f59864
buidl version
howech Aug 23, 2021
d6ab2ff
relax buidl requirement
howech Aug 23, 2021
e57b6f0
buidl from github.
howech Aug 23, 2021
e5d0a73
buidl
howech Aug 23, 2021
fff858d
buidl
howech Aug 23, 2021
e4becea
framebuffer!
howech Aug 25, 2021
6916076
typo
howech Aug 25, 2021
a9ebfc4
added some missing dependencies
howech Aug 26, 2021
250aa69
Added configurable camera options and display options.
howech Aug 27, 2021
1043487
fixed some minor errors
howech Aug 27, 2021
363e15d
Made the frambufferdisplay respect postitioning from the config file.
howech Aug 27, 2021
8e7b1df
latest changes
howech Oct 5, 2021
c066acd
Fix venv in makefile
dhruvbansal Oct 6, 2021
fd462bb
Add flax as author
dhruvbansal Oct 6, 2021
d4683b9
Don't die if BSON file is empty
dhruvbansal Oct 6, 2021
f4b3f41
Fix qrcode config settings and usage
dhruvbansal Oct 6, 2021
769b375
Merge branch 'package3' of github.com:howech/hermit into package3
dhruvbansal Oct 6, 2021
c572d4f
Got signing working on a mac (w/o IO)
dhruvbansal Oct 7, 2021
f1947a9
Fix IO in opencv on mac
dhruvbansal Oct 7, 2021
7e96f78
Added example PSBT text file to sign
dhruvbansal Oct 7, 2021
140c716
Refactored, added tests
dhruvbansal Oct 9, 2021
7167f35
More refactoring, more tests
dhruvbansal Oct 9, 2021
44ee5cd
Update asset task
dhruvbansal Oct 9, 2021
2e78294
Tried out ASCII display. Works, but defaults don't propagate perfect
dhruvbansal Oct 9, 2021
65a5257
Added imageio file
dhruvbansal Oct 9, 2021
0798c63
Addig RSA-based signatures for coordinators.
dhruvbansal Oct 9, 2021
e6ffc55
Ran linter.
dhruvbansal Oct 9, 2021
df7101f
type checker runs also
dhruvbansal Oct 9, 2021
abdbb6a
Updated packages to deal with security alerts
dhruvbansal Oct 9, 2021
95436d5
Spent some time on docs.
dhruvbansal Oct 9, 2021
6068225
Forgot a file that gets linted
dhruvbansal Oct 9, 2021
3970044
Added flake8 back, fixed bunch of things.
dhruvbansal Oct 9, 2021
3e5bbe7
ibid
dhruvbansal Oct 9, 2021
a4b4964
Update travis build
dhruvbansal Oct 9, 2021
c3a0d72
Include docs in builds
dhruvbansal Oct 9, 2021
0a8b138
Fix giant bug that all that testing, linting & type checking missed
dhruvbansal Oct 9, 2021
92c1eea
fix deadman
howech Oct 11, 2021
a96f9c2
Simplified error handling.
howech Oct 12, 2021
efa1731
testing coordinator sigs
howech Oct 12, 2021
8924468
pep8
howech Oct 12, 2021
59ebefe
Put local bin dir first in PATH
dhruvbansal Oct 12, 2021
4ad1f1a
Merge branch 'package3' of github.com:unchained-capital/hermit into p…
dhruvbansal Oct 12, 2021
6eacd2b
fixed the toolbar TESTNET and DEBUG displays for unlocked wallet
howech Oct 27, 2021
34510f6
Upgrade buidl dependency. Functions in psbt.py can be removed.
dhruvbansal Nov 4, 2021
564e8f7
Linter changes
dhruvbansal Nov 4, 2021
842f33b
Update signer tests for new buidl version.
dhruvbansal Nov 4, 2021
7d37eee
Wallet command & docs changes
dhruvbansal Nov 12, 2021
c2f4deb
Fix serialization of signatures
dhruvbansal Nov 12, 2021
e4d1c0b
Fix display-xpub
dhruvbansal Nov 12, 2021
c9be8db
Doc & naming
dhruvbansal Nov 18, 2021
68ecdcc
Force xpubs to always export as `xpub...`
dhruvbansal Dec 8, 2021
f7a9ae8
Update build.
dhruvbansal Dec 8, 2021
ff019e8
Fix PSBT parsing issue
dhruvbansal Dec 9, 2021
7451af6
Update transaction signing display.
dhruvbansal Dec 9, 2021
e839bee
Updated buidl version.
howech Dec 28, 2021
e6d88be
Changed a couple of things about signing.
howech Jan 17, 2022
8c6f6da
Added some alternative transaction display formats.
howech Feb 28, 2022
2e80435
Updated buidl requiement
howech Feb 28, 2022
e1f4c05
Include the input total in the summary on both short and long form tx…
howech Mar 2, 2022
6d30e7c
fixed a bug in long-format transaction display
howech Mar 14, 2022
4641f01
Changed the interface for the BIP39 phrase input method.
howech Apr 8, 2022
af4b8a9
Docco updates
dhruvbansal May 11, 2022
ad3024e
Merge branch 'package3' into package3-db
dhruvbansal May 11, 2022
2e5d50e
Restore missing top-level doc file
dhruvbansal May 11, 2022
ddef27a
Rename make tasks
dhruvbansal May 11, 2022
3a333cc
Fix typing bug
dhruvbansal May 12, 2022
667efdf
Ensure we look up shards before we attempt to add any new ones
dhruvbansal May 12, 2022
1a633bd
Fix issue with clearning without first loading.
dhruvbansal May 12, 2022
9119891
Add HERMIT_DISABLE_IO environment variable to squash IO for tests.
dhruvbansal May 16, 2022
774216a
Added the ability to disable repl commands in the config file.
howech Jun 16, 2022
72658c1
Changed ANSI code for clear_screen to reset terminal.
howech Jun 27, 2022
26320ba
Added a lockout timeout config item
howech Jul 5, 2022
4028c0e
Separate system python from python in virtualenv in Makefile
dhruvbansal Jul 20, 2022
d92cc6e
Linter changes
dhruvbansal Jul 20, 2022
a553b4c
Print HermitError on bad REPL commands to expose better messages
dhruvbansal Jul 20, 2022
4de83b8
Added `rename-shard` command and forced `copy-shard` to do `unlock`
dhruvbansal Jul 20, 2022
ab24809
Updates to README
dhruvbansal Jul 20, 2022
4afec79
Update handling of dumb values in shard config
dhruvbansal Jul 20, 2022
9e0f489
Quickstart updates
dhruvbansal Jul 20, 2022
2e8b5a3
Minor readme changes
dhruvbansal Jul 26, 2022
f3a8531
Stopped occasional errors in scanning qr code contents from stopping …
howech Aug 29, 2022
19bfed4
Optionally remove information from the signed psbt. (#54)
howech Sep 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python

name: Python package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8 pytest mypy
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
- name: Lint with black
run: |
black . --diff --check
- name: Lint with flake8
run: |
flake8 hermit --count --statistics
- name: Test with pytest
run: |
# pytest --cov=hermit --cov-config=test/.coveragerc --ignore=vendor
echo "FIXME"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dist
build.info
.coverage
.mypy_cache/
docs/_build
docs/_build
.DS_Store
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ before_install:
install:
- pip install wheel
- pip install codecov
- pip install -r requirements.frozen.txt
- pip install -r requirements.txt
script:
- python -m pytest --cov=hermit --cov-config=tests/.coveragerc --ignore=vendor
- python -m black hermit tests scripts *.py
- python -m flake8 hermit tests scripts *.py
- python -m mypy -p hermit
- python -m sphinx -c docs hermit docs/_build
after_success:
- codecov
9 changes: 4 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ pipeline {
sh '''
. .virtualenv/bin/activate
python setup.py install
make lint
make test
make check
make test
make docs
'''
}
}
Expand All @@ -32,12 +33,10 @@ pipeline {
withCredentials([usernamePassword(credentialsId: 'tbd', passwordVarable: 'PYPI_PASSWORD', usernameVariable: 'PYPI_USERNAME')]) {
sh '''
. ./environment.sh
make upload
make release
'''
}
}
}
}
}


121 changes: 85 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
#
# == Paths & Directories ==
# == Environment ==
#

VENV_DIR := .virtualenv

PYTHON3 := $(shell command -v python3 2> /dev/null)
PYTHON_REQUIREMENTS := requirements.txt
PYTHON_FROZEN_REQUIREMENTS := requirements.frozen.txt
UNAME := $(shell uname)

#
# == Configuration ==
# == Files & Directories ==
#

UNAME := $(shell uname)
PYTHON_REQUIREMENTS := requirements.in
PYTHON_FROZEN_REQUIREMENTS := requirements.txt

VENV_DIR := .virtualenv
FIXTURES := tests/fixtures
SCRIPTS := scripts
EXAMPLES := examples

#
# == Commands ==
#

PIP := $(VENV_DIR)/bin/pip
PYTEST := $(VENV_DIR)/bin/pytest
FLAKE8 := $(VENV_DIR)/bin/flake8
MYPY := $(VENV_DIR)/bin/mypy
SPHINX_BUILD := $(VENV_DIR)/bin/sphinx-build
CAT := cat
ECHO := echo

#
# == Targets ==
#
BREW := brew
APT := apt

default: dependencies
SYSTEM_PYTHON3 := $(shell command -v python3 2> /dev/null)
PYTHON3 := $(VENV_DIR)/bin/python3
PIP := $(VENV_DIR)/bin/pip

docs:
$(SPHINX_BUILD) -c docs hermit docs/_build
PYTEST := $(VENV_DIR)/bin/pytest
BLACK := $(VENV_DIR)/bin/black
FLAKE8 := $(VENV_DIR)/bin/flake8
MYPY := $(VENV_DIR)/bin/mypy
SPHINX_BUILD := $(VENV_DIR)/bin/sphinx-build
TWINE := twine

clean:
$(RM) -rf docs/_build/* build/* dist/* hermit.egg-info build.info
default: dependencies

#
# == Dependencies ==
#

freeze:
$(PIP) freeze -l > $(PYTHON_FROZEN_REQUIREMENTS)
Expand All @@ -43,12 +50,13 @@ dependencies: system-dependencies python-dependencies

system-dependencies:
ifeq ($(UNAME),Darwin)
brew ls --versions zbar || brew install zbar
$(BREW) ls --versions zbar || brew install zbar
else
sudo apt install libzbar0
$(APT) install libzbar0
endif

python-dependencies: $(VENV_DIR)
$(PYTHON3) -m pip install --upgrade pip
$(PIP) install wheel
ifdef UNFREEZE
$(PIP) install -r $(PYTHON_REQUIREMENTS)
Expand All @@ -57,24 +65,65 @@ else
endif


$(VENV_DIR):
$(SYSTEM_PYTHON3) -m venv --prompt='hermit' $(VENV_DIR)

#
# == Development ==
#

check:
$(BLACK) --check hermit tests scripts *.py
$(FLAKE8) hermit tests scripts *.py
$(MYPY) -p hermit

test:
$(PYTEST) --cov=hermit --cov-config=tests/.coveragerc --ignore=vendor

docs:
HERMIT_LOAD_ALL_IO=true $(SPHINX_BUILD) -c docs hermit docs/_build

#
# == Examples & Fixtures ==
#

fixtures: $(FIXTURES)/signature_requests/2-of-2.p2sh.testnet.coordinator_signed.gif $(FIXTURES)/signature_requests/2-of-2.p2sh.testnet.gif $(EXAMPLES)/lorem_ipsum.gif $(EXAMPLES)/hello_world.jpg

$(EXAMPLES)/lorem_ipsum.gif: $(FIXTURES)/lorem_ipsum.txt
$(CAT) $< | $(PYTHON3) $(SCRIPTS)/create_qr_code_animation.py $@

$(EXAMPLES)/hello_world.jpg: $(FIXTURES)/hello_world.txt
$(CAT) $< | $(PYTHON3) scripts/create_qr_code_image.py $@

%.gif: %.psbt
$(CAT) $< | $(PYTHON3) $(SCRIPTS)/create_qr_code_animation.py $@ true

%.coordinator_signed.psbt: %.psbt
$(CAT) $< | $(PYTHON3) $(SCRIPTS)/sign_psbt_as_coordinator.py $(FIXTURES)/coordinator.pem > $@


#
# == Release ==
#

build.info:
echo ${BUILD_NUMBER} > build.info
$(ECHO) ${BUILD_NUMBER} > build.info

package: python-dependencies build.info
python setup.py sdist bdist_wheel
$(PYTHON3) setup.py sdist bdist_wheel

upload: python-dependencies package
#twine upload -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --repository-url https://test.pypi.org/legacy/ dist/*
twine upload dist/*
release: package
#$(TWINE) upload -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --repository-url https://test.pypi.org/legacy/ dist/*
$(TWINE) upload dist/*

$(VENV_DIR):
$(PYTHON3) -m venv --prompt='hermit' $(VENV_DIR)
.PHONY: docs

test:
$(PYTEST) --cov=hermit --cov-config=tests/.coveragerc --ignore=vendor
#
# == Cleanup ==
#

lint:
-$(FLAKE8) hermit --exclude=__init__.py
-$(MYPY) hermit/
clean:
$(RM) -rf docs/_build/* build/* dist/* hermit.egg-info build.info /tmp/shard_words.bson*

.PHONY: test docs
purge:
$(RM) -rf $(VENV_DIR)
Loading