Skip to content

Commit

Permalink
Merge pull request #114 from alecalve/github-actions
Browse files Browse the repository at this point in the history
Use Github actions to build package instead of Travis
  • Loading branch information
alecalve authored Mar 23, 2024
2 parents 9324687 + 890e6d7 commit ff5de4d
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 43 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bitcoin-blockchain-parser [![Build Status](https://travis-ci.org/alecalve/python-bitcoin-blockchain-parser.svg?branch=master)](https://travis-ci.org/alecalve/python-bitcoin-blockchain-parser) [![Coverage Status](https://coveralls.io/repos/alecalve/python-bitcoin-blockchain-parser/badge.svg?branch=master&service=github)](https://coveralls.io/github/alecalve/python-bitcoin-blockchain-parser?branch=master)
# bitcoin-blockchain-parser ![Build Status](https://github.com/alecalve/python-bitcoin-blockchain-parser/actions/workflows/python-package.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/alecalve/python-bitcoin-blockchain-parser/badge.svg?branch=master&service=github)](https://coveralls.io/github/alecalve/python-bitcoin-blockchain-parser?branch=master)
This Python 3 library provides a parser for the raw data stored by bitcoind.

## Features
Expand Down
5 changes: 4 additions & 1 deletion blockchain_parser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
import hashlib
import struct

from ripemd import ripemd160

def btc_ripemd160(data):
"""Computes ripemd160(sha256(data))"""

h1 = hashlib.sha256(data).digest()
r160 = hashlib.new("ripemd160")
r160 = ripemd160.new()
r160.update(h1)
return r160.digest()

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
python-bitcoinlib==0.11.0
plyvel==1.5.1
coverage==7.4.4
ripemd-hash==1.0.1
coverage==7.4.4
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
install_requires=[
'python-bitcoinlib==0.11.0',
'plyvel==1.5.1'
'plyvel==1.5.1',
'ripemd-hash==1.0.1'
]
)
17 changes: 0 additions & 17 deletions travis.sh

This file was deleted.

0 comments on commit ff5de4d

Please sign in to comment.