diff --git a/.travis.yml b/.travis.yml index 781f206..899ed2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,20 @@ branches: only: - master before_install: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - sleep 3 # give xvfb some time to start +- export DISPLAY=:99.0 +- sh -e /etc/init.d/xvfb start +- sleep 3 +- openssl aes-256-cbc -K $encrypted_ed587a115bcb_key -iv $encrypted_ed587a115bcb_iv + -in .travisGitHub.enc -out .travisGitHub -d after_success: -- npm run build - npm run lint +- npm run build - npx lcov-result-merger "coverage-*/lcov.info" lcov.info - cat ./lcov.info | node_modules/coveralls/bin/coveralls.js +- npm run gh-pages-travis env: global: + - SSH_KEY=".travisGitHub" - GIT_NAME="Pedro Gutiérrez" - GIT_EMAIL="pedrogp9_6_93@hotmail.com" - SOURCE_DIR="dist" diff --git a/.travisGitHub.enc b/.travisGitHub.enc new file mode 100644 index 0000000..68350ae Binary files /dev/null and b/.travisGitHub.enc differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..21a2cdb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Pedro Gutiérrez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package-lock.json b/package-lock.json index 3f9a2a8..f9abec8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7130,6 +7130,12 @@ } } }, + "gh-pages-travis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/gh-pages-travis/-/gh-pages-travis-1.0.4.tgz", + "integrity": "sha1-tPkYvG1yP8Fg04CwoBFnII+L+Kc=", + "dev": true + }, "github-username": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/github-username/-/github-username-4.1.0.tgz", diff --git a/package.json b/package.json index 2347971..194bdfa 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,12 @@ "version": "0.0.1", "description": "Kudos system on Ethereum blockchain", "author": "Pedro Gutiérrez", - "license": "ISC", + "homepage": "eth-kudos.com", + "repository": { + "type": "git", + "url": "https://github.com/Pedro-vk/EthKudos" + }, + "license": "MIT", "private": true, "scripts": { "start": "ng serve", @@ -22,7 +27,9 @@ "test:sol:dev": "truffle test --network dev", "test:sol:live": "truffle test --network ropsten", "merge:sol:build": "sol-merger \"./contracts/*.sol\" ./build/merged", - "clean:sol:build": "for i in build/contracts/*.json; do npx jq '{contractName, abi, bytecode, deployedBytecode, compiler, networks, schemaVersion, updatedAt}' \"$i\" > \"$i.tmp\" && mv \"$i.tmp\" \"$i\"; done" + "clean:sol:build": "for i in build/contracts/*.json; do npx jq '{contractName, abi, bytecode, deployedBytecode, compiler, networks, schemaVersion, updatedAt}' \"$i\" > \"$i.tmp\" && mv \"$i.tmp\" \"$i\"; done", + "create-cname": "echo $(cat package.json | grep '\"homepage\"' | cut -d '\"' -f 4) > dist/CNAME", + "gh-pages-travis": "npm run create-cname && gh-pages-travis" }, "dependencies": { "@angular/animations": "^5.2.9", @@ -60,6 +67,7 @@ "abi-decoder": "^1.1.0", "codelyzer": "^4.0.1", "coveralls": "^3.0.0", + "gh-pages-travis": "^1.0.4", "jasmine-core": "~3.1.0", "jasmine-spec-reporter": "~4.2.1", "jq-cli-wrapper": "^0.4.0", diff --git a/src/app/shared/web3.service.ts b/src/app/shared/web3.service.ts index 6019fb4..c153187 100644 --- a/src/app/shared/web3.service.ts +++ b/src/app/shared/web3.service.ts @@ -92,7 +92,9 @@ export class Web3Service { .mergeMap(() => Observable.fromPromise(this.web3.eth.getBlock('pending'))) .distinctUntilChanged((a, b) => a.size === b.size) .mergeMap(() => Observable.fromPromise(this.web3.eth.getBlock('pending', true))) - .map(({transactions}) => transactions.filter(transaction => (transaction.from || '').toLowerCase() === account.toLowerCase())) + .map(({transactions}) => + transactions.filter(transaction => (transaction.from || '').toLowerCase() === (account || '').toLowerCase()), + ) .map(transactions => transactions.map(tx => tx.hash)) .distinctUntilChanged((a, b) => a.join('|') === b.join('|')) .scan((acc, transactions) =>