Skip to content

Commit

Permalink
Address audit feedback, fix up poster, and other improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jflatow committed Jul 28, 2020
1 parent d0a0d03 commit f3d798f
Show file tree
Hide file tree
Showing 44 changed files with 2,813 additions and 3,337 deletions.
3 changes: 2 additions & 1 deletion .build/ropsten.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"DelFiPrice": "0xA7637AD217af1DD781b7DDeD452CE339cfb4a312",
"AnchoredPriceView": "0x4745ed21F933C445F6021E1949817c6C281329d2",
"MockAnchorOracle": "0xF054B68676900ECB13b7107019b062662B50d3d7",
"AnchoredView": "0xcaF366e452f9613Cb3fabe094619cc1e1e2aC149"
"AnchoredView": "0xcaF366e452f9613Cb3fabe094619cc1e1e2aC149",
"UniswapAnchoredView": "0xCCD252F17E7F69C1ce813DDE398e878A8D8A2202"
}
72 changes: 64 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
version: 2.1

orbs:
codecov: codecov/[email protected]

jobs:
test_oracle:
docker:
- image: circleci/node:11
- image: circleci/node:12
working_directory: ~/repo
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
|
sudo wget https://github.com/ethereum/solidity/releases/download/v0.6.10/solc-static-linux -O /usr/local/bin/solc
Expand Down Expand Up @@ -41,17 +42,71 @@ jobs:
- sdk/javascript/node_modules
key: v1-sdk-dependencies-{{ checksum "sdk/javascript/package.json" }}
- run: mkdir ~/junit-oracle
- run: npx saddle compile
- run: docker-compose -p open-oracle build
- run: JEST_JUNIT_OUTPUT=~/junit-oracle/test-results.xml npx saddle test tests/*Test.js -- --ci --reporters=default --reporters=jest-junit
- run: JEST_JUNIT_OUTPUT=~/junit-oracle/test-results.xml script/test tests/*Test.js -- --ci --reporters=default --reporters=jest-junit
- store_test_results:
path: ~/junit-oracle
- store_artifacts:
path: ~/junit-oracle

test_coverage:
docker:
- image: circleci/node:13
working_directory: ~/repo
steps:
- run:
|
sudo wget https://github.com/ethereum/solidity/releases/download/v0.6.10/solc-static-linux -O /usr/local/bin/solc
sudo chmod +x /usr/local/bin/solc
- checkout
- restore_cache:
keys:
- cov-v1-dependencies-{{ checksum "package.json" }}
- cov-v1-dependencies-
- restore_cache:
keys:
- cov-v1-poster-dependencies-{{ checksum "poster/package.json" }}
- cov-v1-poster-dependencies-
- restore_cache:
keys:
- cov-v1-sdk-dependencies-{{ checksum "sdk/javascript/package.json" }}
- cov-v1-sdk-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: cov-v1-dependencies-{{ checksum "package.json" }}
- run: cd poster && yarn install && yarn prepare
- save_cache:
paths:
- poster/node_modules
key: cov-v1-poster-dependencies-{{ checksum "poster/package.json" }}
- run: cd sdk/javascript && yarn install && yarn prepare
- save_cache:
paths:
- sdk/javascript/node_modules
key: cov-v1-sdk-dependencies-{{ checksum "sdk/javascript/package.json" }}
- run: mkdir ~/junit-oracle
- run:
shell: /bin/bash -eox pipefail -O globstar
name: yarn coverage
no_output_timeout: 30m
command: JEST_JUNIT_OUTPUT_DIR=~/junit-oracle JEST_JUNIT_OUTPUT_NAME=test-results.xml script/coverage $(circleci tests glob 'tests/**/**Test.js' | circleci tests split --split-by=timings) -- --maxWorkers=4
- store_test_results:
path: ~/junit-oracle
- store_artifacts:
path: ~/repo/coverage/coverage-final.json
destination: coverage-final.json
- store_artifacts:
path: ~/repo/coverage/lcov-report
destination: coverage
- codecov/upload:
file: ~/repo/coverage/coverage-final.json
parallelism: 3
resource_class: xlarge

test_poster:
docker:
- image: circleci/node:11
- image: circleci/node:12
working_directory: ~/repo/poster
steps:
- checkout:
Expand All @@ -74,7 +129,7 @@ jobs:

test_reporter_javascript:
docker:
- image: circleci/node:11
- image: circleci/node:12
working_directory: ~/repo/sdk/javascript
steps:
- checkout:
Expand All @@ -100,5 +155,6 @@ workflows:
test:
jobs:
- test_oracle
- test_coverage
- test_poster
- test_reporter_javascript
23 changes: 23 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no

ignore:
- "tests/contracts"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*.tsbuilt*
*.DS_Store*
.build/contracts.json
.build/contracts-trace.json
.build/test.json
.build/development.json
yarn-error.log
junit.xml
coverage/*
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:13.6.0-alpine3.10
FROM node:14.5.0-alpine3.10
WORKDIR /open-oracle
RUN wget https://github.com/ethereum/solidity/releases/download/v0.6.10/solc-static-linux -O /usr/local/bin/solc && chmod +x /usr/local/bin/solc
RUN apk update && apk add --no-cache --virtual .gyp \
Expand All @@ -10,9 +10,9 @@ RUN apk update && apk add --no-cache --virtual .gyp \
git

RUN yarn global add node-gyp npx
COPY package.json /open-oracle/package.json
COPY package.json yarn.lock /open-oracle/

RUN yarn install
RUN yarn install --frozen-lockfile

ENV PROVIDER PROVIDER
COPY contracts contracts
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ The poster is a simple application that reads from a given feed (or set of feeds

## Contributing

Note: the code in this repository is held under the MIT license. Any contributors must agree to release contributed code under this same license. Please submit an issue (or create a pull request) for any issues or contributions to the project.
Note: all code contributed to this repository must be licensed under each of 1. MIT, 2. BSD-3, and 3. GPLv3. By contributing code to this repository, you accept that your code is allowed to be released under any or all of these licenses or licenses in substantially similar form to these listed above.

Please submit an issue (or create a pull request) for any issues or contributions to the project. Make sure that all test cases pass, including the integration tests in the root of this project.
Loading

0 comments on commit f3d798f

Please sign in to comment.