Skip to content

Commit

Permalink
Merge pull request #103 from smartcontractkit/release/v0.1.3
Browse files Browse the repository at this point in the history
Prepare release v0.1.3
  • Loading branch information
krebernisak authored Oct 29, 2020
2 parents 53053f3 + 3f7ff12 commit 6f9e746
Show file tree
Hide file tree
Showing 159 changed files with 626 additions and 438 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '12.x'
- run: yarn install
- run: yarn start-example-server&
- run: yarn test-example
- run: yarn test:example-start-server&
- run: yarn test:example
run-linters:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '12.x'
- run: yarn install
- run: yarn lint
run-unit-tests:
Expand All @@ -35,6 +35,6 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '12.x'
- run: yarn install
- run: yarn test:unit
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ jobs:
matrix:
adapter:
[
cryptoid,
bitso,
cryptomkt,
satoshitango,
bitex,
orchid-bandwidth,
genesis-volatility,
metalsapi,
bravenewcoin-vwap,
dxfeed,
Expand Down Expand Up @@ -104,7 +111,6 @@ jobs:
ethgasstation,
amberdata-gasprice,
blockchair,
cryptoid,
blockchain.com,
blockcypher,
wbtc-address-set,
Expand Down Expand Up @@ -174,7 +180,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./${{ matrix.adapter }}/dist/${{ matrix.adapter }}-adapter.zip
asset_path: ./composite/${{ matrix.adapter }}/dist/${{ matrix.adapter }}-adapter.zip
asset_name: ${{ steps.get_release_info.outputs.file_name }}-${{ matrix.adapter }}-adapter.zip
asset_content_type: application/zip

Expand Down
2 changes: 1 addition & 1 deletion 1forge/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const endpoint = validator.validated.data.endpoint || 'convert'
Expand Down
4 changes: 2 additions & 2 deletions 1forge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "1forge",
"version": "0.1.0",
"name": "@chainlink/1forge",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion 2-step/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const transform = (offchain, onchain, operator, dividendConfig) => {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const contract = validator.validated.data.contract
Expand Down
36 changes: 27 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,38 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.1.3] - 2020-10-29

### Added

- [Request coalescing](https://aws.amazon.com/builders-library/caching-challenges-and-strategies/) support to mitigate the issue of requests for data coming in bursts and missing the cache.
- Remote cache (Redis/ElastiCache) support, with adapter key grouping, to enable more efficient serverless deployments.
- Support for composite adapters
- Proof of Reserves composite adapter
- wBTC address set adapter
- renVM address set adapter
- blockchain.com BTC indexer adapter
- blockcypher BTC indexer adapter
- Caching improvements:
- [Request coalescing](https://aws.amazon.com/builders-library/caching-challenges-and-strategies/) support to mitigate the issue of requests for data coming in bursts and missing the cache.
- Remote cache (Redis/ElastiCache) support, with adapter key grouping, to enable more efficient serverless deployments.
- Support for composite adapters:
- `composite/proof-of-reserves` adapter combines multiple adapters to find total balance in custody for wBTC or renBTC protocols.
- New adapters:
- `wbtc-address-set` to query wBTC custody address set.
- `renvm-address-set` to query renVM protocol custody address set.
- `blockchain.com` to fetch balances for a set of Bitcoin addresses.
- `blockcypher` to fetch balances for a set of Bitcoin addresses.
- `reduce` to reduce an array to a result. Different reducers are supported like: `sum`, `product`, `average`, `median`, `min` & `max`.
- `trueusd` to query supply and issuance data for TrueUSD.
- `cryptoid` to get chain difficulty measurement from different networks.
- `blockchair` to get chain difficulty measurement from different networks.
- `bitso` to get last 24 hours volume weighted average price (vwap) for multiple markets.
- `cryptomkt` to get last transaction price for multiple markets.
- `satoshitango` to get last bid price for multiple markets.
- `bitex` to get volume weighted average price (vwap) for multiple markets.
- `orchid-bandwidth` to get available bandwidth from Chainlink as service provider.
- `genesis-volatility` to get implied volatility of an asset.
- `covid-tracker` to query COVID-19 statistics.
- `lition` to query the price in Euros per MWh for Lition.
- `coinlore` to query the Bitcoin market dominance and market capitalization.
- `messari` to query the Bitcoin market dominance.

### Changed

- Improved logs
- Improved logs.
- Prettier logs in development environment.

## [0.1.2] - 2020-09-18
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ new:
cp -r example/* $(adapter)
sed -i 's/example/$(adapter)/' $(adapter)/package.json
sed -i 's/Example/$(adapter)/' $(adapter)/README.md
sed '/\"workspaces\"/ a \ \ \ \ "$(adapter)",' package.json > package.json.new
mv package.json.new package.json
sed -i 's/"workspaces": \[/"workspaces": \[\n "$(adapter)",/' package.json

clean:
rm -rf $(adapter)/dist

deps: clean
# Call the build script for the adapter if defined (TypeScript adapters have this extra build/compile step)
# We use `wsrun` to build workspace dependencies in topological order (TODO: use native `yarn workspaces foreach -pt run build` with Yarn 2)
yarn && yarn wsrun -mre -p @chainlink/$(if $(name),$(name),$(adapter)) -t build
yarn --frozen-lockfile --production

build:
# Call the build script for the adapter if defined (TypeScript adapters have this extra build/compile step)
if [ $$(cat $(adapter)/package.json | grep "^ \"build\":" | wc -l) -ge 1 ]; then yarn --cwd $(adapter) build; fi
yarn ncc build $(adapter) -o $(adapter)/dist

clean-market-closure:
Expand Down
2 changes: 1 addition & 1 deletion alphachain/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const url = 'https://alpha-chain2.p.rapidapi.com/data-query'
Expand Down
4 changes: 2 additions & 2 deletions alphachain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alphachain",
"version": "0.1.0",
"name": "@chainlink/alphachain",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
15 changes: 4 additions & 11 deletions alphachain/test/adapter_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { assert } = require('chai')
const { assertSuccess, assertError } = require('@chainlink/external-adapter')
const { execute } = require('../adapter')

describe('execute', () => {
Expand Down Expand Up @@ -27,9 +28,7 @@ describe('execute', () => {
requests.forEach((req) => {
it(`${req.name}`, (done) => {
execute(req.testData, (statusCode, data) => {
assert.equal(statusCode, 200)
assert.equal(data.jobRunID, jobID)
assert.isNotEmpty(data.data)
assertSuccess({ expected: 200, actual: statusCode }, data, jobID)
assert.isAbove(data.result, 0)
assert.isAbove(data.data.result, 0)
done()
Expand All @@ -55,10 +54,7 @@ describe('execute', () => {
requests.forEach((req) => {
it(`${req.name}`, (done) => {
execute(req.testData, (statusCode, data) => {
assert.equal(statusCode, 400)
assert.equal(data.jobRunID, jobID)
assert.equal(data.status, 'errored')
assert.isNotEmpty(data.error)
assertError({ expected: 400, actual: statusCode }, data, jobID)
done()
})
})
Expand All @@ -80,10 +76,7 @@ describe('execute', () => {
requests.forEach((req) => {
it(`${req.name}`, (done) => {
execute(req.testData, (statusCode, data) => {
assert.equal(statusCode, 500)
assert.equal(data.jobRunID, jobID)
assert.equal(data.status, 'errored')
assert.isNotEmpty(data.error)
assertError({ expected: 500, actual: statusCode }, data, jobID)
done()
})
})
Expand Down
2 changes: 1 addition & 1 deletion alphavantage/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const url = 'https://www.alphavantage.co/query'
const jobRunID = validator.validated.id
Expand Down
4 changes: 2 additions & 2 deletions alphavantage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alphavantage",
"version": "0.1.0",
"name": "@chainlink/alphavantage",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion amberdata-gasprice/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const speed = validator.validated.data.speed || 'average'
Expand Down
4 changes: 2 additions & 2 deletions amberdata-gasprice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amberdata-gasprice",
"version": "0.1.0",
"name": "@chainlink/amberdata-gasprice",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion amberdata/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const coin = validator.validated.data.base
Expand Down
4 changes: 2 additions & 2 deletions amberdata/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amberdata",
"version": "0.1.0",
"name": "@chainlink/amberdata",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion anyblock-gasprice/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const endpoint = validator.validated.data.endpoint || 'latest-minimum-gasprice'
Expand Down
4 changes: 2 additions & 2 deletions anyblock-gasprice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anyblock-gasprice",
"version": "0.1.0",
"name": "@chainlink/anyblock-gasprice",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion anyblock-uniswap-vwap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build && yarn test:unit",
"build": "yarn && tsc",
"build": "tsc",
"lint": "eslint --ignore-path ../.eslintignore . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint --ignore-path ../.eslintignore . --ext .js,.jsx,.ts,.tsx --fix",
"test": "mocha --exit -r ts-node/register 'test/**/*.test.ts'",
Expand Down
12 changes: 7 additions & 5 deletions anyblock-uniswap-vwap/test/adapter.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from 'chai'
import { assertSuccess, assertError } from '@chainlink/external-adapter'
import { Requester, assertSuccess, assertError } from '@chainlink/external-adapter'
import { AdapterRequest } from '@chainlink/types'
import { execute } from '../src/adapter'

Expand Down Expand Up @@ -42,8 +42,9 @@ describe('execute', () => {
it(`${req.name}`, async () => {
try {
await execute(req.testData as AdapterRequest)
} catch (err) {
assertError({ expected: 400, actual: err.statusCode }, err, jobID)
} catch (error) {
const errorResp = Requester.errored(jobID, error)
assertError({ expected: 400, actual: errorResp.statusCode }, errorResp, jobID)
}
})
})
Expand All @@ -61,8 +62,9 @@ describe('execute', () => {
it(`${req.name}`, async () => {
try {
await execute(req.testData as AdapterRequest)
} catch (err) {
assertError({ expected: 500, actual: err.statusCode }, err, jobID)
} catch (error) {
const errorResp = Requester.errored(jobID, error)
assertError({ expected: 500, actual: errorResp.statusCode }, errorResp, jobID)
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion binance-dex/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const endpoint = validator.validated.data.endpoint || DEFAULT_DATA_ENDPOINT
Expand Down
4 changes: 2 additions & 2 deletions binance-dex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "binance-dex",
"version": "0.1.0",
"name": "@chainlink/binance-dex",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion bitex/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const endpoint = validator.validated.data.endpoint || 'tickers'
Expand Down
4 changes: 2 additions & 2 deletions bitex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitex",
"version": "0.1.0",
"name": "@chainlink/bitex",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion bitso/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const customParams = {

const execute = (input, callback) => {
const validator = new Validator(input, customParams)
if (validator.error) return callback(validator.error.statusCode, validator.error)
if (validator.error) return callback(validator.error.statusCode, validator.errored)

const jobRunID = validator.validated.id
const endpoint = validator.validated.data.endpoint || 'ticker'
Expand Down
4 changes: 2 additions & 2 deletions bitso/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitso",
"version": "0.1.0",
"name": "@chainlink/bitso",
"version": "0.0.1",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion blockchain.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build && yarn test:unit",
"build": "yarn && tsc",
"build": "tsc",
"lint": "eslint --ignore-path ../.eslintignore . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint --ignore-path ../.eslintignore . --ext .js,.jsx,.ts,.tsx --fix",
"test": "mocha --exit -r ts-node/register 'test/**/*.test.ts'",
Expand Down
Loading

0 comments on commit 6f9e746

Please sign in to comment.