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: target_paths:
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/win/ - /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/win/
- name: "Linux" - &build
install: name: "Linux"
- 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
install: install:
- pip3 install pyinstaller - pip3 install pyinstaller
- pip3 install git+https://github.com/lbryio/torba.git - pip3 install git+https://github.com/lbryio/torba.git
@ -88,6 +68,7 @@ jobs:
script: script:
- pyinstaller -F -n lbrynet lbrynet/cli.py - pyinstaller -F -n lbrynet lbrynet/cli.py
- ./dist/lbrynet --version - ./dist/lbrynet --version
env: OS=linux
addons: addons:
artifacts: artifacts:
working_dir: dist working_dir: dist
@ -95,7 +76,14 @@ jobs:
- lbrynet - lbrynet
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78 # artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78
target_paths: 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: cache:
directories: directories:

View file

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

View file

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