travis yaml conslidation via anchors

This commit is contained in:
Lex Berezhny 2018-07-29 00:16:57 -04:00 committed by Jack Robison
parent 91bf312e4d
commit 411b8c74cc
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 18 additions and 30 deletions

View file

@ -58,28 +58,8 @@ jobs:
target_paths:
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/win/
- name: "Linux"
install:
- pip install pyinstaller
- pip install git+https://github.com/lbryio/torba.git
- pip install git+https://github.com/lbryio/lbryschema.git
- pip install -e .
script:
- pyinstaller -F -n lbrynet lbrynet/cli.py
- ./dist/lbrynet --version
addons:
artifacts:
working_dir: dist
paths:
- lbrynet
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78
target_paths:
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/linux/lbrynet
- name: "Mac"
os: osx
osx_image: xcode9.4
language: generic
- &build
name: "Linux"
install:
- pip3 install pyinstaller
- pip3 install git+https://github.com/lbryio/torba.git
@ -88,6 +68,7 @@ jobs:
script:
- pyinstaller -F -n lbrynet lbrynet/cli.py
- ./dist/lbrynet --version
env: OS=linux
addons:
artifacts:
working_dir: dist
@ -95,7 +76,14 @@ jobs:
- lbrynet
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78
target_paths:
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/mac/lbrynet
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/${OS}/lbrynet
- <<: *build
name: "Mac"
os: osx
osx_image: xcode9.4
language: generic
env: OS=mac
cache:
directories:

View file

@ -90,13 +90,13 @@ class Headers(BaseHeaders):
# Retarget
bnPowLimit = _ArithUint256(self.ledger.max_target)
bnNew = _ArithUint256.SetCompact(last['bits'])
bnNew = _ArithUint256.set_compact(last['bits'])
bnNew *= nModulatedTimespan
bnNew //= nModulatedTimespan
if bnNew > bnPowLimit:
bnNew = bnPowLimit
return bnNew.GetCompact(), bnNew._value
return bnNew.get_compact(), bnNew._value
class MainNetLedger(BaseLedger):

View file

@ -3,16 +3,16 @@ import json
from binascii import hexlify
from twisted.internet import defer
from torba.manager import WalletManager as BaseWalletManager
from torba.basemanager import BaseWalletManager
from lbryschema.uri import parse_lbry_uri
from lbryschema.error import URIParseError
from lbryschema.claim import ClaimDict
from .ledger import MainNetLedger # pylint: disable=unused-import
from .ledger import MainNetLedger
from .account import generate_certificate
from .transaction import Transaction
from .database import WalletDatabase # pylint: disable=unused-import
from .database import WalletDatabase
class BackwardsCompatibleNetwork:
@ -31,11 +31,11 @@ class BackwardsCompatibleNetwork:
class LbryWalletManager(BaseWalletManager):
@property
def ledger(self): # type: () -> MainNetLedger
def ledger(self) -> MainNetLedger:
return self.default_account.ledger
@property
def db(self): # type: () -> WalletDatabase
def db(self) -> WalletDatabase:
return self.ledger.db
@property